From bb6eb1b24f4b53442fe43aa37c127fe9e1a97096 Mon Sep 17 00:00:00 2001 From: McMassiveNZ <12842622+McMassiveNZ@users.noreply.github.com> Date: Fri, 16 Dec 2022 23:10:43 +0100 Subject: [PATCH] Reshuffle folder structure Reshuffle folder structure and update cmake.yml --- .github/workflows/cmake.yml | 13 ++++++------- CMakeLists.txt | 8 ++++---- scripts/{ => cmake}/compilerwarnings.cmake | 0 scripts/{ => cmake}/googletest.cmake | 0 scripts/{ => cmake}/precompiled.cmake | 0 scripts/{ => cmake}/sanitizers.cmake | 0 scripts/{ => cmake}/staticanalysis.cmake | 0 src/CMakeLists.txt | 5 ++++- src/main.cpp | 4 ++-- test/CMakeLists.txt | 2 +- 10 files changed, 17 insertions(+), 15 deletions(-) rename scripts/{ => cmake}/compilerwarnings.cmake (100%) rename scripts/{ => cmake}/googletest.cmake (100%) rename scripts/{ => cmake}/precompiled.cmake (100%) rename scripts/{ => cmake}/sanitizers.cmake (100%) rename scripts/{ => cmake}/staticanalysis.cmake (100%) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 7079aff..e1b6c1c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -21,11 +21,6 @@ jobs: matrix: os: [windows-latest, ubuntu-latest] BUILD_TYPE: [Debug, Release] - include: - - os: windows-latest - - BOOTSTRAP: bootstrap-vcpkg.bat - - os: ubuntu-latest - - BOOTSTRAP: bootstrap-vcpkg.sh steps: - name: checkout @@ -33,8 +28,12 @@ jobs: with: submodules: true - - name: bootstrap-vcpkg - run: ${{github.workspace}}/external/vcpkg/${{matrix.BOOTSTRAP}} + - name: bootstrap vcpkg + if: runner.os == 'windows' + run: ${{github.workspace}}/external/vcpkg/bootstrap-vcpkg.bat -disableMetrics + + if: runner.os != 'windows' + run: ${{github.workspace}}/external/vcpkg/bootstrap-vcpkg.sh -disableMetrics - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. diff --git a/CMakeLists.txt b/CMakeLists.txt index b984eac..9ccd374 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,11 +17,11 @@ OPTION(ENABLE_WARNINGS_AS_ERRORS "Warnings are treated as Errors" ON) OPTION(ENABLE_STATIC_ANALYSIS "Enable Static Analysis Tools" ON) OPTION(ENABLE_SANITIZERS "Enable Sanitizer Tools" ON) -set(SCRIPTS_DIR ${CMAKE_CURRENT_LIST_DIR}/scripts) +set(CMAKE_SCRIPTS_DIR ${CMAKE_CURRENT_LIST_DIR}/scripts/cmake) -include(${SCRIPTS_DIR}/compilerwarnings.cmake) -include(${SCRIPTS_DIR}/sanitizers.cmake) -include(${SCRIPTS_DIR}/staticanalysis.cmake) +include(${CMAKE_SCRIPTS_DIR}/compilerwarnings.cmake) +include(${CMAKE_SCRIPTS_DIR}/sanitizers.cmake) +include(${CMAKE_SCRIPTS_DIR}/staticanalysis.cmake) if (ENABLE_TESTS) message("Unit Testing Enabled") diff --git a/scripts/compilerwarnings.cmake b/scripts/cmake/compilerwarnings.cmake similarity index 100% rename from scripts/compilerwarnings.cmake rename to scripts/cmake/compilerwarnings.cmake diff --git a/scripts/googletest.cmake b/scripts/cmake/googletest.cmake similarity index 100% rename from scripts/googletest.cmake rename to scripts/cmake/googletest.cmake diff --git a/scripts/precompiled.cmake b/scripts/cmake/precompiled.cmake similarity index 100% rename from scripts/precompiled.cmake rename to scripts/cmake/precompiled.cmake diff --git a/scripts/sanitizers.cmake b/scripts/cmake/sanitizers.cmake similarity index 100% rename from scripts/sanitizers.cmake rename to scripts/cmake/sanitizers.cmake diff --git a/scripts/staticanalysis.cmake b/scripts/cmake/staticanalysis.cmake similarity index 100% rename from scripts/staticanalysis.cmake rename to scripts/cmake/staticanalysis.cmake diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9aef086..93d2b4f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,9 @@ add_executable( main.cpp ) +find_package(spdlog CONFIG REQUIRED) +target_link_libraries(${current_target} PRIVATE spdlog::spdlog spdlog::spdlog_header_only) + if( ENABLE_ALL_REASONABLE_WARNINGS ) MESSAGE("Additional Warnings Enabled") target_enable_warnings(${current_target}) @@ -23,4 +26,4 @@ endif() if( ENABLE_STATIC_ANALYSIS ) MESSAGE("Static Analysis Enabled") target_enable_static_analysis(${current_target}) -endif() \ No newline at end of file +endif() diff --git a/src/main.cpp b/src/main.cpp index 1e9630d..d75c935 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,8 +1,8 @@ -#include +#include auto main() -> int { - printf("Hello, World!"); + spdlog::trace("Hello, World!"); return 0; } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5568e17..c68308a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -include(${SCRIPTS_DIR}/googletest.cmake) +include(${CMAKE_SCRIPTS_DIR}/googletest.cmake) add_executable( blank-slate-test