-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
146 lines (121 loc) · 5.54 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
CMAKE_MINIMUM_REQUIRED(VERSION 3.14.5)
PROJECT(SCR VERSION 3.0.1)
# Find Packages & Files
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# process SCR CMake options
INCLUDE(SCR_OPTIONS)
## HEADERS
INCLUDE(CheckIncludeFile)
## AXL
FIND_PACKAGE(axl REQUIRED)
LIST(APPEND SCR_EXTERNAL_LIBS axl::axl_mpi)
LIST(APPEND SCR_EXTERNAL_STATIC_LIBS axl::axl_mpi-static)
LIST(APPEND SCR_EXTERNAL_SERIAL_LIBS axl::axl)
LIST(APPEND SCR_EXTERNAL_SERIAL_STATIC_LIBS axl::axl-static)
## ER
FIND_PACKAGE(er REQUIRED)
LIST(APPEND SCR_EXTERNAL_LIBS er::er)
LIST(APPEND SCR_EXTERNAL_STATIC_LIBS er::er-static)
## SHUFFILE
FIND_PACKAGE(shuffile REQUIRED)
LIST(APPEND SCR_EXTERNAL_LIBS shuffile::shuffile)
LIST(APPEND SCR_EXTERNAL_STATIC_LIBS shuffile::shuffile-static)
## REDSET
FIND_PACKAGE(redset REQUIRED)
LIST(APPEND SCR_EXTERNAL_LIBS redset::redset)
LIST(APPEND SCR_EXTERNAL_STATIC_LIBS redset::redset-static)
LIST(APPEND SCR_EXTERNAL_SERIAL_LIBS redset::redset_base)
LIST(APPEND SCR_EXTERNAL_SERIAL_STATIC_LIBS redset::redset_base-static)
## SPATH
FIND_PACKAGE(spath REQUIRED)
LIST(APPEND SCR_EXTERNAL_LIBS spath::spath)
LIST(APPEND SCR_EXTERNAL_STATIC_LIBS spath::spath-static)
LIST(APPEND SCR_EXTERNAL_SERIAL_LIBS spath::spath_base)
LIST(APPEND SCR_EXTERNAL_SERIAL_STATIC_LIBS spath::spath_base-static)
## RankStr
FIND_PACKAGE(rankstr REQUIRED)
LIST(APPEND SCR_EXTERNAL_LIBS rankstr::rankstr)
LIST(APPEND SCR_EXTERNAL_STATIC_LIBS rankstr::rankstr-static)
## KVTREE
FIND_PACKAGE(kvtree REQUIRED)
LIST(APPEND SCR_EXTERNAL_LIBS kvtree::kvtree)
LIST(APPEND SCR_EXTERNAL_STATIC_LIBS kvtree::kvtree-static)
LIST(APPEND SCR_EXTERNAL_SERIAL_LIBS kvtree::kvtree_base)
LIST(APPEND SCR_EXTERNAL_SERIAL_STATIC_LIBS kvtree::kvtree_base-static)
## libdtcmp
FIND_PACKAGE(DTCMP REQUIRED)
IF(DTCMP_FOUND)
SET(HAVE_LIBDTCMP TRUE)
INCLUDE_DIRECTORIES(${DTCMP_INCLUDE_DIRS})
LIST(APPEND SCR_EXTERNAL_LIBS ${DTCMP_LIBRARIES})
LIST(APPEND SCR_EXTERNAL_STATIC_LIBS ${DTCMP_LIBRARIES})
LIST(APPEND SCR_LINK_LINE " -L${WITH_DTCMP_PREFIX}/lib -ldtcmp")
ENDIF(DTCMP_FOUND)
INCLUDE(SCR_DEPENDENCIES)
INCLUDE(GNUInstallDirs)
## Use X_ variable names for CLI scripts
## could use CMAKE_INSTALL_FULL_ names instead
SET(X_BINDIR ${CMAKE_INSTALL_FULL_BINDIR} CACHE INTERNAL "bin")
SET(X_LIBEXECDIR ${CMAKE_INSTALL_FULL_LIBEXECDIR} CACHE INTERNAL "libexec")
SET(X_DATADIR ${CMAKE_INSTALL_FULL_DATADIR} CACHE INTERNAL "share")
SET(X_INCLUDEDIR ${CMAKE_INSTALL_FULL_INCLUDEDIR} CACHE INTERNAL "include")
SET(X_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR} CACHE INTERNAL "lib")
# Generate config.h with all our build #defs
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/config.h.in ${PROJECT_BINARY_DIR}/config.h)
SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/config.h PROPERTIES GENERATED TRUE)
# Subdirectories
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src)
INCLUDE(SCR_ADD_TEST)
IF(ENABLE_TESTS)
INCLUDE(CTest)
ENDIF(ENABLE_TESTS)
ADD_SUBDIRECTORY(man)
ADD_SUBDIRECTORY(scripts)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(python)
IF(ENABLE_EXAMPLES)
ADD_SUBDIRECTORY(examples)
ENDIF()
# Special Install Files
INSTALL(FILES README.md DESTINATION ${CMAKE_INSTALL_DATADIR}/scr)
# CMake configs
# Install the exports file
INSTALL(EXPORT scrTargets FILE scrTargets.cmake NAMESPACE scr:: DESTINATION share/scr/cmake)
# Export so we can use in-tree
EXPORT(EXPORT scrTargets NAMESPACE scr:: FILE scrTargets.cmake)
# Setup the package config
INCLUDE(CMakePackageConfigHelpers)
CONFIGURE_PACKAGE_CONFIG_FILE(cmake/scrConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/scrConfig.cmake INSTALL_DESTINATION share/scr/cmake)
WRITE_BASIC_PACKAGE_VERSION_FILE(${CMAKE_CURRENT_BINARY_DIR}/scrConfigVersion.cmake COMPATIBILITY SameMajorVersion)
# Install package config
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/scrConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/scrConfigVersion.cmake DESTINATION share/scr/cmake)
INSTALL(FILES cmake/FindDTCMP.cmake DESTINATION share/scr/cmake)
INSTALL(FILES cmake/FindLWGRP.cmake DESTINATION share/scr/cmake)
INSTALL(FILES cmake/FindMySQL.cmake DESTINATION share/scr/cmake)
INSTALL(FILES cmake/FindPDSH.cmake DESTINATION share/scr/cmake)
INSTALL(FILES cmake/FindYOGRT.cmake DESTINATION share/scr/cmake)
# Package
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scalable Checkpoint / Restart Library")
SET(CPACK_PACKAGE_VENDOR "Lawrence Livermore National Laboratory")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.TXT")
# SET(CPACK_PACKAGE_VERSION_MAJOR ${SCR_MAJOR_VERSION})
# SET(CPACK_PACKAGE_VERSION_MINOR ${SCR_MINOR_VERSION})
# SET(CPACK_PACKAGE_VERSION_PATCH ${SCR_PATCH_VERSION})
# SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
# IF(WIN32 AND NOT UNIX)
# # There is a bug in NSI that does not handle full unix paths properly. Make
# # sure there is at least one set of four (4) backlasshes.
# SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
# SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
# SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} My Famous Project")
# SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.my-project-home-page.org")
# SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.my-personal-home-page.com")
# SET(CPACK_NSIS_CONTACT "[email protected]")
# SET(CPACK_NSIS_MODIFY_PATH ON)
# ELSE(WIN32 AND NOT UNIX)
# SET(CPACK_STRIP_FILES "bin/MyExecutable")
# SET(CPACK_SOURCE_STRIP_FILES "")
# ENDIF(WIN32 AND NOT UNIX)
# SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable")
# INCLUDE(CPACK)