-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
49 lines (34 loc) · 1.06 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
cmake_minimum_required(VERSION 3.21)
project(cthash VERSION 1.0 LANGUAGES CXX)
if (PROJECT_IS_TOP_LEVEL)
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(colors)
option(CTHASH_TESTS "Enable CTHASH testing" OFF)
if (CTHASH_TESTS)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/catch2/CMakeLists.txt)
message(STATUS "Using local copy of catch2")
#set(CATCH_CONFIG_FAST_COMPILE ON)
add_subdirectory(external/catch2 EXCLUDE_FROM_ALL SYSTEM)
endif()
option(CTHASH_COVERAGE "Enable CTHASH test-coverage" ON)
if (CTHASH_COVERAGE)
include(coverage)
enable_coverage()
else()
message(STATUS "Test coverage measurement is OFF")
endif()
add_subdirectory(tests)
else()
message(STATUS "Tests are disabled")
endif()
include(pedantic)
option(CTHASH_EXAMPLES "Build CTHASH examples" ON)
if (CTHASH_EXAMPLES)
add_subdirectory(examples)
add_executable(example example.cpp)
target_link_libraries(example cthash)
add_executable(checksum checksum.cpp)
target_link_libraries(checksum cthash)
endif()
endif()
add_subdirectory(include)