-
-
Notifications
You must be signed in to change notification settings - Fork 237
/
CMakeLists.txt
58 lines (43 loc) · 1.65 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.2)
set(FDEEP_TOP_DIR ${CMAKE_CURRENT_LIST_DIR})
list(APPEND CMAKE_MODULE_PATH "${FDEEP_TOP_DIR}/cmake")
include(cmake/hunter.cmake) # default off
project(frugally-deep VERSION 0.16.0)
message(STATUS "===( ${PROJECT_NAME} ${PROJECT_VERSION} )===")
option(FDEEP_BUILD_UNITTEST "Build unit tests" OFF)
option(FDEEP_USE_TOOLCHAIN "Use external toolchain" OFF)
option(FDEEP_USE_DOUBLE "Use double precision" OFF)
if(NOT FDEEP_USE_TOOLCHAIN)
include(cmake/toolchain.cmake)
endif()
add_library(fdeep INTERFACE)
add_library(${PROJECT_NAME}::fdeep ALIAS fdeep)
target_include_directories(fdeep INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
)
if(FDEEP_USE_DOUBLE)
target_compile_definitions(fdeep INTERFACE FDEEP_FLOAT_TYPE=double)
endif()
find_package(Threads REQUIRED)
target_link_libraries(fdeep INTERFACE Threads::Threads)
hunter_add_package(FunctionalPlus) # default noop
if(NOT TARGET FunctionalPlus::fplus) # if not used via subdirectory
find_package(FunctionalPlus CONFIG REQUIRED)
endif()
target_link_libraries(fdeep INTERFACE FunctionalPlus::fplus)
hunter_add_package(Eigen) # default noop
if(NOT TARGET Eigen3::Eigen) # if not used via subdirectory
find_package(Eigen3 CONFIG REQUIRED)
endif()
target_link_libraries(fdeep INTERFACE Eigen3::Eigen)
hunter_add_package(nlohmann_json) # default noop
if(NOT TARGET nlohmann_json) # if not used via subdirectory
find_package(nlohmann_json CONFIG REQUIRED)
endif()
target_link_libraries(fdeep INTERFACE nlohmann_json)
if(FDEEP_BUILD_UNITTEST)
enable_testing()
add_subdirectory(test)
endif()
# pkgconfig installation:
include(cmake/pkgconfig.cmake)