-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
94 lines (76 loc) · 2.04 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
83
84
85
86
87
88
89
90
91
92
93
94
#
# CMake packaging for Omicron
# Copyright 2019 Duncan Macleod <[email protected]>
# Copyright 2019 Florent Robinet <[email protected]>
#
# -- package info -----------
# cmake required
cmake_minimum_required(VERSION 3.9.0 FATAL_ERROR)
# project definition
project(
Omicron
LANGUAGES C CXX
VERSION 2.4.2
DESCRIPTION "An algorithm to detect and characterize transient events in gravitational-wave detectors"
)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
# -- extra requirements -----
include(GNUInstallDirs)
find_package(PkgConfig REQUIRED)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# -- set install paths ------
set(RUNTIME_DESTINATION ${CMAKE_INSTALL_BINDIR})
set(LIBRARY_DESTINATION ${CMAKE_INSTALL_LIBDIR})
# -- build components -------
add_subdirectory(src)
add_subdirectory(doc)
# -- user environment -------
configure_file(./omicron.env.sh.in ./omicron.env.sh @ONLY)
# install environment scripts
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/omicron.env.sh
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}
)
install(
DIRECTORY
html
DESTINATION ${CMAKE_INSTALL_DATADIR}/omicron
)
# -- build tarball ----------
#
# to build a source tarball:
#
# mkdir dist
# pushd dist
# cmake ..
# cmake --build . --target package_source
#
# this should produce dist/omicron-X.Y.Z.tar.xz
#
set(CPACK_PACKAGE_MAJOR ${${PROJECT_NAME}_MAJOR_VERSION})
set(CPACK_PACKAGE_MINOR ${${PROJECT_NAME}_MINOR_VERSION})
set(CPACK_PACKAGE_PATCH ${${PROJECT_NAME}_PATCH_VERSION})
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_MAJOR}.${CPACK_PACKAGE_MINOR}.${CPACK_PACKAGE_PATCH}")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_SOURCE_GENERATOR TXZ)
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${PROJECT_NAME_LOWER}-${${PROJECT_NAME}_VERSION})
set(CPACK_SOURCE_IGNORE_FILES
"/.*~$/"
".*~$"
"\\\\.deps/"
"\\\\.git/"
"\\\\.svn/"
"CMakeFiles/"
"_CPack_Packages/"
"build/"
"doc/"
"paper/"
"\\\\.cmake"
"\\\\.tar\\\\.xz"
"CMakeCache.txt"
"Makefile"
)
include(CPack)