-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
67 lines (46 loc) · 1.82 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.25)
project(nova_symbol VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
########################################################################################################################
add_custom_target(nova_symbol_project_files SOURCES
.clang-tidy
.pre-commit-config.yaml
_clang-format
conanfile.txt
Readme.md
License.txt
.github/workflows/ci.yml
cmake/conan_provider.cmake
)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS conanfile.txt)
########################################################################################################################
find_package(Boost)
find_package(Cityhash)
find_package(Catch2 CONFIG)
########################################################################################################################
set(Sources
inc/nova/symbol/symbol.hpp
src/nova/symbol/symbol.cpp
)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${Sources})
add_library(nova_symbol STATIC ${Sources})
target_include_directories(nova_symbol PUBLIC inc)
target_link_libraries(nova_symbol
PUBLIC Boost::headers
PRIVATE cityhash::cityhash
)
if (APPLE)
target_link_libraries(nova_symbol
PRIVATE Boost::container # pmr fallback
)
endif()
########################################################################################################################
option(NOVA_SYMBOL_BUILD_TEST "Build unit tests" ON)
if (NOVA_SYMBOL_BUILD_TEST)
enable_testing()
add_executable(nova_symbol_test test/symbol_test.cpp)
add_test(NAME nova_symbol_test COMMAND nova_symbol_test)
target_link_libraries(nova_symbol_test
PUBLIC Catch2::Catch2WithMain nova_symbol)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES test/symbol_test.cpp)
endif()