-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (40 loc) · 1.7 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
40
41
42
43
44
45
46
47
48
49
50
cmake_minimum_required(VERSION 3.20)
project(sym2 VERSION 0.0.0 DESCRIPTION "Fast, tiny symbolic library" LANGUAGES CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
# This will change the bin/ and lib/ output directories for this project to ${CMAKE_BINARY_DIR}/bin
# and ${CMAKE_BINARY_DIR}/lib. We can pass NO_OUTPUT_DIRS to prevent that, but I find the build tree
# layout desirable.
conan_basic_setup(TARGETS KEEP_RPATHS)
set(Boost_INCLUDE_DIRS ${CONAN_INCLUDE_DIRS_BOOST-HEADERS})
set(CMakeCoverage ${CONAN_CMAKE-COVERAGE_ROOT}/CodeCoverage.cmake)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_TESTING "Compile unit tests" ON)
option(WITH_COVERAGE "Enable test coverage flags/generation" OFF)
option(WITH_SANITIZER "Enable UB and address sanitizer" OFF)
option(WITH_BENCHMARKS "Compile comparative benchmarks" ON)
option(WITH_UNITY_BUILD "Compile library with a single TU" OFF)
option(COLORED_OUTPUT "Force ANSI-colored output (GNU/Clang)." ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(cmake/Compiler.cmake)
include(cmake/Flags.cmake)
include(cmake/Sanitizer.cmake)
include(cmake/RunChibi.cmake)
if(${WITH_COVERAGE})
include(${CMakeCoverage})
append_coverage_compiler_flags()
endif()
add_subdirectory(src)
add_subdirectory(bindings)
if(${BUILD_TESTING} AND (${PROJECT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR}))
enable_testing()
add_subdirectory(tests)
if(${WITH_COVERAGE})
setup_target_for_coverage_lcov(NAME coverage
EXECUTABLE ctest
NO_DEMANGLE
EXCLUDE tests/* lib/* /usr/* /Library*)
endif()
endif()
if(${WITH_BENCHMARKS} AND (${PROJECT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR}))
add_subdirectory(benchmarks)
endif()