Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/cmake/Templates/Geant4Config.cmake.in

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /cmake/Templates/Geant4Config.cmake.in (Version 11.3.0) and /cmake/Templates/Geant4Config.cmake.in (Version 10.1.p3)


  1 # - Geant4 CMake Configuration File for Extern      1 # - Geant4 CMake Configuration File for External Projects
  2 # This file is configured by Geant4 for use by      2 # This file is configured by Geant4 for use by an external project
  3 # This file is configured by Geant4's CMake sy      3 # This file is configured by Geant4's CMake system and SHOULD NOT BE EDITED
  4 #                                                   4 #
  5 # It defines the following variables                5 # It defines the following variables
  6 #  Geant4_INCLUDE_DIRS - include directories f      6 #  Geant4_INCLUDE_DIRS - include directories for Geant4
                                                   >>   7 #  Geant4_DEFINITIONS  - compile definitions needed to use Geant4
  7 #  Geant4_LIBRARIES    - libraries to link aga      8 #  Geant4_LIBRARIES    - libraries to link against
  8 #  Geant4_BUILD_TYPE   - Build type (e.g. "Rel << 
  9 #                        install. Only set if  << 
 10 #                        a single mode tool (e << 
 11 #  Geant4_CXX_FLAGS    - Recommended CXX flags      9 #  Geant4_CXX_FLAGS    - Recommended CXX flags for the compiler used to
 12 #                        build the Geant4 libr     10 #                        build the Geant4 libraries.
 13 #  Geant4_CXX_FLAGS_<CONFIG> - Recommended CXX     11 #  Geant4_CXX_FLAGS_<CONFIG> - Recommended CXX flags for build mode CONFIG.
 14 #  Geant4_USE_FILE     - path to a CMake modul     12 #  Geant4_USE_FILE     - path to a CMake module which may be included to
 15 #                        help setup CMake vari     13 #                        help setup CMake variables
 16 #  Geant4_CXXSTD       - C++ Standard used to      14 #  Geant4_CXXSTD       - C++ Standard used to compile Geant4, e.g. c++98
 17 #  Geant4_TLS_MODEL    - Thread Local Storage      15 #  Geant4_TLS_MODEL    - Thread Local Storage model used. Only set if
 18 #                        the build used an exp <<  16 #                        the install provides multithreading support.
 19 #                                                  17 #
 20 # You may supply a version number through find     18 # You may supply a version number through find_package which will be checked
 21 # against the version of this build. Standard      19 # against the version of this build. Standard CMake logic is used so that
 22 # the EXACT flag may be passed, and otherwise      20 # the EXACT flag may be passed, and otherwise this build will report itself
 23 # as compatible with the requested version if:     21 # as compatible with the requested version if:
 24 #                                                  22 #
 25 #  VERSION_OF_THIS_BUILD >= VERSION_REQUESTED      23 #  VERSION_OF_THIS_BUILD >= VERSION_REQUESTED
 26 #                                                  24 #
 27 # By default only the core (or kernel) of Gean     25 # By default only the core (or kernel) of Geant4 is activated by this
 28 # module. You can specify additional component     26 # module. You can specify additional components of Geant4 through the
 29 # COMPONENTS argument to find_package. By defa     27 # COMPONENTS argument to find_package. By default, all core libraries of
 30 # Geant4 are appended to the Geant4_LIBRARIES  <<  28 # Geant4 are appended to the Geant4_LIBRARIES variable. Specifiying
 31 # additional components will enable a check on     29 # additional components will enable a check on the existence of these
 32 # components, with the following per component     30 # components, with the following per component variables being set:
 33 #                                                  31 #
 34 #  Geant4_${COMPONENT}_FOUND    TRUE is the Ge     32 #  Geant4_${COMPONENT}_FOUND    TRUE is the Geant4 library "component" was
 35 #                               found              33 #                               found
 36 #                                                  34 #
 37 #  Geant4_${COMPONENT}_LIBRARY  Contains the l     35 #  Geant4_${COMPONENT}_LIBRARY  Contains the library for the specified
 38 #                               "component" IF     36 #                               "component" IF the component is a library.
 39 #                                                  37 #
 40 # In Geant4, components can be optional subcom     38 # In Geant4, components can be optional subcomponents of an always
 41 # available library. In that case there will b     39 # available library. In that case there will be no
 42 # Geant4_{COMPONENT}_LIBRARY variable. These n     40 # Geant4_{COMPONENT}_LIBRARY variable. These non-library components are
 43 # generally activated by compile definitions t <<  41 # generally activated by compile definitions, and in these cases the
 44 # COMPILE_DEFINITIONS property.                <<  42 # appropriate definition will be added to the Geant4_DEFINITIONS component.
 45 #                                                  43 #
 46 # If you use the REQUIRED and/or COMPONENTS ar <<  44 # If you specify components and use the REQUIRED option to find_package,
 47 # specify components, then the module will iss <<  45 # then the module will issue a FATAL_ERROR if this build of Geant4 does
 48 # found Geant4 does not have the requested com <<  46 # not have the requested component(s).
 49 # specified through the OPTIONAL_COMPONENTS ar << 
 50 # only if the found Geant4 supports them, with << 
 51 # they are not supported.                      << 
 52 #                                                  47 #
 53 # The components available generally correspon     48 # The components available generally correspond to configurations of
 54 # the Geant4 libraries or optional extras that     49 # the Geant4 libraries or optional extras that Geant4 can be built with.
 55 #                                                  50 #
 56 # Library Configuration                            51 # Library Configuration
 57 # ---------------------                            52 # ---------------------
 58 #  static            (Static libraries availab     53 #  static            (Static libraries available. Using this component
 59 #                     when static libraries ar     54 #                     when static libraries are available will result in
 60 #                     Geant4_LIBRARIES being p     55 #                     Geant4_LIBRARIES being populated with the static
 61 #                     versions of the Geant4 l <<  56 #                     versions of the Geant4 libraries. It does not
 62 #                     guarantee the use of sta     57 #                     guarantee the use of static third party libraries.)
 63 #  multithreaded     (Libraries are multithrea <<  58 #  multithreaded     (Libraries have multithreading support. Using this
                                                   >>  59 #                     component will add the compiler definitions needed
                                                   >>  60 #                     to activate multithread mode to Geant4_DEFINITIONS,
                                                   >>  61 #                     if the libraries support it.)
 64 #                                                  62 #
 65 #  usolids           (Geant4 solids are replac     63 #  usolids           (Geant4 solids are replaced with USolids equivalents)
 66 #                                                  64 #
 67 #  smartstack        (G4event library G4StackM << 
 68 #                                              << 
 69 #  php_as_hp         (G4processes library Part << 
 70 #                                              << 
 71 # Optional Components                              65 # Optional Components
 72 # -------------------                              66 # -------------------
 73 #  gdml              (GDML support)                67 #  gdml              (GDML support)
 74 #  g3tog4            (Geant3 geometry call lis     68 #  g3tog4            (Geant3 geometry call list reader library)
 75 #  freetype          (G4analysis library has f << 
 76 #  hdf5              (G4analysis library has H << 
 77 #                                                  69 #
 78 #  ui_tcsh           (TCsh Style Application C     70 #  ui_tcsh           (TCsh Style Application Command Line Interface)
 79 #  ui_win32          (WIN32 Style Application      71 #  ui_win32          (WIN32 Style Application Command Line Interface)
 80 #                                                  72 #
 81 #  motif             (Motif-X11/OpenGL Graphic     73 #  motif             (Motif-X11/OpenGL Graphical User Interface)
 82 #  qt                (Qt/OpenGL Graphical User <<  74 #  qt                (Qt4/OpenGL Graphical User Interface)
                                                   >>  75 #  wt                (Wt/OpenGL Web based Graphical User Interface)
 83 #                                                  76 #
 84 #  vis_Vtk           (VTK Graphical User Inter <<  77 #  vis_network_dawn  (Client/Server network interface to DAWN visualization)
 85 #  vis_openinventor  (OpenInventor visualizati <<  78 #  vis_network_vrml  (Client/Server network interface to VRML visualization)
 86 #  vis_opengl_x11    (OpenGL visualization wit     79 #  vis_opengl_x11    (OpenGL visualization with X11 interface)
 87 #  vis_opengl_win32  (OpenGL visualization wit     80 #  vis_opengl_win32  (OpenGL visualization with X11 interface)
 88 #  vis_raytracer_x11 (RayTracer visualization      81 #  vis_raytracer_x11 (RayTracer visualization with X11 interface)
                                                   >>  82 #  vis_openinventor  (OpenInventor visualization)
 89 #                                                  83 #
 90 # In addition, two 'shorthand' components are      84 # In addition, two 'shorthand' components are defined to help activate all
 91 # available User Interface and Visualization d     85 # available User Interface and Visualization drivers:
 92 #                                                  86 #
 93 #  ui_all            (All available UI drivers     87 #  ui_all            (All available UI drivers)
 94 #  vis_all           (All available Vis driver     88 #  vis_all           (All available Vis drivers)
 95 #                                                  89 #
 96 # These never result in a FATAL_ERROR, even if     90 # These never result in a FATAL_ERROR, even if the REQUIRED find_package
 97 # argument is set. This is because these optio     91 # argument is set. This is because these options do not depend on specific
 98 # components being available.                      92 # components being available.
 99 #                                                  93 #
