Repository navigation
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
48 lines (38 loc) · 1.8 KB
/
Copy pathCMakeLists.txt
File metadata and controls
48 lines (38 loc) · 1.8 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
# Works with 3.14 and tested through 3.29
cmake_minimum_required(VERSION 3.14...3.29)
# Use vcpkg toolchain if available (Windows)
if(WIN32 AND DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "vcpkg toolchain")
endif()
# Project name and a few useful settings. Other commands can pick up the results
project(orienteering-cpp)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message("----------------------------------------")
message("[INFO] Start configuring project ${PROJECT_NAME}: ${CMAKE_SOURCE_DIR}")
# FetchContent added in CMake 3.11, downloads during the configure step
# FetchContent_MakeAvailable was added in CMake 3.14; simpler usage
include(FetchContent)
# The compiled library code is here
add_subdirectory(src)
# The executable code is here
add_subdirectory(examples)
# Testing only available if this is the main app
# Emergency override MODERN_CMAKE_BUILD_TESTING provided as well
# OTHERWISE, DEACTIVATE THIS PART
option(PACKAGE_TESTS "Build the tests" ON)
message("[INFO] Build the tests: ${PACKAGE_TESTS}")
if(PACKAGE_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
# Optional experimental module: external-solver-backed knowledge base
# (kb_ls_cpp heritage -- SAT/BDD/CP backends). OFF by default so the core library
# stays dependency-free. See experimental/external_kb/README.md.
option(ENABLE_EXTERNAL_KB "Build the experimental external-solver KB backends (needs CryptoMiniSat/CUDD/CPLEX)" OFF)
message("[INFO] External KB backends (ENABLE_EXTERNAL_KB): ${ENABLE_EXTERNAL_KB}")
if(ENABLE_EXTERNAL_KB)
add_subdirectory(experimental/external_kb)
endif()
message("[INFO] Configuring project ${PROJECT_NAME} successful!")
message("----------------------------------------")