-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
61 lines (52 loc) · 1.86 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
cmake_minimum_required(VERSION 3.20)
project(upsp)
cmake_policy(SET CMP0074 NEW)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (MSVC)
# For MSVC to get things like "or", "and", ...
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-")
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
# This ensures any link paths used at build time are preserved in
# the installed targets. This supports cases where the user has
# supplied third-party libraries in non-system locations (for
# instance, if making use of a local vcpkg setup)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
if (DEFINED SKBUILD)
# prevent an unused variable warning
set(ignoreMe "${SKBUILD}")
# TODO this is ugly but it works for now.
#
# Hard-code the appropriate library RPATHs, handling all possible "install" use cases.
# - Installing libs for use in "standard" C/C++ <prefix>/lib install
# - Installing libs for use in Python extensions
#
# Exact rpath syntax depends on target arch.
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
if (APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/;@loader_path/../../../")
elseif (LINUX)
set(CMAKE_INSTALL_RPATH "\$ORIGIN:\$ORIGIN/../lib:\$ORIGIN/../../../")
endif()
set(UPSP_INSTALL_BIN_DIR ${SKBUILD_SCRIPTS_DIR})
set(UPSP_INSTALL_EXT_LIB_DIR ${SKBUILD_PROJECT_NAME})
set(UPSP_INSTALL_APP_LIB_DIR ${SKBUILD_DATA_DIR}/lib)
else()
set(UPSP_INSTALL_BIN_DIR "bin")
set(UPSP_INSTALL_EXT_LIB_DIR "lib")
set(UPSP_INSTALL_APP_LIB_DIR "lib")
endif()
add_subdirectory(cpp)
install(
PROGRAMS
scripts/upsp-external-calibration
scripts/upsp-make-processing-tree
scripts/upsp-kulite-comparison
scripts/upsp-plotting
scripts/upsp-qsub-args
DESTINATION ${UPSP_INSTALL_BIN_DIR}
)