-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (29 loc) · 1.11 KB
/
CMakeLists.txt
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
cmake_minimum_required (VERSION 3.12)
project(cppcausality LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
#set(CMAKE_FIND_DEBUG_MODE 1)
# Set the output directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
message(STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
# Run Conan install if necessary
if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.lock" OR NOT EXISTS "${CMAKE_BINARY_DIR}/build/generators/conan_toolchain.cmake")
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --build=missing --output-folder ${CMAKE_BINARY_DIR})
endif()
# Set the CMP0091 policy to NEW
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
# Debug
message("Install directory: ${CMAKE_INSTALL_PREFIX}")
# Include the Conan toolchain file
include(${CMAKE_BINARY_DIR}/build/generators/conan_toolchain.cmake)
find_package(Boost COMPONENTS math)
add_subdirectory(src)
option(RUN_TESTS "Build the tests" ON)
if(RUN_TESTS)
enable_testing()
add_subdirectory(tests)
endif()