100 # You can also query whether the Geant4 found  <<  94 # You can also query whether the Geant4 found uses the builtin versions
101 # versions of CLHEP, ZLIB, or Expat after call <<  95 # of CLHEP, ZLIB, Expat and USolids after calling find_package via the variables
102 #                                                  96 #
103 #  Geant4_builtin_clhep_FOUND   (TRUE if Geant     97 #  Geant4_builtin_clhep_FOUND   (TRUE if Geant4 built with internal CLHEP)
104 #  Geant4_system_clhep_FOUND    (TRUE if Geant << 
105 #  Geant4_builtin_expat_FOUND   (TRUE if Geant     98 #  Geant4_builtin_expat_FOUND   (TRUE if Geant4 built with internal Expat)
                                                   >>  99 #  Geant4_builtin_usolids_FOUND (TRUE if Geant4 built with internal USolids)
106 #  Geant4_builtin_zlib_FOUND    (TRUE if Geant    100 #  Geant4_builtin_zlib_FOUND    (TRUE if Geant4 built with internal Zlib)
107 #                                                 101 #
108 # These are not used via components as they do    102 # These are not used via components as they do not, in general, affect
109 # the use of Geant4 in an application unless y    103 # the use of Geant4 in an application unless you yourself make direct
110 # calls to these APIs. As the builtin librarie    104 # calls to these APIs. As the builtin libraries only contain the code
111 # required directly by the Geant4 toolkit, you    105 # required directly by the Geant4 toolkit, you may wish to perform a
112 # configure time check in these cases that the    106 # configure time check in these cases that the builtin libraries contain
113 # the calls required. In both cases, the Geant    107 # the calls required. In both cases, the Geant4_INCLUDE_DIRS and
114 # Geant4_LIBRARIES variables will be populated    108 # Geant4_LIBRARIES variables will be populated to use the builtin or
115 # system APIs as required, and you should use     109 # system APIs as required, and you should use these to ensure you compile
116 # and link against the same API version.          110 # and link against the same API version.
117 #                                                 111 #
                                                   >> 112 # An additional variable is set for CLHEP when Geant4 was built using a
                                                   >> 113 # system install to indicate whether the single/granular CLHEP library/ies
                                                   >> 114 # was/were linked against
                                                   >> 115 #
                                                   >> 116 #  Geant4_system_clhep_ISGRANULAR (TRUE is Geant4 linked to granular CLHEP)
                                                   >> 117 #
