Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/cmake/Modules/G4CPack.cmake is written in an unsupported language. File is not indexed.

0001 # - Basic setup for packaging Geant4 using CPack
0002 # Still rather rough and only generally intended to create source packages
0003 # at the moment.
0004 #
0005 
0006 #-----------------------------------------------------------------------
0007 # Package up needed system libraries - only for WIN32?
0008 #
0009 # for Intel icc suppress warnings about icc libraries not existing for 19. 
0010 if(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
0011    set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS True)
0012 endif()
0013 
0014 include(G4GitUtilities)
0015 include(InstallRequiredSystemLibraries)
0016 
0017 #-----------------------------------------------------------------------
0018 # Copy/Generate common resource files into formats CPack generators like
0019 file(WRITE ${PROJECT_BINARY_DIR}/README.txt "
0020 Geant4
0021 ======
0022 A toolkit for the simulation of the passage of particles through matter.
0023 Its areas of application include high energy, nuclear and accelerator physics, as well
0024 as studies in medical and space science.
0025 
0026 For more information about how to use Geant4 and its application domains, please visit
0027 the Geant4 website (https://cern.ch/geant4)
0028 
0029 There are three main reference papers for Geant4:
0030 
0031 - Nuclear Instruments and Methods in Physics Research A 835 (2016) 186-225 
0032   - http://www.sciencedirect.com/science/article/pii/S0168900216306957
0033 - IEEE Transactions on Nuclear Science 53 No. 1 (2006) 270-278
0034   - https://ieeexplore.ieee.org/xpls/abs_all.jsp?isnumber=33833&arnumber=1610988&count=33&index=7
0035 - Nuclear Instruments and Methods in Physics Research A 506 (2003) 250-303
0036   - http://www.sciencedirect.com/science/article/pii/S0168900203013688
0037 
0038 This installer has been created using CPack (http://www.cmake.org).
0039 ")
0040 
0041 configure_file(LICENSE LICENSE.txt COPYONLY) # Suffix must be .txt
0042 
0043 #-----------------------------------------------------------------------
0044 # General packaging setup - variables relevant to all package formats
0045 #
0046 set(CPACK_PACKAGE_NAME "geant4")
0047 set(CPACK_PACKAGE_VENDOR "Geant4 Collaboration")
0048 set(CPACK_PACKAGE_CONTACT "Geant4 Collaboration <https://geant4.cern.ch/collaboration/contacts>")
0049 set(CPACK_PACKAGE_VERSION ${Geant4_VERSION})
0050 set(CPACK_PACKAGE_VERSION_MAJOR ${Geant4_VERSION_MAJOR})
0051 set(CPACK_PACKAGE_VERSION_MINOR ${Geant4_VERSION_MINOR})
0052 set(CPACK_PACKAGE_VERSION_PATCH ${Geant4_VERSION_PATCH})
0053 set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_BINARY_DIR}/README.txt")
0054 set(CPACK_PACKAGE_INSTALL_DIRECTORY "Geant4-${Geant4_VERSION_MAJOR}.${Geant4_VERSION_MINOR}")
0055 set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/Templates/g4_small.bmp")
0056 set(CPACK_PACKAGE_CHECKSUM "SHA256")
0057 
0058 set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
0059 set(CPACK_DEBIAN_PACKAGE_SECTION "science")
0060 set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
0061 set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS TRUE)
0062 set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY "=")
0063 set(CPACK_DEBIAN_PACKAGE_DEPENDS "cmake, make, g++")
0064 set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "libexpat1-dev, libxerces-c-dev, zlib1g-dev")
0065 set(CPACK_DEBIAN_PACKAGE_SUGGESTS "")
0066 
0067 # - Common Resource files
0068 set(CPACK_RESOURCE_FILE_README  "${PROJECT_BINARY_DIR}/README.txt")
0069 set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_BINARY_DIR}/LICENSE.txt")
0070 
0071 #-----------------------------------------------------------------------
0072 # Source package settings
0073 #
0074 # - Use same source package naming as GitLab generates for tags
0075 set(CPACK_SOURCE_PACKAGE_FILE_NAME "geant4-v${CPACK_PACKAGE_VERSION}")
0076 set(CPACK_SOURCE_GENERATOR "TGZ;TXZ;ZIP")
0077 set(CPACK_SOURCE_STRIP_FILES "")
0078 
0079 # Exclude VCS, temp files, and development-only components from the source package.
0080 set(CPACK_SOURCE_IGNORE_FILES
0081   "${PROJECT_BINARY_DIR}/"
0082   ".clang-format"
0083   ".clang-tidy"
0084   "README.*"
0085   "CONTRIBUTING.*"
0086   "CODING_GUIDELINES.*"
0087   "RELEASE_MANAGEMENT.rst"
0088   "SHIFTERS.rst" 
0089   "/GitUtilities/"
0090   "/tests/"
0091   "/ReleaseNotes/development"
0092   "/benchmarks/"
0093   "/verification/"
0094   "/test.*/"
0095   "/doc.*/"
0096   "/benchmark.*/"
0097   "~$"
0098   "/CVS/"
0099   "/.svn/"
0100   "/\\\\\\\\.svn/"
0101   "/.git/"
0102   ".gitignore"
0103   "/.github/"
0104   "/.gitlab"
0105   "/\\\\\\\\.git/"
0106   "\\\\\\\\.swp$"
0107   "\\\\\\\\.swp$"
0108   "\\\\.swp"
0109   "\\\\\\\\.#"
0110   "/#")
0111 
0112 # Add any _configure time_ untracked files. Actual package build will warn/error out
0113 # on any unknown ones. Due to an unknown quirk in CPack, changes to CPACK_SOURCE_IGNORE_FILES
0114 # after inclusion of CPack (e.g. in `CPACK_PROJECT_CONFIG_FILE`) are not taken into account
0115 # when CPack runs.
0116 geant4_git_find_dirty(${PROJECT_SOURCE_DIR} __modded __untracked)
0117 list(APPEND CPACK_SOURCE_IGNORE_FILES ${__untracked})
0118 
0119 # Create and inject sources that require generation or otherwise including
0120 configure_file(${PROJECT_SOURCE_DIR}/README.rst _source_extras/README.rst COPYONLY)
0121 
0122 if(EXISTS "${PROJECT_SOURCE_DIR}/CONTRIBUTING_GitHub.rst")
0123   configure_file(${PROJECT_SOURCE_DIR}/CONTRIBUTING_GitHub.rst _source_extras/CONTRIBUTING.rst COPYONLY)
0124 else()
0125   configure_file(${PROJECT_SOURCE_DIR}/CONTRIBUTING.rst _source_extras/CONTRIBUTING.rst COPYONLY)
0126 endif()
0127 
0128 
0129 
0130 configure_file(
0131   cmake/Templates/source_package_extras.cmake.in
0132   source_package_extras.cmake
0133   @ONLY)
0134 list(APPEND CPACK_INSTALL_SCRIPTS "${CMAKE_CURRENT_BINARY_DIR}/source_package_extras.cmake")
0135 
0136 #-----------------------------------------------------------------------
0137 # Binary package common settings
0138 #
0139 set(CPACK_PACKAGE_RELOCATABLE ${CMAKE_INSTALL_IS_NONRELOCATABLE})
0140 
0141 if(WIN32)
0142   set(CPACK_GENERATOR "NSIS;ZIP")
0143 elseif(APPLE)
0144   set(CPACK_GENERATOR "productbuild;TGZ")
0145 else()
0146   set(CPACK_GENERATOR "STGZ;TGZ")
0147 endif()
0148 
0149 #-----------------------------------------------------------------------
0150 # Finally, generate the CPack per-generator options file and include the
0151 # base CPack configuration.
0152 #
0153 configure_file(
0154   cmake/Templates/CMakeCPackOptions.cmake.in
0155   CMakeCPackOptions.cmake
0156   @ONLY
0157   )
0158 set(CPACK_PROJECT_CONFIG_FILE ${PROJECT_BINARY_DIR}/CMakeCPackOptions.cmake)
0159 include(CPack)
0160 
0161 #-----------------------------------------------------------------------
0162 # Define components and installation types (after CPack included!)
0163 #
0164 cpack_add_install_type(full      DISPLAY_NAME "Full Installation")
0165 cpack_add_install_type(runtime   DISPLAY_NAME "Runtime Installation")
0166 cpack_add_install_type(developer DISPLAY_NAME "Developer Installation")
0167 
0168 # - Components for Development
0169 cpack_add_component(Development
0170   DISPLAY_NAME "Development Components"
0171   DESCRIPTION "Install all files needed for developing Geant4 applications (headers, makefiles, etc.)"
0172   INSTALL_TYPES developer full
0173   )
0174 
0175 # - Components for Runtime
0176 cpack_add_component(Runtime
0177   DISPLAY_NAME "Geant4 runtime Libraries"
0178   DESCRIPTION "Install all Geant4 libraries"
0179   INSTALL_TYPES runtime developer full
0180   )
0181 
0182 # - Components for Examples
0183 cpack_add_component(Examples
0184   DISPLAY_NAME "Application Examples"
0185   DESCRIPTION "Install all Geant4 examples"
0186   INSTALL_TYPES full developer
0187   )
0188 
0189 # - Components for Data
0190 cpack_add_component(Data
0191   DISPLAY_NAME "Geant4 Data Files"
0192   DESCRIPTION "Install all Geant4 data files"
0193   INSTALL_TYPES full
0194   )
0195