diff --git a/CMakeLists.txt b/CMakeLists.txt index c3dfb43..8a4e56f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,25 +1,6 @@ cmake_minimum_required(VERSION 3.16) -include(FetchContent) -FetchContent_Declare( - vcpkg - GIT_REPOSITORY https://github.com/microsoft/vcpkg - GIT_TAG 1257354a3ab0bebd8abe95281ca561537853578c -) - -if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) - FetchContent_GetProperties(vcpkg - POPULATED vcpkg_POPULATED - SOURCE_DIR vcpkg_SOURCE_DIR) - if(NOT vcpkg_POPULATED) - FetchContent_Populate(vcpkg) - endif() - - set(CMAKE_TOOLCHAIN_FILE - "${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake") - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchain.cmake") -endif() +include(cmake/vcpkg.cmake) project(pacman LANGUAGES CXX) @@ -27,6 +8,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) enable_testing() + add_subdirectory(scaling-lib) add_subdirectory(lib) add_subdirectory(src) diff --git a/cmake/vcpkg.cmake b/cmake/vcpkg.cmake new file mode 100644 index 0000000..6408348 --- /dev/null +++ b/cmake/vcpkg.cmake @@ -0,0 +1,20 @@ +include(FetchContent) +FetchContent_Declare( + vcpkg + GIT_REPOSITORY https://github.com/microsoft/vcpkg + GIT_TAG 1257354a3ab0bebd8abe95281ca561537853578c +) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) + FetchContent_GetProperties(vcpkg + POPULATED vcpkg_POPULATED + SOURCE_DIR vcpkg_SOURCE_DIR) + if(NOT vcpkg_POPULATED) + FetchContent_Populate(vcpkg) + endif() + + set(CMAKE_TOOLCHAIN_FILE + "${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE + "${CMAKE_CURRENT_LIST_DIR}/toolchain.cmake") +endif()