-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (39 loc) · 1.22 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
cmake_minimum_required(VERSION 3.10)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(zda VERSION 1.0)
include(cmake/cache_var.cmake)
include(cmake/compile_flag.cmake)
include(cmake/install.cmake)
aux_source_directory(src ZDA_SRC)
file(GLOB_RECURSE ZDA_INCLUDE zda/*.h zda/*.hpp)
message(STATUS "Headers = ${ZDA_INCLUDE}")
message(STATUS "Sources = ${ZDA_SRC}")
message(STATUS "BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
add_library(zda ${ZDA_SRC} ${ZDA_INCLUDE})
if (BUILD_SHARED_LIBS)
target_compile_definitions(zda
PRIVATE ZDA_BUILD_SHARED
)
else ()
target_compile_definitions(zda
PUBLIC ZDA_STATIC
)
endif ()
target_include_directories(zda
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/zda>"
)
###############################################
# Installation
###############################################
message(STATUS "Generating (${PROJECT_NAME}) install files...")
conzxy_install(PROJECT zda NAMESPACE zda TARGETS zda)
install(TARGETS zda DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY zda DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
if (ZDA_INCLUDE_TEST)
add_subdirectory(test)
endif ()
if (ZDA_INCLUDE_BENCHMARK)
add_subdirectory(benchmark)
endif ()