118 # Environment variables for, and directory pat    118 # Environment variables for, and directory paths to, physics datasets
119 # used by some Geant4 physics processes may be    119 # used by some Geant4 physics processes may be determined from the
120 # variables                                       120 # variables
121 #                                                 121 #
122 #  Geant4_DATASETS               (List of data    122 #  Geant4_DATASETS               (List of dataset names known to Geant4)
123 #  Geant4_DATASET_<NAME>_ENVVAR  (Name of envi    123 #  Geant4_DATASET_<NAME>_ENVVAR  (Name of environment variable used by
124 #                                 Geant4 to ob    124 #                                 Geant4 to obtain path to dataset
125 #                                 <NAME>)         125 #                                 <NAME>)
126 #  Geant4_DATASET_<NAME>_PATH    (Path to data    126 #  Geant4_DATASET_<NAME>_PATH    (Path to dataset <NAME>. NB this may
127 #                                 point to a n    127 #                                 point to a non-existent path if Geant4
128 #                                 was configur    128 #                                 was configured not to install data)
129 #                                                 129 #
130 #---------------------------------------------    130 #-----------------------------------------------------------------------
131 # Variables used by this module which can chan    131 # Variables used by this module which can change the default behaviour of
132 # this module. They need to be set prior to th    132 # this module. They need to be set prior to the call to find_package
133 #                                                 133 #
134 #  Geant4_CONFIG_DEBUG    If set, enable extra    134 #  Geant4_CONFIG_DEBUG    If set, enable extra messaging output which can
135 #                         be helpful in debugg    135 #                         be helpful in debugging and identifying problems
136 #                         with the configurati    136 #                         with the configuration.
137 #                                                 137 #
138 #---------------------------------------------    138 #-----------------------------------------------------------------------
139                                                   139 
140 #---------------------------------------------    140 #-----------------------------------------------------------------------
141 # DEBUG : print out the variables passed via f    141 # DEBUG : print out the variables passed via find_package arguments
142 #                                                 142 #
143 if(Geant4_CONFIG_DEBUG)                           143 if(Geant4_CONFIG_DEBUG)
144   message(STATUS "G4CFG_DEBUG : Geant4_VERSION    144   message(STATUS "G4CFG_DEBUG : Geant4_VERSION         = ${Geant4_VERSION}")
145   message(STATUS "G4CFG_DEBUG : Geant4_FIND_VE    145   message(STATUS "G4CFG_DEBUG : Geant4_FIND_VERSION    = ${Geant4_FIND_VERSION}")
146   message(STATUS "G4CFG_DEBUG : Geant4_FIND_RE    146   message(STATUS "G4CFG_DEBUG : Geant4_FIND_REQUIRED   = ${Geant4_FIND_REQUIRED}")
147   message(STATUS "G4CFG_DEBUG : Geant4_FIND_CO    147   message(STATUS "G4CFG_DEBUG : Geant4_FIND_COMPONENTS = ${Geant4_FIND_COMPONENTS}")
148                                                   148 
149   foreach(_cpt ${Geant4_FIND_COMPONENTS})         149   foreach(_cpt ${Geant4_FIND_COMPONENTS})
150     message(STATUS "G4CFG_DEBUG : Geant4_FIND_    150     message(STATUS "G4CFG_DEBUG : Geant4_FIND_REQUIRED_${_cpt} = ${Geant4_FIND_REQUIRED_${_cpt}}")
151   endforeach()                                    151   endforeach()
152                                                   152 
153   message(STATUS "G4CFG_DEBUG : Geant4_LIBDEPS    153   message(STATUS "G4CFG_DEBUG : Geant4_LIBDEPS_LOADED = ${Geant4_LIBDEPS_LOADED}")
154 endif()                                           154 endif()
155                                                   155 
156 #---------------------------------------------    156 #-----------------------------------------------------------------------
157 # Check that consumers use the minimum needed  << 
158 # Geant4 uses cxx_std_EP to define the standar << 
159 # 3.8 and above support EP=17. 3.12 and above  << 
160 # We continue to support the earlier version w << 
161 cmake_policy(VERSION 3.8...3.18)               << 
162 if(CMAKE_VERSION VERSION_LESS 3.8)             << 
163   message(FATAL_ERROR "Projects consuming Gean << 
164 endif()                                        << 
165                                                << 
166 if(("@CMAKE_CXX_STANDARD@" GREATER_EQUAL 23) A << 
167   message(FATAL_ERROR "Projects consuming Gean << 
168 endif()                                        << 
169                                                << 
170 if(("@CMAKE_CXX_STANDARD@" GREATER_EQUAL 20) A << 
171   message(FATAL_ERROR "Projects consuming Gean << 
172 endif()                                        << 
173                                                << 
174 # - Help find dependencies                     << 
175 include(CMakeFindDependencyMacro)              << 
176                                                << 
177 #--------------------------------------------- << 
178 # Locate ourselves, since all other config fil    157 # Locate ourselves, since all other config files should have been
179 # installed alongside us...                       158 # installed alongside us...
180 #                                                 159 #
181 get_filename_component(_geant4_thisdir "${CMAK << 160 get_filename_component(_thisdir "${CMAKE_CURRENT_LIST_FILE}" PATH)
182                                                   161 
183 #---------------------------------------------    162 #-----------------------------------------------------------------------
184 # Provide *recommended* compiler flags used by    163 # Provide *recommended* compiler flags used by this build of Geant4
185 # Don't mess with the actual CMAKE_CXX_FLAGS!!    164 # Don't mess with the actual CMAKE_CXX_FLAGS!!!
186 # It's up to the user what to do with these       165 # It's up to the user what to do with these
187 @GEANT4_COMPILER_FLAG_HINTS@                      166 @GEANT4_COMPILER_FLAG_HINTS@
188                                                   167 
189 # - Provide variable indicating C++ Standard w    168 # - Provide variable indicating C++ Standard we were compiled against
190 set(Geant4_CXX_STANDARD "@CMAKE_CXX_STANDARD@" << 169 set(Geant4_CXXSTD "@GEANT4_BUILD_CXXSTD@")
                                                   >> 170 
                                                   >> 171 #-----------------------------------------------------------------------
                                                   >> 172 # Set the base compile definitions required to use Geant4 if the variable
                                                   >> 173 # does not exist (we do this to ensure multiple calls to find_package
                                                   >> 174 # don't overwrite previous invocations)
                                                   >> 175 # Components may append to this
                                                   >> 176 # We set VIS/UI_USE directly here, because for now they are, unfortunately,
                                                   >> 177 # always needed for the Examples.
                                                   >> 178 # However, they ARE NOT required to use Geant4 itself.
                                                   >> 179 #
                                                   >> 180 if(NOT Geant4_DEFINITIONS)
                                                   >> 181   set(Geant4_DEFINITIONS @GEANT4_CORE_DEFINITIONS@)
                                                   >> 182 endif()
                                                   >> 183 
                                                   >> 184 # We set VIS/UI_USE directly here, because for now they are, unfortunately,
                                                   >> 185 # always needed for the Examples.
                                                   >> 186 # However, they ARE NOT required to use Geant4 itself.
                                                   >> 187 #
                                                   >> 188 if(NOT G4UI_NONE)
                                                   >> 189   list(APPEND Geant4_DEFINITIONS -DG4UI_USE)
                                                   >> 190 endif()
                                                   >> 191 
                                                   >> 192 if(NOT G4VIS_NONE)
                                                   >> 193   list(APPEND Geant4_DEFINITIONS -DG4VIS_USE)
                                                   >> 194 endif()
191                                                   195 
192 #---------------------------------------------    196 #-----------------------------------------------------------------------
193 # Configure the path to the Geant4 headers, us    197 # Configure the path to the Geant4 headers, using a relative path if
194 # possible. This is only known at CMake time,     198 # possible. This is only known at CMake time, so we expand a CMake
195 # supplied variable.                              199 # supplied variable.
196 #                                                 200 #
197 @GEANT4_INCLUDE_DIR_SETUP@                        201 @GEANT4_INCLUDE_DIR_SETUP@
198 set(Geant4_INCLUDE_DIRS "${Geant4_INCLUDE_DIR} << 
199                                                   202 
200 # Push our own module path onto the CMake one  << 203 @GEANT4_MODULE_PATH_SETUP@
201 # - Popped at end of this module               << 204 
202 list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRE << 205 #-----------------------------------------------------------------------
                                                   >> 206 # Configure the path(s) to third party headers.
                                                   >> 207 # This is not a perfect solution to recording dependencies on external
                                                   >> 208 # libraries, but it does ensure that users of THIS Geant4 will pick up
                                                   >> 209 # those it was built against.
                                                   >> 210 # Library dependencies are generally handled through the
                                                   >> 211 # Geant4LibraryDepends file listed below (apart from one exception!)
                                                   >> 212 #
                                                   >> 213 set(Geant4_THIRD_PARTY_INCLUDE_DIRS @GEANT4_THIRD_PARTY_INCLUDES@)
                                                   >> 214 
                                                   >> 215 #-----------------------------------------------------------------------
                                                   >> 216 # Construct overall include path for using Geant4
                                                   >> 217 #
                                                   >> 218 set(Geant4_INCLUDE_DIRS
                                                   >> 219     ${Geant4_INCLUDE_DIR}
                                                   >> 220     ${Geant4_THIRD_PARTY_INCLUDE_DIRS})
                                                   >> 221 
                                                   >> 222 #-----------------------------------------------------------------------
                                                   >> 223 # If we have used imported targets for any third party packages, reimport
                                                   >> 224 # them here, BEFORE we try and import the Geant4 targets which are
                                                   >> 225 # linked against them.
                                                   >> 226 # Generally, we try and use a standard find_package, but try and force it
                                                   >> 227 # to find the actual package we were built against.
                                                   >> 228 # THIS IS NOT PERFECT, AS IT CANNOT GUARANTEE A BINARY COMPATIBLE
                                                   >> 229 # PACKAGE IS FOUND.
                                                   >> 230 @GEANT4_THIRD_PARTY_IMPORT_SETUP@
                                                   >> 231 
                                                   >> 232 #-----------------------------------------------------------------------
                                                   >> 233 # Include the file listing all the imported targets.
                                                   >> 234 # (Not needed if used in the same Geant4 project, or if we have run before)
                                                   >> 235 # This is always installed in the same location as us...
                                                   >> 236 #
                                                   >> 237 if(NOT CMAKE_PROJECT_NAME STREQUAL Geant4)
                                                   >> 238   if(NOT Geant4_LIBDEPS_LOADED)
                                                   >> 239     include("${_thisdir}/Geant4LibraryDepends.cmake")
                                                   >> 240     set(Geant4_LIBDEPS_LOADED 1)
                                                   >> 241   endif()
                                                   >> 242 endif()
203                                                   243 
204 #---------------------------------------------    244 #-----------------------------------------------------------------------
205 # Data Resources                                  245 # Data Resources
206 # NB: Because data paths can be "forward decla    246 # NB: Because data paths can be "forward declared" these offer no
207 # guarantee of data existence. They only provi    247 # guarantee of data existence. They only provide a hint.
208 #                                                 248 #
209 set(Geant4_DATASET_DESCRIPTIONS "@GEANT4_DATAS    249 set(Geant4_DATASET_DESCRIPTIONS "@GEANT4_DATASET_DESCRIPTIONS@")
210                                                   250 
211 foreach(_g4dataset_tuple ${Geant4_DATASET_DESC    251 foreach(_g4dataset_tuple ${Geant4_DATASET_DESCRIPTIONS})
212   # Format is NAME|ENVVAR|PATH                    252   # Format is NAME|ENVVAR|PATH
213   string(REPLACE "|" ";" _g4dataset_tuple "${_    253   string(REPLACE "|" ";" _g4dataset_tuple "${_g4dataset_tuple}")
214   list(GET _g4dataset_tuple 0 _g4dataset_name)    254   list(GET _g4dataset_tuple 0 _g4dataset_name)
215   list(APPEND Geant4_DATASETS ${_g4dataset_nam    255   list(APPEND Geant4_DATASETS ${_g4dataset_name})
216   list(GET _g4dataset_tuple 1 Geant4_DATASET_$    256   list(GET _g4dataset_tuple 1 Geant4_DATASET_${_g4dataset_name}_ENVVAR)
217   list(GET _g4dataset_tuple 2 Geant4_DATASET_$    257   list(GET _g4dataset_tuple 2 Geant4_DATASET_${_g4dataset_name}_PATH)
218 endforeach()                                      258 endforeach()
219 unset(Geant4_DATASET_DESCRIPTIONS)                259 unset(Geant4_DATASET_DESCRIPTIONS)
220                                                   260 
221 #---------------------------------------------    261 #-----------------------------------------------------------------------
222 # Optional Build Components                    << 262 # Setup components.
223 #--------------------------------------------- << 263 # THIS SECTION IS VERY ROUGH AND VERY MUCH CUT AND PASTE.
224 # - General Multithreading                     << 264 # TODO: INVESTIGATE TIDY UP WITH LESS PROCESSING.
                                                   >> 265 #-----------------------------------------------------------------------
                                                   >> 266 # Many components are simply present as parts of libraries or always built
                                                   >> 267 # but require additional compile definitions.
                                                   >> 268 #
                                                   >> 269 # Builtin/External packages
                                                   >> 270 set(Geant4_builtin_clhep_FOUND @GEANT4_USE_BUILTIN_CLHEP@)
                                                   >> 271 if(NOT Geant4_builtin_clhep_FOUND)
                                                   >> 272   set(Geant4_system_clhep_ISGRANULAR @GEANT4_USE_SYSTEM_CLHEP_GRANULAR@)
                                                   >> 273 endif()
                                                   >> 274 
                                                   >> 275 set(Geant4_builtin_expat_FOUND @GEANT4_USE_BUILTIN_EXPAT@)
                                                   >> 276 set(Geant4_builtin_zlib_FOUND @GEANT4_USE_BUILTIN_ZLIB@)
                                                   >> 277 set(Geant4_builtin_usolids_FOUND @GEANT4_USE_BUILTIN_USOLIDS@)
                                                   >> 278 
                                                   >> 279 # - Usolids replacement
                                                   >> 280 set(Geant4_usolids_FOUND @GEANT4_USE_USOLIDS@)
                                                   >> 281 if(Geant4_usolids_FOUND)
                                                   >> 282   list(REMOVE_ITEM Geant4_FIND_COMPONENTS usolids)
                                                   >> 283 endif()
                                                   >> 284 
                                                   >> 285 # - Multithreading
225 set(Geant4_multithreaded_FOUND @GEANT4_BUILD_M    286 set(Geant4_multithreaded_FOUND @GEANT4_BUILD_MULTITHREADED@)
226 if(Geant4_multithreaded_FOUND)                    287 if(Geant4_multithreaded_FOUND)
                                                   >> 288   list(REMOVE_ITEM Geant4_FIND_COMPONENTS multithreaded)
                                                   >> 289   list(APPEND Geant4_DEFINITIONS -DG4MULTITHREADED)
                                                   >> 290 
227   # - Define variable to indicate TLS model us    291   # - Define variable to indicate TLS model used
228   set(Geant4_TLS_MODEL "@GEANT4_BUILD_TLS_MODE    292   set(Geant4_TLS_MODEL "@GEANT4_BUILD_TLS_MODEL@")
229   if(Geant4_TLS_MODEL STREQUAL "auto")         << 
230     unset(Geant4_TLS_MODEL)                    << 
231   endif()                                      << 
232 endif()                                           293 endif()
233                                                   294 
234 # - Smart track stack                          << 295 # - GDML
235 set(Geant4_smartstack_FOUND @GEANT4_USE_SMARTS << 296 set(Geant4_gdml_FOUND @GEANT4_USE_GDML@)
236                                                << 297 if(Geant4_gdml_FOUND)
237 # - ParticleHP as HP                           << 298   list(REMOVE_ITEM Geant4_FIND_COMPONENTS gdml)
238 set(Geant4_php_as_hp_FOUND @GEANT4_BUILD_PHP_A << 299 endif()
239                                                   300 
240 # - G3toG4                                        301 # - G3toG4
241 set(Geant4_g3tog4_FOUND @GEANT4_USE_G3TOG4@)      302 set(Geant4_g3tog4_FOUND @GEANT4_USE_G3TOG4@)
242 if(Geant4_g3tog4_FOUND)                           303 if(Geant4_g3tog4_FOUND)
243   if(Geant4_FIND_REQUIRED_g3tog4)                 304   if(Geant4_FIND_REQUIRED_g3tog4)
244     set(_geant4_use_g3tog4_library ON)            305     set(_geant4_use_g3tog4_library ON)
245   endif()                                         306   endif()
                                                   >> 307   list(REMOVE_ITEM Geant4_FIND_COMPONENTS g3tog4)
246 endif()                                           308 endif()
247                                                   309 
248 #--------------------------------------------- << 310 # - UI : TCSH
249 # Optional Components that may depend on exter << 311 set(Geant4_ui_tcsh_FOUND @UNIX@)
250 #--------------------------------------------- << 312 if(Geant4_ui_tcsh_FOUND)
251 # Optionally import build-time package setting << 313   if(Geant4_FIND_REQUIRED_ui_tcsh OR Geant4_FIND_REQUIRED_ui_all)
252 # for find_package to work with                << 314     list(APPEND Geant4_DEFINITIONS -DG4UI_USE_TCSH)
253 include("${CMAKE_CURRENT_LIST_DIR}/Geant4Packa << 
254                                                << 
255 # - CLHEP                                      << 
256 set(Geant4_system_clhep_FOUND @GEANT4_USE_SYST << 
257 if(Geant4_system_clhep_FOUND)                  << 
258   set(Geant4_builtin_clhep_FOUND FALSE)        << 
259   find_dependency(CLHEP @CLHEP_VERSION@ EXACT  << 
260 else()                                         << 
261   set(Geant4_builtin_clhep_FOUND TRUE)         << 
262 endif()                                        << 
263                                                << 
264 # - EXPAT                                      << 
265 set(Geant4_builtin_expat_FOUND @GEANT4_USE_BUI << 
266 if(NOT Geant4_builtin_expat_FOUND)             << 
267   find_dependency(EXPAT @EXPAT_VERSION_STRING@ << 
268   include("${CMAKE_CURRENT_LIST_DIR}/G4EXPATSh << 
269 endif()                                        << 
270                                                << 
271 # - ZLIB                                       << 
272 set(Geant4_builtin_zlib_FOUND @GEANT4_USE_BUIL << 
273 if(NOT Geant4_builtin_zlib_FOUND)              << 
274   find_dependency(ZLIB @ZLIB_VERSION_STRING@)  << 
275 endif()                                        << 
276                                                << 
277 # - PTL/TBB                                    << 
278 set(Geant4_system_ptl_FOUND @GEANT4_USE_SYSTEM << 
279 set(Geant4_TBB_FOUND @GEANT4_USE_TBB@)         << 
280 if(Geant4_system_ptl_FOUND)                    << 
281   set(Geant4_builtin_ptl_FOUND FALSE)          << 
282   if(Geant4_TBB_FOUND)                         << 
283     find_dependency(PTL @PTL_VERSION@ COMPONEN << 
284   else()                                       << 
285     find_dependency(PTL @PTL_VERSION@)         << 
286   endif()                                      << 
287 else()                                         << 
288   # We know exactly where PTL is               << 
289   set(Geant4_builtin_ptl_FOUND TRUE)           << 
290   if(CMAKE_VERSION VERSION_GREATER 3.8.9999)   << 
291     find_dependency(PTL NO_DEFAULT_PATH PATHS  << 
292   else()                                       << 
293     find_package(PTL REQUIRED NO_DEFAULT_PATH  << 
294   endif()                                         315   endif()
                                                   >> 316   list(REMOVE_ITEM Geant4_FIND_COMPONENTS ui_tcsh)
295 endif()                                           317 endif()
296                                                   318 
297 # - GDML                                       << 319 # - UI : win32
298 set(Geant4_gdml_FOUND @GEANT4_USE_GDML@)       << 320 set(Geant4_ui_win32_FOUND @WIN32@)
299 if(Geant4_gdml_FOUND)                          << 321 if(Geant4_ui_win32_FOUND)
300   find_dependency(XercesC @XercesC_VERSION@)   << 322   if(Geant4_FIND_REQUIRED_ui_win32 OR Geant4_FIND_REQUIRED_ui_all)
301 endif()                                        << 323     list(APPEND
302                                                << 324       Geant4_DEFINITIONS
303 # - VecGeom                                    << 325       -DG4INTY_USE_WIN32
304 set(Geant4_usolids_FOUND @GEANT4_USE_USOLIDS_E << 326       -DG4UI_USE_WIN32
305 if(Geant4_usolids_FOUND)                       << 327       )
306   find_dependency(VecGeom @VecGeom_VERSION@)   << 328   endif()
                                                   >> 329   list(REMOVE_ITEM Geant4_FIND_COMPONENTS ui_win32)
307 endif()                                           330 endif()
308                                                   331 
309 # - Freetype                                   << 332 # - Visualization : Network DAWN
310 set(Geant4_freetype_FOUND @GEANT4_USE_FREETYPE << 333 set(Geant4_vis_dawn_network_FOUND @GEANT4_USE_NETWORK_DAWN@)
311 if(Geant4_freetype_FOUND)                      << 334 if(Geant4_vis_dawn_network_FOUND)
312   find_dependency(Freetype @FREETYPE_VERSION_S << 335   if(Geant4_FIND_REQUIRED_vis_dawn_network OR Geant4_FIND_REQUIRED_vis_all)
313   include("${CMAKE_CURRENT_LIST_DIR}/G4Freetyp << 336     list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_DAWN)
                                                   >> 337   endif()
                                                   >> 338   list(REMOVE_ITEM Geant4_FIND_COMPONENTS vis_dawn_network)
314 endif()                                           339 endif()
315                                                   340 
316 # - HDF5                                       << 341 # - Visualization : Network VRML
317 set(Geant4_hdf5_FOUND @GEANT4_USE_HDF5@)       << 342 set(Geant4_vis_vrml_network_FOUND @GEANT4_USE_NETWORK_VRML@)
318 if(Geant4_hdf5_FOUND)                          << 343 if(Geant4_vis_vrml_network_FOUND)
319   find_dependency(HDF5)                        << 344   if(Geant4_FIND_REQUIRED_vis_vrml_network OR Geant4_FIND_REQUIRED_vis_all)
320   include("${CMAKE_CURRENT_LIST_DIR}/G4HDF5Shi << 345     list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_VRML)
                                                   >> 346   endif()
                                                   >> 347   list(REMOVE_ITEM Geant4_FIND_COMPONENTS vis_vrml_network)
321 endif()                                           348 endif()
322                                                   349 
323 #---------------------------------------------    350 #-----------------------------------------------------------------------
324 # UI/VIS                                       << 
325 #                                              << 
326 # Prefer Legacy GL when using CMake >= 3.10    << 
327 set(OpenGL_GL_PREFERENCE_SAVE "${OpenGL_GL_PRE << 
328 set(OpenGL_GL_PREFERENCE "LEGACY")             << 
329                                                << 
330 # - Helper variables for ui/vis_all components << 
331 if("ui_all" IN_LIST Geant4_FIND_COMPONENTS)    << 
332   set(Geant4_ui_all_FOUND TRUE)                << 
333 endif()                                        << 
334                                                << 
335 if("vis_all" IN_LIST Geant4_FIND_COMPONENTS)   << 
336   set(Geant4_vis_all_FOUND TRUE)               << 
337 endif()                                        << 
338                                                << 
339 # - UI : TCSH                                  << 
340 set(Geant4_ui_tcsh_FOUND @UNIX@)               << 
341                                                << 
342 # - UI : win32                                 << 
343 set(Geant4_ui_win32_FOUND @WIN32@)             << 
344                                                << 
345 #--------------------------------------------- << 
346 # Components which requires slightly more comp    351 # Components which requires slightly more complex setup
347 #                                                 352 #
348 # - Visualization : RayTracerX                    353 # - Visualization : RayTracerX
349 set(Geant4_vis_raytracer_x11_FOUND @GEANT4_USE    354 set(Geant4_vis_raytracer_x11_FOUND @GEANT4_USE_RAYTRACER_X11@)
350 if(Geant4_vis_raytracer_x11_FOUND)                355 if(Geant4_vis_raytracer_x11_FOUND)
351   find_dependency(X11)                         << 356   if(Geant4_FIND_REQUIRED_vis_raytracer_x11 OR Geant4_FIND_REQUIRED_vis_all)
352   include("${CMAKE_CURRENT_LIST_DIR}/G4X11Shim << 357     list(APPEND
                                                   >> 358       Geant4_DEFINITIONS
                                                   >> 359       -DG4INTY_USE_XT
                                                   >> 360       -DG4VIS_USE_RAYTRACERX
                                                   >> 361       )
                                                   >> 362   endif()
                                                   >> 363   list(REMOVE_ITEM Geant4_FIND_COMPONENTS vis_raytracer_x11)
353 endif()                                           364 endif()
354                                                   365 
355 # - Qt (UI and Vis!)                              366 # - Qt (UI and Vis!)
356 set(Geant4_qt_FOUND @GEANT4_USE_QT@)              367 set(Geant4_qt_FOUND @GEANT4_USE_QT@)
357 set(Geant4_qt3d_FOUND @GEANT4_USE_QT3D@)       << 368 set(Geant4_USES_QT5 @Qt5Core_FOUND@)
358 if(Geant4_qt_FOUND)                               369 if(Geant4_qt_FOUND)
359   # Must always refind Qt to recreate imported << 370   # Must always refind Qt5 to recreate imported targets. Because these
360   # are in the public interface, always need l    371   # are in the public interface, always need linking.
361   find_dependency(Qt@QT_VERSION_MAJOR@Core REQ << 372   if(Geant4_USES_QT5)
362   find_dependency(Qt@QT_VERSION_MAJOR@Gui REQU << 373     find_package(Qt5Core REQUIRED PATHS "@Qt5Core_DIR@")
363   find_dependency(Qt@QT_VERSION_MAJOR@Widgets  << 374     find_package(Qt5Gui REQUIRED PATHS "@Qt5Gui_DIR@")
364   find_dependency(Qt@QT_VERSION_MAJOR@OpenGL R << 375     find_package(Qt5Widgets REQUIRED PATHS "@Qt5Widgets_DIR@")
365   if(@QT_VERSION_MAJOR@ GREATER 5)             << 376     find_package(Qt5OpenGL REQUIRED PATHS "@Qt5OpenGL_DIR@")
366     find_dependency(Qt@QT_VERSION_MAJOR@OpenGL << 377     find_package(Qt5PrintSupport REQUIRED PATHS "@Qt5PrintSupport_DIR@")
367   endif()                                      << 378   endif()
368                                                << 379 
369   if(Geant4_qt3d_FOUND)                        << 380   if(Geant4_FIND_REQUIRED_qt OR Geant4_FIND_REQUIRED_ui_all OR Geant4_FIND_REQUIRED_vis_all)
370     find_dependency(Qt@QT_VERSION_MAJOR@3DCore << 381     # If we have Qt5, we need to refind the components because they use
371     find_dependency(Qt@QT_VERSION_MAJOR@3DExtr << 382     # imported targets, so linking will not work unless we recreate
372     find_dependency(Qt@QT_VERSION_MAJOR@3DRend << 383     # them
373   endif()                                      << 384 
374                                                << 385     list(APPEND
375   # Also require OpenGL                        << 386       Geant4_DEFINITIONS
376   find_dependency(OpenGL)                      << 387       -DG4INTY_USE_QT
377                                                << 388       -DG4UI_USE_QT
378   # Qt must be activated both directly and for << 389       -DG4VIS_USE_OPENGLQT
379   if(("qt" IN_LIST Geant4_FIND_COMPONENTS)     << 390       )
380      OR ("vis_openinventor" IN_LIST Geant4_FIN << 391     set(_geant4_use_opengl_library ON)
381      OR Geant4_ui_all_FOUND OR Geant4_vis_all_ << 392   endif()
                                                   >> 393   list(REMOVE_ITEM Geant4_FIND_COMPONENTS qt)
                                                   >> 394 endif()
                                                   >> 395 
                                                   >> 396 # - Wt (UI and Vis!)
                                                   >> 397 set(Geant4_wt_FOUND @GEANT4_USE_WT@)
                                                   >> 398 if(Geant4_wt_FOUND)
                                                   >> 399   if(Geant4_FIND_REQUIRED_wt OR Geant4_FIND_REQUIRED_ui_all OR
                                                   >> 400       Geant4_FIND_REQUIRED_vis_all)
                                                   >> 401     list(APPEND
                                                   >> 402       Geant4_DEFINITIONS
                                                   >> 403       -DG4INTY_USE_WT
                                                   >> 404       -DG4UI_USE_WT
                                                   >> 405       -DG4VIS_USE_OPENGLWT
                                                   >> 406       )
382     set(_geant4_use_opengl_library ON)            407     set(_geant4_use_opengl_library ON)
383     # Qt3D is always on if available           << 
384     set(_geant4_use_qt3D_library ${Geant4_qt3d << 
385   endif()                                         408   endif()
                                                   >> 409   list(REMOVE_ITEM Geant4_FIND_COMPONENTS wt)
386 endif()                                           410 endif()
387                                                   411 
388 # - Motif (UI and Vis!)                           412 # - Motif (UI and Vis!)
389 set(Geant4_motif_FOUND @GEANT4_USE_XM@)           413 set(Geant4_motif_FOUND @GEANT4_USE_XM@)
390 if(Geant4_motif_FOUND)                            414 if(Geant4_motif_FOUND)
391   find_dependency(X11)                         << 415   if(Geant4_FIND_REQUIRED_motif OR Geant4_FIND_REQUIRED_ui_all OR
392   include("${CMAKE_CURRENT_LIST_DIR}/G4X11Shim << 416       Geant4_FIND_REQUIRED_vis_all)
393   find_dependency(Motif)                       << 417     list(APPEND
394   include("${CMAKE_CURRENT_LIST_DIR}/G4MotifSh << 418       Geant4_DEFINITIONS
395   if(APPLE)                                    << 419       -DG4INTY_USE_XT
396     find_dependency(XQuartzGL)                 << 420       -DG4UI_USE_XM
397   else()                                       << 421       -DG4VIS_USE_OPENGLXM
398     find_dependency(OpenGL)                    << 422       )
399   endif()                                      << 
400                                                << 
401   # Motif can be activated both directly and f << 
402   if(("motif" IN_LIST Geant4_FIND_COMPONENTS)  << 
403      OR ("vis_openinventor" IN_LIST Geant4_FIN << 
404      OR Geant4_ui_all_FOUND OR Geant4_vis_all_ << 
405     set(_geant4_use_opengl_library ON)            423     set(_geant4_use_opengl_library ON)
406   endif()                                         424   endif()
                                                   >> 425 
                                                   >> 426   list(REMOVE_ITEM Geant4_FIND_COMPONENTS motif)
407 endif()                                           427 endif()
408                                                   428 
409 # - OpenGL X11                                    429 # - OpenGL X11
410 set(Geant4_vis_opengl_x11_FOUND @GEANT4_USE_OP    430 set(Geant4_vis_opengl_x11_FOUND @GEANT4_USE_OPENGL_X11@)
411 if(Geant4_vis_opengl_x11_FOUND)                   431 if(Geant4_vis_opengl_x11_FOUND)
412   find_dependency(X11)                         << 432   if(Geant4_FIND_REQUIRED_vis_opengl_x11 OR Geant4_FIND_REQUIRED_vis_all)
413   include("${CMAKE_CURRENT_LIST_DIR}/G4X11Shim << 433     list(APPEND
414   if(APPLE)                                    << 434       Geant4_DEFINITIONS
415     find_dependency(XQuartzGL)                 << 435       -DG4INTY_USE_XT
416   else()                                       << 436       -DG4VIS_USE_OPENGLX
417     find_dependency(OpenGL)                    << 437       )
418   endif()                                      << 
419                                                << 
420   if(("vis_opengl_x11" IN_LIST Geant4_FIND_COM << 
421     set(_geant4_use_opengl_library ON)            438     set(_geant4_use_opengl_library ON)
422   endif()                                         439   endif()
                                                   >> 440 
                                                   >> 441   list(REMOVE_ITEM Geant4_FIND_COMPONENTS vis_opengl_x11)
423 endif()                                           442 endif()
424                                                   443 
425 # - OpenGL Win32                                  444 # - OpenGL Win32
426 set(Geant4_vis_opengl_win32_FOUND @GEANT4_USE_    445 set(Geant4_vis_opengl_win32_FOUND @GEANT4_USE_OPENGL_WIN32@)
427 if(Geant4_vis_opengl_win32_FOUND)                 446 if(Geant4_vis_opengl_win32_FOUND)
428   find_dependency(OpenGL)                      << 447   if(Geant4_FIND_REQUIRED_vis_opengl_win32 OR Geant4_FIND_REQUIRED_vis_all)
429   if(("vis_opengl_win32" IN_LIST Geant4_FIND_C << 448     list(APPEND
                                                   >> 449       Geant4_DEFINITIONS
                                                   >> 450       -DG4INTY_USE_WIN32
                                                   >> 451       -DG4VIS_USE_OPENGLWIN32
                                                   >> 452       )
430     set(_geant4_use_opengl_library ON)            453     set(_geant4_use_opengl_library ON)
431   endif()                                         454   endif()
                                                   >> 455 
                                                   >> 456   list(REMOVE_ITEM Geant4_FIND_COMPONENTS vis_opengl_win32)
432 endif()                                           457 endif()
433                                                   458 
434 # - OpenInventor                                  459 # - OpenInventor
435 set(Geant4_vis_openinventor_FOUND @GEANT4_USE_    460 set(Geant4_vis_openinventor_FOUND @GEANT4_USE_INVENTOR@)
436 set(Geant4_vis_openinventor_qt_FOUND @GEANT4_U << 
437 if(Geant4_vis_openinventor_FOUND)                 461 if(Geant4_vis_openinventor_FOUND)
438   find_dependency(Coin)                        << 462   if(Geant4_FIND_REQUIRED_vis_openinventor OR Geant4_FIND_REQUIRED_vis_all)
439                                                << 463     if(UNIX AND NOT WIN32)
440   if(Geant4_vis_openinventor_qt_FOUND)         << 464       list(APPEND Geant4_DEFINITIONS
441     # Qt dependency handled by Geant4_vis_qt_F << 465         -DG4INTY_USE_XT
442     # always ON if Inventor_QT is              << 466         -DG4VIS_USE_OI
443     find_dependency(SoQt)                      << 467         -DG4VIS_USE_OIX
444   else()                                       << 468         )
445     if(WIN32)                                  << 469     elseif(WIN32)
446       find_dependency(SoWin)                   << 470       list(APPEND Geant4_DEFINITIONS
447     else()                                     << 471         -G4INTY_USE_WIN32
448       # Motif/X11/GL dependency handled by Gea << 472         -DG4VIS_USE_OI
449       # always ON if Inventor/Xt is.           << 473         -DG4VIS_USE_OIWIN32
450       find_dependency(SoXt)                    << 474         )
451     endif()                                       475     endif()
452   endif()                                      << 
453                                                   476 
454   if(("vis_openinventor" IN_LIST Geant4_FIND_C << 
455     set(_geant4_use_inventor_library ON)          477     set(_geant4_use_inventor_library ON)
456   endif()                                         478   endif()
457 endif()                                        << 
458                                                << 
459 # Reset any OpenGL Preference                  << 
460 set(OpenGL_GL_PREFERENCE "${OpenGL_GL_PREFEREN << 
461                                                   479 
462 set(Geant4_vis_Vtk_FOUND @GEANT4_USE_VTK@)     << 480   list(REMOVE_ITEM Geant4_FIND_COMPONENTS vis_openinventor)
463 if(Geant4_vis_Vtk_FOUND)                       << 
464   find_dependency(VTK 9 REQUIRED COMPONENTS    << 
465     CommonColor                                << 
466     InteractionStyle                           << 
467     IOExport                                   << 
468     GUISupportQt                               << 
469     RenderingVolumeOpenGL2                     << 
470   )                                            << 
471   set(_geant4_use_vtk_library ON)              << 
472 endif()                                           481 endif()
473                                                   482 
474 #--------------------------------------------- << 
475 # Include the files listing all the imported t << 
476 # Intel/MSVC Compile Features                  << 
477 # (Not needed if used in the same Geant4 proje << 
478 # This is always installed in the same locatio << 
479 #                                              << 
480 if(NOT CMAKE_PROJECT_NAME STREQUAL Geant4)     << 
481   include("${_geant4_thisdir}/Modules/IntelCom << 
482   include("${_geant4_thisdir}/Modules/MSVCComp << 
483                                                << 
484   if(NOT Geant4_LIBDEPS_LOADED)                << 
485     include("${_geant4_thisdir}/Geant4LibraryD << 
486     set(Geant4_LIBDEPS_LOADED 1)               << 
487   endif()                                      << 
488 endif()                                        << 
489                                                   483 
490 #---------------------------------------------    484 #-----------------------------------------------------------------------
491 # Now perform final configuration of libraries    485 # Now perform final configuration of libraries...
492 # We provide FOUND variables for presence of s    486 # We provide FOUND variables for presence of shared and static
493 # User can supply "static" component to force     487 # User can supply "static" component to force use of static libraries, if
494 # available.                                      488 # available.
495 set(Geant4_shared_FOUND @BUILD_SHARED_LIBS@)      489 set(Geant4_shared_FOUND @BUILD_SHARED_LIBS@)
496 set(Geant4_static_FOUND @BUILD_STATIC_LIBS@)      490 set(Geant4_static_FOUND @BUILD_STATIC_LIBS@)
497                                                   491 
498 # - Default setting : shared if available, sta    492 # - Default setting : shared if available, static otherwise
499 if(Geant4_shared_FOUND)                           493 if(Geant4_shared_FOUND)
500   set(_geant4_lib_use_suffix "")                  494   set(_geant4_lib_use_suffix "")
501 else()                                            495 else()
502   set(_geant4_lib_use_suffix "-static")           496   set(_geant4_lib_use_suffix "-static")
503 endif()                                           497 endif()
504                                                   498 
505 if(("static" IN_LIST Geant4_FIND_COMPONENTS) A << 499 if(Geant4_FIND_REQUIRED_static AND Geant4_static_FOUND)
506   set(_geant4_lib_use_suffix "-static")           500   set(_geant4_lib_use_suffix "-static")
                                                   >> 501   list(REMOVE_ITEM Geant4_FIND_COMPONENTS static)
507 endif()                                           502 endif()
508                                                   503 
509 # The list of libraries probably should be aut    504 # The list of libraries probably should be autogenerated, but we hard code
510 # for now. We don't have to divide the list of    505 # for now. We don't have to divide the list of shared libraries, but we
511 # do so for consistency with the way we'll nee    506 # do so for consistency with the way we'll need to do it for static.
512 # - Always on Vis Components                      507 # - Always on Vis Components
513 set(_geant4_internal_libraries                    508 set(_geant4_internal_libraries
514   Geant4::G4Tree${_geant4_lib_use_suffix}      << 509   G4Tree${_geant4_lib_use_suffix}
515   Geant4::G4FR${_geant4_lib_use_suffix}        << 510   G4FR${_geant4_lib_use_suffix}
516   Geant4::G4GMocren${_geant4_lib_use_suffix}   << 511   G4GMocren${_geant4_lib_use_suffix}
517   Geant4::G4visHepRep${_geant4_lib_use_suffix} << 512   G4visHepRep${_geant4_lib_use_suffix}
518   Geant4::G4RayTracer${_geant4_lib_use_suffix} << 513   G4RayTracer${_geant4_lib_use_suffix}
519   Geant4::G4VRML${_geant4_lib_use_suffix}      << 514   G4VRML${_geant4_lib_use_suffix}
520   Geant4::G4ToolsSG${_geant4_lib_use_suffix})  << 515   )
521                                                   516 
522 # - G4OpenGL if it's requested.                   517 # - G4OpenGL if it's requested.
523 if(_geant4_use_opengl_library)                    518 if(_geant4_use_opengl_library)
524   list(APPEND _geant4_internal_libraries Geant << 519   list(APPEND _geant4_internal_libraries
525 endif()                                        << 520     G4OpenGL${_geant4_lib_use_suffix}
526                                                << 521     G4gl2ps${_geant4_lib_use_suffix}
527 # - Qt3D if it's requested.                    << 522     )
528 if(_geant4_use_qt3D_library)                   << 523   list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_OPENGL)
529   list(APPEND _geant4_internal_libraries Geant << 
530 endif()                                           524 endif()
531                                                   525 
532 # - G4OpenInventor if it's requested.             526 # - G4OpenInventor if it's requested.
533 if(_geant4_use_inventor_library)                  527 if(_geant4_use_inventor_library)
534   list(APPEND _geant4_internal_libraries Geant << 528   list(APPEND _geant4_internal_libraries
535 endif()                                        << 529     G4OpenInventor${_geant4_lib_use_suffix}
536                                                << 530     )
537 if(_geant4_use_vtk_library)                    << 
538   list(APPEND _geant4_internal_libraries Geant << 
539 endif()                                        << 
540                                                << 
541 # - GDML always added for now as old G4persist << 
542 if(Geant4_gdml_FOUND)                          << 
543   set(_geant4_g4gdml_library Geant4::G4gdml${_ << 
544 endif()                                           531 endif()
545                                                   532 
546 # - G3toG4 if it's requested                      533 # - G3toG4 if it's requested
547 if(_geant4_use_g3tog4_library)                    534 if(_geant4_use_g3tog4_library)
548   set(_geant4_g3tog4_library Geant4::G3toG4${_ << 535   set(_geant4_g3tog4_library G3toG4${_geant4_lib_use_suffix})
549 endif()                                           536 endif()
550                                                   537 
551 set(_geant4_physicslists_library Geant4::G4phy << 538 # - Factory registration mechanism in physics_lists requires whole
                                                   >> 539 # archive to be linked when using static libs, so requires wrapping
                                                   >> 540 # with suitable compiler dependent flags
                                                   >> 541 set(_geant4_physicslists_library G4physicslists${_geant4_lib_use_suffix})
                                                   >> 542 if(_geant4_lib_use_suffix STREQUAL "-static")
                                                   >> 543   # - Use CMAKE_CXX_COMPILER_ID, which should be reliable enough...
                                                   >> 544   # Though the GNU/Clang/Intel compilers/linkers *should* use identical
                                                   >> 545   # flags,keep their sections separate until behaviour confirmed
                                                   >> 546   #
                                                   >> 547   if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
                                                   >> 548     set(_geant4_physicslists_library -Wl,--whole-archive G4physicslists${_geant4_lib_use_suffix} -Wl,--no-whole-archive)
                                                   >> 549   elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
                                                   >> 550     set(_geant4_physicslists_library -Wl,-force_load G4physicslists${_geant4_lib_use_suffix})
                                                   >> 551   elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
                                                   >> 552     set(_geant4_physicslists_library -Wl,--whole-archive G4physicslists${_geant4_lib_use_suffix} -Wl,--no-whole-archive)
                                                   >> 553   else()
                                                   >> 554     # Needs determination of other compiler options.
                                                   >> 555     # NB: MSVC has /OPT:NOREF, but may apply globally...
                                                   >> 556     set(_geant4_physicslists_library G4physicslists${_geant4_lib_use_suffix})
                                                   >> 557   endif()
                                                   >> 558 endif()
552                                                   559 
553 # - 'Kernel' libraries                            560 # - 'Kernel' libraries
554 list(APPEND _geant4_internal_libraries            561 list(APPEND _geant4_internal_libraries
555   Geant4::G4vis_management${_geant4_lib_use_su << 562   G4vis_management${_geant4_lib_use_suffix}
556   Geant4::G4modeling${_geant4_lib_use_suffix}  << 563   G4modeling${_geant4_lib_use_suffix}
557   Geant4::G4interfaces${_geant4_lib_use_suffix << 564   G4interfaces${_geant4_lib_use_suffix}
558   Geant4::G4mctruth${_geant4_lib_use_suffix}   << 565   G4persistency${_geant4_lib_use_suffix}
559   Geant4::G4geomtext${_geant4_lib_use_suffix}  << 
560   ${_geant4_g4gdml_library}                    << 
561   ${_geant4_g3tog4_library}                       566   ${_geant4_g3tog4_library}
562   Geant4::G4analysis${_geant4_lib_use_suffix}  << 567   G4analysis${_geant4_lib_use_suffix}
563   Geant4::G4error_propagation${_geant4_lib_use << 568   G4error_propagation${_geant4_lib_use_suffix}
564   Geant4::G4readout${_geant4_lib_use_suffix}   << 569   G4readout${_geant4_lib_use_suffix}
565   ${_geant4_physicslists_library}                 570   ${_geant4_physicslists_library}
566   Geant4::G4run${_geant4_lib_use_suffix}       << 571   G4run${_geant4_lib_use_suffix}
567   Geant4::G4event${_geant4_lib_use_suffix}     << 572   G4event${_geant4_lib_use_suffix}
568   Geant4::G4tracking${_geant4_lib_use_suffix}  << 573   G4tracking${_geant4_lib_use_suffix}
569   Geant4::G4parmodels${_geant4_lib_use_suffix} << 574   G4parmodels${_geant4_lib_use_suffix}
570   Geant4::G4processes${_geant4_lib_use_suffix} << 575   G4processes${_geant4_lib_use_suffix}
571   Geant4::G4digits_hits${_geant4_lib_use_suffi << 576   G4digits_hits${_geant4_lib_use_suffix}
572   Geant4::G4track${_geant4_lib_use_suffix}     << 577   G4track${_geant4_lib_use_suffix}
573   Geant4::G4particles${_geant4_lib_use_suffix} << 578   G4particles${_geant4_lib_use_suffix}
574   Geant4::G4geometry${_geant4_lib_use_suffix}  << 579   G4geometry${_geant4_lib_use_suffix}
575   Geant4::G4materials${_geant4_lib_use_suffix} << 580   G4materials${_geant4_lib_use_suffix}
576   Geant4::G4graphics_reps${_geant4_lib_use_suf << 581   G4graphics_reps${_geant4_lib_use_suffix}
577   Geant4::G4intercoms${_geant4_lib_use_suffix} << 582   G4intercoms${_geant4_lib_use_suffix}
578   Geant4::G4global${_geant4_lib_use_suffix}    << 583   G4global${_geant4_lib_use_suffix}
579   # G4tools is INTERFACE, so same for both sta << 
580   Geant4::G4tools                              << 
581   )                                               584   )
582                                                   585 
583 # - Any externals built by Geant4                 586 # - Any externals built by Geant4
584 foreach(_extlib @GEANT4_EXTERNALS_TARGETS@)       587 foreach(_extlib @GEANT4_EXTERNALS_TARGETS@)
585   list(APPEND                                     588   list(APPEND
586     _geant4_internal_libraries                    589     _geant4_internal_libraries
587     Geant4::${_extlib}${_geant4_lib_use_suffix << 590     ${_extlib}${_geant4_lib_use_suffix}
588     )                                             591     )
589 endforeach()                                      592 endforeach()
590                                                   593 
591 # - Now set them to Geant4_LIBRARIES              594 # - Now set them to Geant4_LIBRARIES
592 set(Geant4_LIBRARIES ${_geant4_internal_librar    595 set(Geant4_LIBRARIES ${_geant4_internal_libraries})
593                                                   596 
594 #---------------------------------------------    597 #-----------------------------------------------------------------------
595 # Remove any duplicates from the Geant4_{INCLU << 598 # Remove any duplicates from the Geant4_{DEFINITIONS,INCLUDE_DIRS,LIBRARIES}
596 # variables so that multiple passes append thi    599 # variables so that multiple passes append things correctly
597 #                                                 600 #
598 if(Geant4_INCLUDE_DIRS)                        << 601 list(REMOVE_DUPLICATES Geant4_DEFINITIONS)
599   list(REMOVE_DUPLICATES Geant4_INCLUDE_DIRS)  << 602 list(REMOVE_DUPLICATES Geant4_INCLUDE_DIRS)
600 endif()                                        << 603 list(REMOVE_DUPLICATES Geant4_LIBRARIES)
601                                                << 
602 if(Geant4_LIBRARIES)                           << 
603   list(REMOVE_DUPLICATES Geant4_LIBRARIES)     << 
604 endif()                                        << 
605                                                   604 
606 #---------------------------------------------    605 #-----------------------------------------------------------------------
607 # Point the user to the UseGeant4.cmake file w    606 # Point the user to the UseGeant4.cmake file which they may wish to include
608 # to help them with setting up Geant4             607 # to help them with setting up Geant4
609 #                                                 608 #
610 set(Geant4_USE_FILE "${_geant4_thisdir}/UseGea << 609 set(Geant4_USE_FILE ${_thisdir}/UseGeant4.cmake)
611                                                   610 
612 #---------------------------------------------    611 #-----------------------------------------------------------------------
613 # Pop our custom module path from the CMake on << 612 # Finally, handle any remaining components.
614 list(REMOVE_AT CMAKE_MODULE_PATH 0)            << 613 # We should have dealt with all available components above, except for
                                                   >> 614 # ui_all and vis_all, and removed them from the list of FIND_COMPONENTS
                                                   >> 615 # so any left  we either didn't find or don't know about. Emit a warning
                                                   >> 616 # if REQUIRED isn't set, or FATAL_ERROR otherwise
                                                   >> 617 #
                                                   >> 618 list(REMOVE_DUPLICATES Geant4_FIND_COMPONENTS)
                                                   >> 619 list(REMOVE_ITEM Geant4_FIND_COMPONENTS ui_all vis_all)
615                                                   620 
616 #--------------------------------------------- << 621 foreach(_remaining ${Geant4_FIND_COMPONENTS})
617 # Check FOUNDness of required components.      << 622   if(Geant4_FIND_REQUIRED)
618 foreach(_comp ${Geant4_FIND_COMPONENTS})       << 623     message(FATAL_ERROR "Geant4 component ${_remaining} not found")
619   if(NOT Geant4_${_comp}_FOUND)                << 624   elseif(NOT Geant4_FIND_QUIETLY)
620     if(Geant4_FIND_REQUIRED_${_comp})          << 625     message(WARNING " Geant4 component ${_remaining} not found")
621       message(WARNING "Geant4 required compone << 
622       set(Geant4_FOUND FALSE)                  << 
623     endif()                                    << 
624   endif()                                         626   endif()
                                                   >> 627   unset(Geant4_FIND_REQUIRED_${_remaining})
625 endforeach()                                      628 endforeach()
626                                                   629 
627 #--------------------------------------------- << 630 # And we should be done...
628 # Reporting via FindPackageHandleStandardArgs  << 631 
629 include(FindPackageHandleStandardArgs)         << 
630 set(${CMAKE_FIND_PACKAGE_NAME}_CONFIG "${CMAKE << 
631 find_package_handle_standard_args(@PROJECT_NAM <<