Warning, /geant4/cmake/Modules/G4CMakeMain.cmake is written in an unsupported language. File is not indexed.
0001 #.rst:
0002 # G4CMakeMain
0003 # -----------
0004 #
0005 # Main script for Geant4 CMake build scripting.
0006 #
0007 # Stored separately from top level script purely for clarity in tagging.
0008 #
0009
0010 #-----------------------------------------------------------------
0011 # License and Disclaimer
0012 #
0013 # The Geant4 software is copyright of the Copyright Holders of
0014 # the Geant4 Collaboration. It is provided under the terms and
0015 # conditions of the Geant4 Software License, included in the file
0016 # LICENSE and available at http://cern.ch/geant4/license . These
0017 # include a list of copyright holders.
0018 #
0019 # Neither the authors of this software system, nor their employing
0020 # institutes,nor the agencies providing financial support for this
0021 # work make any representation or warranty, express or implied,
0022 # regarding this software system or assume any liability for its
0023 # use. Please see the license in the file LICENSE and URL above
0024 # for the full disclaimer and the limitation of liability.
0025 #
0026 # This code implementation is the result of the scientific and
0027 # technical work of the GEANT4 collaboration.
0028 # By using, copying, modifying or distributing the software (or
0029 # any work based on the software) you agree to acknowledge its
0030 # use in resulting scientific publications, and indicate your
0031 # acceptance of all terms of the Geant4 Software license.
0032 #
0033 #-----------------------------------------------------------------
0034
0035 # Include once and fail if already included
0036 if(NOT __G4CMAKEMAIN_INCLUDED)
0037 set(__G4CMAKEMAIN_INCLUDED TRUE)
0038 else()
0039 message(FATAL_ERROR "G4CMakeMain can only be included once")
0040 endif()
0041
0042 # Shouldn't need to set CMAKE_MODULE_PATH here as done at top level.
0043 # Review whether this is a more appropriate location.
0044
0045 #-----------------------------------------------------------------------
0046 # - Add functionality provided by standard and custom modules
0047 # See the documentation in each of these modules for further details.
0048
0049 # - Core CMake settings and options
0050 include(G4CMakeSettings)
0051
0052 # - Core Compile/Link settings and options
0053 include(G4BuildSettings)
0054
0055 # - Core API
0056 include(G4DeveloperAPI)
0057
0058 # - Provide interface to control use of optional components
0059 include(G4OptionalComponents)
0060
0061 # - Provide interface to control use of UI/Vis components
0062 # Written in a separate module from other optional components because
0063 # there are many complex options to handle.
0064 include(G4InterfaceOptions)
0065
0066 # - Installation of optional read-only architecture independent data files.
0067 include(G4InstallData)
0068
0069 # - Include testing up front so both source and environments can use it if required
0070 include(G4CTest)
0071
0072 #-----------------------------------------------------------------------
0073 # Add the source and environments subdirectories
0074 # source : Process all the Geant4 core targets
0075 add_subdirectory(source)
0076
0077 if(GEANT4_USE_PYTHON)
0078 message(WARNING "Geant4Py is no longer distributed with the Geant4 toolkit."
0079 " It can be downloaded from:\n https://github.com/koichi-murakami/g4python \n"
0080 "and requests for support on installation and use should be directed there.\n")
0081 endif()
0082
0083 #-----------------------------------------------------------------------
0084 # - Perform all post build tasks
0085 # At the CMake level, this simply means that we must know about targets
0086 # and other properties processed in source and environments trees before
0087 # these tasks can be performed.
0088 #
0089 # - Generate any Use/Config/Support files here once everything else has
0090 # - Geant4Make.gmk
0091 include(G4ConfigureGNUMakeHelpers)
0092
0093 # - Pkg-Config and geant4-config
0094 include(G4ConfigurePkgConfigHelpers)
0095
0096 # - Geant4Config.cmake et al
0097 include(G4ConfigureCMakeHelpers)
0098
0099 #-----------------------------------------------------------------------
0100 # - Testing configuration.
0101 # Done here, as projects under 'tests' require Geant4Config.
0102 if(GEANT4_ENABLE_TESTING)
0103 if(EXISTS ${PROJECT_SOURCE_DIR}/tests)
0104 add_subdirectory(tests)
0105 endif()
0106 if(EXISTS ${PROJECT_SOURCE_DIR}/benchmarks)
0107 add_subdirectory(benchmarks)
0108 endif()
0109 if(EXISTS ${PROJECT_SOURCE_DIR}/verification)
0110 add_subdirectory(verification)
0111 endif()
0112 endif()
0113
0114 #-----------------------------------------------------------------------
0115 # - Examples build/install
0116 # ON by default for end users. Developers can switch this OFF if they
0117 # need to save time/space
0118 option(GEANT4_INSTALL_EXAMPLES "Install code and documentation for Geant4 examples" ON)
0119 mark_as_advanced(GEANT4_INSTALL_EXAMPLES)
0120
0121 if(GEANT4_INSTALL_EXAMPLES)
0122 install(DIRECTORY examples
0123 DESTINATION ${CMAKE_INSTALL_DATADIR}
0124 COMPONENT Examples
0125 PATTERN "CVS" EXCLUDE
0126 PATTERN ".svn" EXCLUDE
0127 )
0128 endif()
0129
0130 #-----------------------------------------------------------------------
0131 # - CPack-aging
0132 include(G4CPack)
0133
0134 #-----------------------------------------------------------------------
0135 # Final output - show what's been enabled so that user knows what's
0136 # happening - also useful for later problem solving!
0137 #
0138 geant4_print_enabled_features()
0139