-
Notifications
You must be signed in to change notification settings - Fork 173
/
CMakeLists.txt
64 lines (50 loc) · 2.69 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
cmake_minimum_required (VERSION 3.15.5)
project(StereoPipeline)
if(APPLE)
# Needed for conda build on OSX with conda
cmake_policy(SET CMP0025 NEW)
endif(APPLE)
# Make it possible to append to these from the command line
set(CMAKE_CXX_FLAGS "" CACHE STRING "")
set(CMAKE_C_FLAGS "" CACHE STRING "")
# cmake fails without the -L flag in CMAKE_CXX_FLAGS, oddly enough.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++17 -DNDEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
set(CMAKE_EXE_LINKER_FLAGS "-pthread -lpthread")
if (APPLE)
# A workaround for the clang included with conda build
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlinker-version=305")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlinker-version=305")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mlinker-version=305")
# Prevent a pedantic error in recent clang
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-enum-constexpr-conversion")
else()
# On Linux need to link to additional libraries
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lm -lrt -lgcc_s")
endif()
# Tell cmake to look in the /cmake folder.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# Make sure we do a release type
set(CMAKE_BUILD_TYPE "Release")
message("Setting CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
add_subdirectory(src)
install(FILES "AUTHORS.rst" DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES "INSTALLGUIDE.rst" DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES "LICENSE" DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES "NEWS.rst" DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES "README.rst" DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES "stereo.default.example" DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES "THIRDPARTYLICENSES.rst" DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY "examples" DESTINATION ${CMAKE_INSTALL_PREFIX})
# Install only the .rst files as images take too much space
install(DIRECTORY "docs" DESTINATION ${CMAKE_INSTALL_PREFIX}
FILES_MATCHING PATTERN "*.rst")
# Install the plugins directory and the files in it
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/plugins/stereo)
install(FILES "plugins/stereo/plugin_list.txt" DESTINATION ${CMAKE_INSTALL_PREFIX}/plugins/stereo)
# Make a directory for wv_correct data and copy that data to it
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/share/wv_correct)
install(FILES "src/asp/WVCorrect/ms_correction_lookup.txt" DESTINATION ${CMAKE_INSTALL_PREFIX}/share/wv_correct)
install(FILES "src/asp/WVCorrect/WV02_BAND3_CCD_CORR.tif" DESTINATION ${CMAKE_INSTALL_PREFIX}/share/wv_correct)
# Install the default CASP-GO params
install(FILES "src/asp/Gotcha/CASP-GO_params.xml" DESTINATION ${CMAKE_INSTALL_PREFIX}/share)