forked from Dobiasd/frugally-deep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (36 loc) · 1.37 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
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.9.3)
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)
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
find_package(FunctionalPlus CONFIG REQUIRED)
target_link_libraries(fdeep INTERFACE FunctionalPlus::fplus)
hunter_add_package(Eigen) # default noop
find_package(Eigen3 CONFIG REQUIRED)
target_link_libraries(fdeep INTERFACE Eigen3::Eigen)
hunter_add_package(nlohmann_json) # default noop
find_package(nlohmann_json CONFIG REQUIRED)
target_link_libraries(fdeep INTERFACE nlohmann_json)
if(FDEEP_BUILD_UNITTEST)
enable_testing()
subdirs(test)
endif()
# pkgconfig installation:
include(cmake/pkgconfig.cmake)