-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathCMakeLists.txt
82 lines (70 loc) · 2.07 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
75
76
77
78
79
80
81
82
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(pwmvs VERSION 0.0.1 LANGUAGES CXX)
find_package(OpenMVG REQUIRED)
find_package(Eigen3 REQUIRED NO_MODULE)
find_package(OpenMP REQUIRED)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
add_library(pwmvs
src/fusion.cpp
src/pwmvs.cpp
src/pwmvs_controller.cpp
src/workspace.cpp
src/progress.cpp
)
target_include_directories(pwmvs
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE
src
)
target_link_libraries(pwmvs
PUBLIC
OpenMVG::openMVG_multiview
OpenMVG::openMVG_sfm
OpenMVG::openMVG_image
OpenMVG::openMVG_features
Eigen3::Eigen)
target_compile_features(pwmvs
PUBLIC
cxx_generic_lambdas
)
add_executable(run "src/main.cpp")
target_include_directories(run PRIVATE src)
target_link_libraries(run PRIVATE pwmvs)
add_executable(colmap_investigator "src/colmap_investigator.cpp")
target_include_directories(colmap_investigator PRIVATE src)
target_link_libraries(colmap_investigator PRIVATE pwmvs)
install(DIRECTORY include/ DESTINATION include)
#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/core_export.h DESTINATION include)
install(
TARGETS pwmvs
EXPORT "pwmvsTargets"
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)
install(EXPORT "pwmvsTargets"
DESTINATION share/pwmvs/cmake
)
# install config files
include(CMakePackageConfigHelpers)
configure_package_config_file(pwmvsConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/pwmvsConfig.cmake
INSTALL_DESTINATION share/pwmvs/cmake
)
write_basic_package_version_file(
pwmvsConfigVersion.cmake
VERSION 0.0.1
COMPATIBILITY SameMajorVersion
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/pwmvsConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/pwmvsConfigVersion.cmake
DESTINATION share/pwmvs/cmake
)