|
1 | 1 | # |
2 | | - # Copyright 2013 Felix Schmitt, Axel Huebl |
| 2 | + # Copyright 2013-2014 Felix Schmitt, Axel Huebl |
3 | 3 | # |
4 | 4 | # This file is part of libSplash. |
5 | 5 | # |
6 | 6 | # libSplash is free software: you can redistribute it and/or modify |
7 | 7 | # it under the terms of of either the GNU General Public License or |
8 | 8 | # the GNU Lesser General Public License as published by |
9 | 9 | # the Free Software Foundation, either version 3 of the License, or |
10 | | - # (at your option) any later version. |
| 10 | + # (at your option) any later version. |
| 11 | + # |
11 | 12 | # libSplash is distributed in the hope that it will be useful, |
12 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
@@ -198,6 +199,10 @@ ELSE(HDF5_IS_PARALLEL) |
198 | 199 | ) |
199 | 200 | ENDIF(HDF5_IS_PARALLEL) |
200 | 201 |
|
| 202 | +# install python scripts |
| 203 | +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tools/splash2xdmf.py |
| 204 | + DESTINATION share/pyshared) |
| 205 | + |
201 | 206 | #------------------------------------------------------------------------------- |
202 | 207 |
|
203 | 208 | # build tools |
@@ -239,8 +244,131 @@ IF(WITH_TOOLS) |
239 | 244 |
|
240 | 245 | #install tools |
241 | 246 | INSTALL(TARGETS splashtools RUNTIME DESTINATION bin) |
| 247 | + INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tools/splash2xdmf.py DESTINATION bin) |
242 | 248 | ENDIF(WITH_TOOLS) |
243 | 249 |
|
| 250 | +#------------------------------------------------------------------------------- |
| 251 | + |
| 252 | +# Packaging |
| 253 | +# Reference for variables: http://www.cmake.org/Wiki/CMake:CPackConfiguration |
| 254 | + |
| 255 | +SET(CPACK_GENERATOR "DEB;TGZ;TBZ2;ZIP") |
| 256 | + |
| 257 | +SET(CPACK_PACKAGE_NAME "libsplash") # lower case required (debian policy) |
| 258 | +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY |
| 259 | + "Simple Parallel file output Library for Accumulating Simulation data using Hdf5") |
| 260 | +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") |
| 261 | +SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") |
| 262 | +SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") |
| 263 | +# a valid email is required - happy spamming :) |
| 264 | +SET(CPACK_PACKAGE_CONTACT "Felix Schmitt <felix.schmitt@zih.tu-dresden.de>") |
| 265 | +SET(CPACK_PACKAGE_VENDOR "ZIH and HZDR") |
| 266 | +# CPACK_PACKAGING_INSTALL_PREFIX : default is "/usr" for deb and rpm |
| 267 | + |
| 268 | +SET(CPACK_PACKAGE_VERSION_MAJOR "${SPLASH_VERSION_MAJOR}") |
| 269 | +SET(CPACK_PACKAGE_VERSION_MINOR "${SPLASH_VERSION_MINOR}") |
| 270 | +SET(CPACK_PACKAGE_VERSION_PATCH "${SPLASH_VERSION_PATCH}") |
| 271 | +SET(CPACK_PACKAGE_VERSION |
| 272 | + "${SPLASH_VERSION_MAJOR}.${SPLASH_VERSION_MINOR}.${SPLASH_VERSION_PATCH}") |
| 273 | + |
| 274 | +# from `dpkg --print-architecture` |
| 275 | +IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR |
| 276 | + CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64") |
| 277 | + SET(SPLASH_ARCHITECTURE "amd64") |
| 278 | +ELSE() |
| 279 | + SET(SPLASH_ARCHITECTURE "i386") |
| 280 | +ENDIF() |
| 281 | + |
| 282 | +# probably only required by NSIS |
| 283 | +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") |
| 284 | + |
| 285 | +# ship (strip) all found executables |
| 286 | +SET(CPACK_STRIP_FILES ON) |
| 287 | +# do not ship source files (packed in a weird absolute dir) |
| 288 | +SET(CPACK_SOURCE_STRIP_FILES OFF) |
| 289 | +#SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable") # only required by NSIS |
| 290 | + |
| 291 | +# try to detect used MPI flavor |
| 292 | +SET(MPI_FLAVOR "FLAVOR-NOTFOUND") |
| 293 | +IF(HDF5_IS_PARALLEL OR TOOLS_MPI) |
| 294 | + SET(MPI_FLAVOR "openmpi") |
| 295 | + SET(MPI_FLAVOR_BIN "openmpi-bin") |
| 296 | + SET(MPI_FLAVOR_MINVERSION 1.5.1) |
| 297 | + STRING(FIND "${MPI_C_LIBRARIES}" "libmpich" MPI_FLAVOR_POS) |
| 298 | + IF(${MPI_FLAVOR_POS} GREATER -1) |
| 299 | + SET(MPI_FLAVOR "mpich2") |
| 300 | + SET(MPI_FLAVOR_BIN "mpich2") |
| 301 | + SET(MPI_FLAVOR_MINVERSION 1.4.1) |
| 302 | + ENDIF(${MPI_FLAVOR_POS} GREATER -1) |
| 303 | +ENDIF(HDF5_IS_PARALLEL OR TOOLS_MPI) |
| 304 | + |
| 305 | +# package name containing all necessary information for feature identification |
| 306 | +# inspect .deb meta data (like version) with dpkg --info <package>.deb |
| 307 | +IF(NOT HDF5_IS_PARALLEL) |
| 308 | + SET(SPLASH_PACKAGE_EXTRA_PREFIX "-serial") |
| 309 | +ENDIF(NOT HDF5_IS_PARALLEL) |
| 310 | +IF(MPI_FLAVOR) |
| 311 | + SET(SPLASH_PACKAGE_EXTRA_PREFIX |
| 312 | + "${SPLASH_PACKAGE_EXTRA_PREFIX}-${MPI_FLAVOR}") |
| 313 | +ENDIF(MPI_FLAVOR) |
| 314 | +IF(NOT SPLASH_RELEASE) |
| 315 | + SET(SPLASH_PACKAGE_DEBUG "-dbg") |
| 316 | +ENDIF(NOT SPLASH_RELEASE) |
| 317 | + |
| 318 | +SET(CPACK_PACKAGE_FILE_NAME |
| 319 | + "${CPACK_PACKAGE_NAME}${SPLASH_PACKAGE_EXTRA_PREFIX}-${SPLASH_ARCHITECTURE}${SPLASH_PACKAGE_DEBUG}" |
| 320 | + ) |
| 321 | + |
| 322 | +# DEB specific ---------------------------------------------------------------- |
| 323 | +# package relation policy at |
| 324 | +# http://www.debian.org/doc/debian-policy/ch-relationships.html |
| 325 | + |
| 326 | +# default values that are already set in a fine and noble manner |
| 327 | +# CPACK_DEBIAN_PACKAGE_MAINTAINER <- CPACK_PACKAGE_CONTACT |
| 328 | +# CPACK_DEBIAN_PACKAGE_NAME <- CPACK_PACKAGE_NAME |
| 329 | +# CPACK_DEBIAN_PACKAGE_VERSION <- CPACK_PACKAGE_VERSION |
| 330 | +# CPACK_DEBIAN_PACKAGE_DESCRIPTION <- CPACK_PACKAGE_DESCRIPTION_SUMMARY |
| 331 | +# CPACK_DEBIAN_PACKAGE_SECTION : default is "devel" |
| 332 | +# CPACK_DEBIAN_PACKAGE_PRIORITY : default is "optional" |
| 333 | +# CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA : pos/pre inst/rm scripts |
| 334 | + |
| 335 | +# from `dpkg --print-architecture` |
| 336 | +SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${SPLASH_ARCHITECTURE}") # default is i386 |
| 337 | + |
| 338 | +# the dev packages are a little bit too much, but since there is a lack of |
| 339 | +# convenient named meta packages we use them to trigger the dependencies |
| 340 | +IF(HDF5_IS_PARALLEL) |
| 341 | + SET(CPACK_DEBIAN_PACKAGE_DEPENDS |
| 342 | + "libhdf5-${MPI_FLAVOR}-dev (>= 1.8.6)" |
| 343 | + ) |
| 344 | + SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS |
| 345 | + "${MPI_FLAVOR_BIN} (>= ${MPI_FLAVOR_MINVERSION})" |
| 346 | + ) |
| 347 | +ELSE(HDF5_IS_PARALLEL) |
| 348 | + SET(CPACK_DEBIAN_PACKAGE_DEPENDS |
| 349 | + "libhdf5-serial-dev (>= 1.8.6)" |
| 350 | + ) |
| 351 | + IF(TOOLS_MPI) |
| 352 | + SET(CPACK_DEBIAN_PACKAGE_DEPENDS |
| 353 | + "${CPACK_DEBIAN_PACKAGE_DEPENDS}, lib${MPI_FLAVOR}-dev (>= ${MPI_FLAVOR_MINVERSION})" |
| 354 | + ) |
| 355 | + SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS |
| 356 | + "${MPI_FLAVOR_BIN} (>= ${MPI_FLAVOR_MINVERSION})" |
| 357 | + ) |
| 358 | + ENDIF(TOOLS_MPI) |
| 359 | +ENDIF(HDF5_IS_PARALLEL) |
| 360 | + |
| 361 | +# CPACK_DEBIAN_PACKAGE_SUGGESTS |
| 362 | +# deb-src support |
| 363 | +# DEBIAN_PACKAGE_BUILDS_DEPENDS : not implemented by cmake yet |
| 364 | + |
| 365 | +# END: DEB specific ----------------------------------------------------------- |
244 | 366 |
|
| 367 | +# create or creates specific library names |
| 368 | +# libsplash.so -> libsplash.so.1 |
| 369 | +# libsplash.so.1 -> libsplash.so.1.1 |
| 370 | +# libsplash.so.1.1 -> libsplash.so.1.1.0 |
245 | 371 |
|
| 372 | +# has to be included after all vars are set |
| 373 | +INCLUDE(CPack) |
246 | 374 |
|
0 commit comments