-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
36 lines (28 loc) · 977 Bytes
/
CMakeLists.txt
File metadata and controls
36 lines (28 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
cmake_minimum_required(VERSION 3.28)
# link vcpkg packages.
if (DEFINED ENV{VCPKG_ROOT})
set(VCPKG_ROOT $ENV{VCPKG_ROOT})
else ()
include(FetchContent)
FetchContent_Declare(vcpkg
GIT_REPOSITORY https://github.com/microsoft/vcpkg/
)
FetchContent_MakeAvailable(vcpkg)
set(VCPKG_ROOT ${vcpkg_SOURCE_DIR})
endif()
message(STATUS "Using VCPKG_ROOT: ${VCPKG_ROOT}")
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file")
project(PasswordGen)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 20)
# Enable testing for google tests
enable_testing()
include(CTest)
add_subdirectory(generator)
add_subdirectory(tests)
option(BUILD_TESTS_ONLY "Configure only the tests directory" OFF)
# Conditionally add projects. Used for github build action, as we only need to build/run tests there
if(NOT BUILD_TESTS_ONLY)
add_subdirectory(gui)
add_subdirectory(cli)
endif()