-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathCMakeLists.txt
102 lines (82 loc) · 3.01 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
95
96
97
98
99
100
101
102
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(MoleQueue)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Request C++11 standard, using new CMake variables.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_EXTENSIONS False)
# Set symbol visibility defaults for all targets.
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
set(CMAKE_VISIBILITY_INLINES_HIDDEN True)
include(BuildType)
include(BuildLocation)
include(CompilerFlags)
include(InstallLocation)
include(SilenceWarnings)
include(DetermineVersion)
# Set up our version.
set(MoleQueue_VERSION_MAJOR "0")
set(MoleQueue_VERSION_MINOR "9")
set(MoleQueue_VERSION_PATCH "0")
set(MoleQueue_VERSION
"${MoleQueue_VERSION_MAJOR}.${MoleQueue_VERSION_MINOR}.${MoleQueue_VERSION_PATCH}")
find_package(Git)
determine_version(${MoleQueue_SOURCE_DIR} ${GIT_EXECUTABLE} "MoleQueue")
if(APPLE)
set(MACOSX_BUNDLE_NAME "MoleQueue")
# Handle installation prefix for Mac bundles...
option(USE_BUNDLE_LAYOUT "Use the Mac OS X bundle layout" OFF)
endif()
if(APPLE AND USE_BUNDLE_LAYOUT)
set(prefix "${MACOSX_BUNDLE_NAME}.app/Contents")
set(INSTALL_INCLUDE_DIR "${prefix}/${INSTALL_INCLUDE_DIR}")
set(INSTALL_RUNTIME_DIR "${prefix}/MacOS")
set(INSTALL_LIBRARY_DIR "${prefix}/${INSTALL_LIBRARY_DIR}")
set(INSTALL_ARCHIVE_DIR "${prefix}/${INSTALL_ARCHIVE_DIR}")
set(INSTALL_DATA_DIR "${prefix}/${INSTALL_DATA_DIR}")
set(INSTALL_DOC_DIR "${prefix}/${INSTALL_DOC_DIR}")
set(INSTALL_CMAKE_DIR "${prefix}/Resources")
else()
set(INSTALL_CMAKE_DIR "${INSTALL_LIBRARY_DIR}/cmake/molequeue")
endif()
option(ENABLE_TESTING "Enable testing" OFF)
option(BUILD_SHARED_LIBS "Build with shared libraries" ON)
option(MoleQueue_USE_EZHPC_UIT "Build support for ezHPC UIT interface" OFF)
if(ENABLE_TESTING)
include(CTest)
enable_testing()
endif()
# This is necessary for tests, includes etc.
include_directories(BEFORE "${MoleQueue_SOURCE_DIR}")
set(EXPORT_TARGETS_NAME "MoleQueueTargets")
add_subdirectory(molequeue)
option(BUILD_DOCUMENTATION "Build project documentation" OFF)
if(BUILD_DOCUMENTATION)
add_subdirectory(docs)
endif()
if(USE_ZERO_MQ)
add_subdirectory(python)
endif()
if(ENABLE_TESTING)
include(BuildPackageTest)
BuildPackageTest_Add("MoleQueue" "${CMAKE_CURRENT_BINARY_DIR}")
endif()
configure_file(${MoleQueue_SOURCE_DIR}/cmake/CTestCustom.cmake.in
${MoleQueue_BINARY_DIR}/CTestCustom.cmake)
configure_file("${MoleQueue_SOURCE_DIR}/cmake/MoleQueueConfig.cmake.in"
"${MoleQueue_BINARY_DIR}/MoleQueueConfig.cmake" @ONLY)
configure_file("${MoleQueue_SOURCE_DIR}/cmake/MoleQueueConfigVersion.cmake.in"
"${MoleQueue_BINARY_DIR}/MoleQueueConfigVersion.cmake" @ONLY)
install(FILES
"${MoleQueue_BINARY_DIR}/MoleQueueConfig.cmake"
"${MoleQueue_BINARY_DIR}/MoleQueueConfigVersion.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}")
install(EXPORT "MoleQueueTargets"
DESTINATION "${INSTALL_CMAKE_DIR}")
install(
FILES
README.md
CONTRIBUTING.md
LICENSE
DESTINATION "${INSTALL_DOC_DIR}/molequeue")
include(MoleQueueCPack)