forked from project-arcana/typed-geometry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
58 lines (42 loc) · 1.71 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
cmake_minimum_required(VERSION 3.8)
project(TypedGeometry)
if (NOT TARGET clean-core)
message(FATAL_ERROR "[typed-geometry] clean-core must be available")
endif()
include(cmake/IsCPUExtensionSupported.cmake)
is_cpu_extension_supported(BMI2_SUPPORTED "bmi2")
is_cpu_extension_supported(LZCNT_SUPPORTED "lzcnt")
option(TG_EXPORT_LITERALS "if true, spills tg::literals into the global namespace (i.e. 180_deg works out of the box)" ON)
option(TG_EIGEN_TESTS "Build typed-geometry tests that require eigen" OFF)
option(TG_IMPLEMENTATION_REPORT "Test-case that generates implementation coverage" OFF)
if(BMI2_SUPPORTED AND LZCNT_SUPPORTED)
option(TG_ENABLE_FIXED_INT "if true, enables TGs fixed_int feature. Requires a modern CPU" ON)
else()
message("fixed_int feature disabled as it requires support for bmi2 and lzcnt!")
option(TG_ENABLE_FIXED_INT "if true, enables TGs fixed_int feature. Requires a modern CPU" OFF)
endif()
# ===============================================
# Create target
file(GLOB_RECURSE SOURCES
"src/*.cc"
"src/*.hh"
)
if(NOT TG_ENABLE_FIXED_INT)
list(FILTER SOURCES EXCLUDE REGEX ".*fixed_int.*")
list(FILTER SOURCES EXCLUDE REGEX ".*fixed_uint.*")
endif()
# =========================================
# define library
file(GLOB_RECURSE SOURCES "src/*.cc")
file(GLOB_RECURSE HEADERS "src/*.hh")
arcana_add_library(TG typed-geometry SOURCES HEADERS)
target_include_directories(typed-geometry PUBLIC src/)
target_link_libraries(typed-geometry PUBLIC
clean-core
)
if (TG_EXPORT_LITERALS)
target_compile_definitions(typed-geometry PUBLIC TG_EXPORT_LITERALS)
endif()
if(TG_IMPLEMENTATION_REPORT)
target_compile_definitions(typed-geometry PUBLIC TG_IMPLEMENTATION_REPORT)
endif()