-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (51 loc) · 1.99 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
68
69
70
71
72
73
74
project("VisionUtils")
cmake_minimum_required(VERSION 3.0)
add_definitions(-std=c++11)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}; -std=c++11; --expt-relaxed-constexpr; -O3; --expt-extended-lambda; --verbose; --use_fast_math;")
find_package(Caffe)
find_package(CUDA REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Pangolin)
file(GLOB VisionUtilsHeaders
"${PROJECT_SOURCE_DIR}/Include/*.h"
"${PROJECT_SOURCE_DIR}/Include/*/*.h")
file(GLOB VisionUtilsSources
"${PROJECT_SOURCE_DIR}/Src/*.cpp"
"${PROJECT_SOURCE_DIR}/Src/*/*.cpp"
"${PROJECT_SOURCE_DIR}/Src/*.cu"
"${PROJECT_SOURCE_DIR}/Src/*/*.cu")
set(IncludeDirs
${PROJECT_SOURCE_DIR}/Include
${EIGEN3_INCLUDE_DIRS})
if(${Caffe_FOUND})
set(IncludeDirs ${IncludeDirs} ${Caffe_INCLUDE_DIRS})
set(Libraries ${Libraries} ${Caffe_LIBRARIES})
add_definitions(-DHAS_CAFFE)
endif()
if(${Pangolin_FOUND})
set(IncludeDirs ${IncludeDirs} ${Pangolin_INCLUDE_DIRS})
set(Libraries ${Libraries} ${Pangolin_LIBRARIES})
add_definitions(-DHAS_PANGOLIN)
endif()
cuda_add_library(VisionUtils SHARED
${VisionUtilsHeaders}
${VisionUtilsSources})
target_include_directories(VisionUtils PUBLIC ${IncludeDirs})
target_link_libraries(VisionUtils ${Libraries})
# -=-=-=-=- Installation -=-=-=-=-
set( VisionUtils_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include/" )
set( VisionUtils_INCLUDE_DIRS ${VisionUtils_INCLUDE_DIR} )
set( VisionUtils_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib/" )
set( VisionUtils_LIBRARY_DIRS ${VisionUtils_LIBRARY_DIR} )
set( VisionUtils_LIBRARY VisionUtils )
set( VisionUtils_LIBRARIES ${VisionUtils_LIBRARY} )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/VisionUtilsConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/VisionUtilsConfig.cmake
@ONLY ESCAPE_QUOTES)
install(TARGETS VisionUtils
DESTINATION lib)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/Include/vu/
DESTINATION include/vu/
FILES_MATCHING PATTERN "*.h")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/VisionUtilsConfig.cmake
DESTINATION share/)