Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

CMakeLists.txt 8.1 KB

You have to be logged in to leave a comment. Sign In
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
  1. #
  2. #
  3. # Copyright (c) 1991-2021 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
  4. # See LICENSE.TXT file for copying and redistribution conditions.
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; version 3 or any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU Lesser General Public License for more details.
  14. #
  15. # Contact info: www.generic-mapping-tools.org
  16. #-------------------------------------------------------------------------------
  17. #
  18. # Common CPack settings:
  19. set (CPACK_PACKAGE_NAME "GMT")
  20. set (CPACK_PACKAGE_VENDOR "The GMT Team")
  21. set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Generic Mapping Tools data processing and display software package")
  22. set (CPACK_PACKAGE_VERSION_MAJOR ${GMT_PACKAGE_VERSION_MAJOR})
  23. set (CPACK_PACKAGE_VERSION_MINOR ${GMT_PACKAGE_VERSION_MINOR})
  24. set (CPACK_PACKAGE_VERSION_PATCH ${GMT_PACKAGE_VERSION_PATCH})
  25. set (CPACK_PACKAGE_VERSION ${GMT_PACKAGE_VERSION_WITH_GIT_REVISION})
  26. if (NOT DEFINED CPACK_PACKAGE_INSTALL_DIRECTORY)
  27. if (WIN32)
  28. set (CPACK_PACKAGE_INSTALL_DIRECTORY gmt${GMT_PACKAGE_VERSION_MAJOR})
  29. else (WIN32)
  30. set (CPACK_PACKAGE_INSTALL_DIRECTORY GMT-${GMT_PACKAGE_VERSION_WITH_GIT_REVISION})
  31. endif (WIN32)
  32. endif (NOT DEFINED CPACK_PACKAGE_INSTALL_DIRECTORY)
  33. set (CPACK_PACKAGE_DESCRIPTION_FILE
  34. "${CMAKE_CURRENT_SOURCE_DIR}/cpack_package_description.txt")
  35. if (WIN32)
  36. if (CMAKE_SIZEOF_VOID_P EQUAL 8) # 64 bits
  37. set (CPACK_PACKAGE_FILE_NAME "gmt-${CPACK_PACKAGE_VERSION}-win64")
  38. elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits
  39. set (CPACK_PACKAGE_FILE_NAME "gmt-${CPACK_PACKAGE_VERSION}-win32")
  40. endif()
  41. endif (WIN32)
  42. if (APPLE)
  43. set (CPACK_PACKAGE_FILE_NAME "gmt-${CPACK_PACKAGE_VERSION}-darwin-${CMAKE_HOST_SYSTEM_PROCESSOR}")
  44. endif (APPLE)
  45. # Install components:
  46. set (CPACK_COMPONENTS_ALL Runtime Documentation DCW GSHHG GDALDATA GHOSTSCRIPT)
  47. # set (CPACK_COMPONENT_DOCUMENTATION_DISABLED ON)
  48. set (CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "Runtime files")
  49. set (CPACK_COMPONENT_RUNTIME_DESCRIPTION
  50. "GMT programs, libraries and shared files.")
  51. set (CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION
  52. "Documentation and example files.")
  53. set (CPACK_COMPONENT_DCW_DESCRIPTION
  54. "Digital Chart of the World files.")
  55. set (CPACK_COMPONENT_GSHHG_DESCRIPTION
  56. "Shoreline database files.")
  57. set (CPACK_COMPONENT_GDALDATA_DESCRIPTION
  58. "GDAL & PROJ4 auxiliary files.")
  59. set (CPACK_COMPONENT_GHOSTSCRIPT_DESCRIPTION
  60. "Ghostscript program.")
  61. # Create two installation types with pre-selected components:
  62. set (CPACK_ALL_INSTALL_TYPES Full Minimal)
  63. set (CPACK_INSTALL_TYPE_FULL_DISPLAY_NAME "Everything")
  64. set (CPACK_COMPONENT_RUNTIME_INSTALL_TYPES Minimal Full)
  65. set (CPACK_COMPONENT_DOCUMENTATION_INSTALL_TYPES Full)
  66. set (CPACK_COMPONENT_GSHHG_INSTALL_TYPES Full)
  67. set (CPACK_COMPONENT_DCW_INSTALL_TYPES Full)
  68. set (CPACK_COMPONENT_GDALDATA_INSTALL_TYPES Full)
  69. set (CPACK_COMPONENT_GHOSTSCRIPT_INSTALL_TYPES Full)
  70. # Creates a single package with all (requested) components
  71. set (CPACK_COMPONENTS_GROUPING "ALL_COMPONENTS_IN_ONE")
  72. # Enable component install for archive generators:
  73. set (CPACK_ARCHIVE_COMPONENT_INSTALL ON)
  74. # Debian:
  75. set (CPACK_DEBIAN_PACKAGE_MAINTAINER "GMT Team <gmt-help@lists.hawaii.edu>")
  76. set (CPACK_DEBIAN_PACKAGE_SECTION science)
  77. # set (CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
  78. # set (CPACK_PACKAGE_DESCRIPTION "GMT is an open source collection of ~80
  79. # command-line tools for manipulating geographic and Cartesian data sets
  80. # (including filtering, trend fitting, gridding, projecting, etc.) and
  81. # producing PostScript illustrations ranging from simple x-y plots via contour
  82. # maps to artificially illuminated surfaces and 3D perspective views; the GMT
  83. # supplements add another ~40 more specialized tools. GMT supports over 30 map
  84. # projections and transformations and comes with support data such as GSHHG
  85. # coastlines, rivers, and political boundaries.")
  86. #set (CPACK_MONOLITHIC_INSTALL TRUE)
  87. set (CPACK_RPM_COMPONENT_INSTALL ON)
  88. #set(CPACK_COMPONENT_RUNTIME_GROUP "Runtime")
  89. #set(CPACK_COMPONENT_LEFTOVER_GROUP "Documentation")
  90. #set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
  91. set (CPACK_COMPONENT_UNSPECIFIED_HIDDEN FALSE)
  92. set (CPACK_COMPONENT_UNSPECIFIED_REQUIRED FALSE)
  93. # Windows:
  94. if (WIN32 AND NOT CYGWIN)
  95. # By default, do not warn when built on machines using only VS Express:
  96. #set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
  97. # Set the runtime libraries to COMPONENT Runtime
  98. set (CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT "Runtime")
  99. # Install the MSVC OpenMP runtime libraries
  100. set (CMAKE_INSTALL_OPENMP_LIBRARIES TRUE)
  101. # Install MSVC runtime DLLs
  102. include (InstallRequiredSystemLibraries)
  103. set (CPACK_GENERATOR ZIP NSIS)
  104. set (CPACK_NSIS_DISPLAY_NAME
  105. "${CPACK_PACKAGE_NAME}${GMT_PACKAGE_VERSION_MAJOR}")
  106. if (NOT DEFINED CPACK_NSIS_INSTALL_ROOT)
  107. set (CPACK_NSIS_INSTALL_ROOT "c:\\\\programs")
  108. endif (NOT DEFINED CPACK_NSIS_INSTALL_ROOT)
  109. set (CPACK_NSIS_MODIFY_PATH ON)
  110. string(REPLACE "/" "\\\\" _native_share_path "${GMT_DATADIR}")
  111. set (CPACK_NSIS_ADD_ENVVAR1 "GMT6_SHAREDIR")
  112. set (CPACK_NSIS_ADD_ENVVAL1 "\\\$INSTDIR\\\\${_native_share_path}")
  113. # StartMenu items:
  114. set (CPACK_NSIS_MENU_LINKS
  115. "${GMT_BINDIR}/startup_win.bat" "GMT Command Prompt"
  116. "${GMT_DOCDIR}" "Documentation")
  117. # Install startup batch file:
  118. install (PROGRAMS startup_win.bat
  119. DESTINATION ${GMT_BINDIR}
  120. COMPONENT Runtime)
  121. # Fix bundle:
  122. install (CODE "
  123. if (CMAKE_INSTALL_PREFIX MATCHES \"_CPack_Packages\")
  124. include (BundleUtilities)
  125. fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${GMT_BINDIR}/gmt${CMAKE_EXECUTABLE_SUFFIX}\" \"\" \"\")
  126. endif ()
  127. " COMPONENT Runtime)
  128. endif(WIN32 AND NOT CYGWIN)
  129. # If defined, import a list of files to add to the installer
  130. if(EXTRA_INCLUDE_EXES)
  131. include (${EXTRA_INCLUDE_EXES})
  132. endif()
  133. # MacOSX:
  134. if (APPLE)
  135. # Generate startup script:
  136. configure_file (startup_macosx.sh.in startup_macosx.sh @ONLY)
  137. configure_file (Info.plist.in Info.plist @ONLY)
  138. # Configure CPack:
  139. set (CPACK_GENERATOR Bundle TGZ TBZ2)
  140. set (CPACK_BUNDLE_NAME
  141. "${CPACK_PACKAGE_NAME}-${GMT_PACKAGE_VERSION_WITH_GIT_REVISION}")
  142. set (CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/GMT.icns")
  143. set (CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
  144. set (CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_BINARY_DIR}/startup_macosx.sh")
  145. # Fix bundle:
  146. install (CODE "
  147. set (BU_CHMOD_BUNDLE_ITEMS TRUE CACHE INTERNAL
  148. \"make bundle items writable before invoking install_name_tool\")
  149. if (CMAKE_INSTALL_PREFIX MATCHES \"_CPack_Packages.+[.]app/Contents/Resources\")
  150. cmake_policy (SET CMP0009 NEW)
  151. cmake_policy (SET CMP0011 NEW)
  152. # Workaround incompatible 'file' utilities possibly used in
  153. # is_file_executable() from GetPrerequisites.cmake:
  154. set (file_cmd /usr/bin/file)
  155. # gp_item_default_embedded_path item default_embedded_path_var
  156. #
  157. # Return the path that others should refer to the item by when the item
  158. # is embedded inside a bundle.
  159. #
  160. # Override on a per-project basis by providing a project-specific
  161. # gp_item_default_embedded_path_override function.
  162. #
  163. function(gp_item_default_embedded_path_override item default_embedded_path_var)
  164. # By default, embed items as set by gp_item_default_embedded_path:
  165. set(path \"\${\${default_embedded_path_var}}\")
  166. # Embed *.dylib in the lib folder:
  167. if(item MATCHES \"[.]dylib\$\")
  168. set(path \"@executable_path/../lib\")
  169. endif()
  170. set(\${default_embedded_path_var} \"\${path}\" PARENT_SCOPE)
  171. endfunction(gp_item_default_embedded_path_override)
  172. include (BundleUtilities)
  173. fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${GMT_BINDIR}/gmt${CMAKE_EXECUTABLE_SUFFIX}\" \"\${CMAKE_INSTALL_PREFIX}/${GMT_LIBDIR}/gmt${CMAKE_EXECUTABLE_SUFFIX}/plugins/${GMT_SUPPL_LIB_NAME}.so\" \"\")
  174. endif ()
  175. " COMPONENT Runtime)
  176. endif (APPLE)
  177. # Linux, Cygwin & Co:
  178. if (UNIX AND NOT APPLE)
  179. set (CPACK_GENERATOR TGZ TBZ2)
  180. endif (UNIX AND NOT APPLE)
  181. # Generators used for the source package (make package_source)
  182. set (CPACK_SOURCE_GENERATOR TGZ TBZ2 ZIP)
  183. # This must always be last:
  184. include (CPack)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...