Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/cmake/Modules/G4ConfigurePkgConfigHelpers.cmake

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/Modules/G4ConfigurePkgConfigHelpers.cmake (Version 11.3.0) and /cmake/Modules/G4ConfigurePkgConfigHelpers.cmake (Version 10.7.p4)


  1 #.rst:                                              1 #.rst:
  2 # G4ConfigurePkgConfigHelpers                       2 # G4ConfigurePkgConfigHelpers
  3 # ---------------------------                       3 # ---------------------------
  4 #                                                   4 #
  5 # This module configures and installs pkg-conf      5 # This module configures and installs pkg-config scripts and the
  6 # geant4-config program to help clients compil      6 # geant4-config program to help clients compile and link against
  7 # the Geant4 libraries.                             7 # the Geant4 libraries.
  8 #                                                   8 #
  9 # The geant4-config script provides an sh base      9 # The geant4-config script provides an sh based interface to provide
 10 # information on the Geant4 installation, incl     10 # information on the Geant4 installation, including installation prefix,
 11 # version number, compiler and linker flags.       11 # version number, compiler and linker flags.
 12 #                                                  12 #
 13 # The script is generated from a template file     13 # The script is generated from a template file and then installed to the
 14 # known bindir as an executable.                   14 # known bindir as an executable.
 15 #                                                  15 #
 16 # Paths are always hardcoded in the build tree     16 # Paths are always hardcoded in the build tree version as this is never
 17 # intended to be relocatable.                      17 # intended to be relocatable.
 18 # The Install Tree script uses self-location b     18 # The Install Tree script uses self-location based on that in
 19 # {root,clhep}-config is the install itself is     19 # {root,clhep}-config is the install itself is relocatable, otherwise
 20 # absolute paths are encoded.                      20 # absolute paths are encoded.
 21 #                                                  21 #
 22 #                                                  22 #
 23                                                    23 
 24 #---------------------------------------------     24 #-----------------------------------------------------------------
 25 # License and Disclaimer                           25 # License and Disclaimer
 26 #                                                  26 #
 27 # The  Geant4 software  is  copyright of the C     27 # The  Geant4 software  is  copyright of the Copyright Holders  of
 28 # the Geant4 Collaboration.  It is provided  u     28 # the Geant4 Collaboration.  It is provided  under  the terms  and
 29 # conditions of the Geant4 Software License,       29 # conditions of the Geant4 Software License,  included in the file
 30 # LICENSE and available at  http://cern.ch/gea     30 # LICENSE and available at  http://cern.ch/geant4/license .  These
 31 # include a list of copyright holders.             31 # include a list of copyright holders.
 32 #                                                  32 #
 33 # Neither the authors of this software system,     33 # Neither the authors of this software system, nor their employing
 34 # institutes,nor the agencies providing financ     34 # institutes,nor the agencies providing financial support for this
 35 # work  make  any representation or  warranty,     35 # work  make  any representation or  warranty, express or implied,
 36 # regarding  this  software system or assume a     36 # regarding  this  software system or assume any liability for its
 37 # use.  Please see the license in the file  LI     37 # use.  Please see the license in the file  LICENSE  and URL above
 38 # for the full disclaimer and the limitation o     38 # for the full disclaimer and the limitation of liability.
 39 #                                                  39 #
 40 # This  code  implementation is the result of      40 # This  code  implementation is the result of  the  scientific and
 41 # technical work of the GEANT4 collaboration.      41 # technical work of the GEANT4 collaboration.
 42 # By using,  copying,  modifying or  distribut     42 # By using,  copying,  modifying or  distributing the software (or
 43 # any work based  on the software)  you  agree     43 # any work based  on the software)  you  agree  to acknowledge its
 44 # use  in  resulting  scientific  publications     44 # use  in  resulting  scientific  publications,  and indicate your
 45 # acceptance of all terms of the Geant4 Softwa     45 # acceptance of all terms of the Geant4 Software license.
 46 #                                                  46 #
 47 #---------------------------------------------     47 #-----------------------------------------------------------------
 48                                                    48 
 49                                                    49 
 50 #---------------------------------------------     50 #-----------------------------------------------------------------------
 51 # function get_system_include_dirs                 51 # function get_system_include_dirs
 52 #          return list of directories our C++      52 #          return list of directories our C++ compiler searches
 53 #          by default.                             53 #          by default.
 54 #                                                  54 #
 55 #          The idea comes from CMake's inbuilt     55 #          The idea comes from CMake's inbuilt technique to do this
 56 #          for the Eclipse and CodeBlocks gene     56 #          for the Eclipse and CodeBlocks generators, but we implement
 57 #          our own function because the CMake      57 #          our own function because the CMake functionality is internal
 58 #          so we can't rely on it.                 58 #          so we can't rely on it.
 59 function(get_system_include_dirs _dirs)            59 function(get_system_include_dirs _dirs)
 60   # Only for GCC, Clang and Intel                  60   # Only for GCC, Clang and Intel
 61   if("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR     61   if("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Clang OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel)
 62     # Proceed                                      62     # Proceed
 63     file(WRITE "${PROJECT_BINARY_DIR}/CMakeFil <<  63     file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/g4dummy" "\n")
 64                                                    64 
 65     # Save locale, them to "C" english locale      65     # Save locale, them to "C" english locale so we can parse in English
 66     set(_orig_lc_all      $ENV{LC_ALL})            66     set(_orig_lc_all      $ENV{LC_ALL})
 67     set(_orig_lc_messages $ENV{LC_MESSAGES})       67     set(_orig_lc_messages $ENV{LC_MESSAGES})
 68     set(_orig_lang        $ENV{LANG})              68     set(_orig_lang        $ENV{LANG})
 69                                                    69 
 70     set(ENV{LC_ALL}      C)                        70     set(ENV{LC_ALL}      C)
 71     set(ENV{LC_MESSAGES} C)                        71     set(ENV{LC_MESSAGES} C)
 72     set(ENV{LANG}        C)                        72     set(ENV{LANG}        C)
 73                                                    73 
 74     execute_process(COMMAND ${CMAKE_CXX_COMPIL     74     execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -v -E -x c++ -dD g4dummy
 75       WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/ <<  75       WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
 76       ERROR_VARIABLE _cxxOutput                    76       ERROR_VARIABLE _cxxOutput
 77       OUTPUT_VARIABLE _cxxStdout                   77       OUTPUT_VARIABLE _cxxStdout
 78       )                                            78       )
 79                                                    79 
 80     file(REMOVE "${PROJECT_BINARY_DIR}/CMakeFi <<  80     file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/g4dummy")
 81                                                    81 
 82     # Parse and extract search dirs                82     # Parse and extract search dirs
 83     set(_resultIncludeDirs )                       83     set(_resultIncludeDirs )
 84     if( "${_cxxOutput}" MATCHES "> search star     84     if( "${_cxxOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
 85       string(REGEX MATCHALL "[^\n]+\n" _includ     85       string(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
 86       foreach(nextLine ${_includeLines})           86       foreach(nextLine ${_includeLines})
 87         string(REGEX REPLACE "\\(framework dir     87         string(REGEX REPLACE "\\(framework directory\\)" "" nextLineNoFramework "${nextLine}")
 88         string(STRIP "${nextLineNoFramework}"      88         string(STRIP "${nextLineNoFramework}" _includePath)
 89         list(APPEND _resultIncludeDirs "${_inc     89         list(APPEND _resultIncludeDirs "${_includePath}")
 90       endforeach()                                 90       endforeach()
 91     endif()                                        91     endif()
 92                                                    92 
 93     # Restore original locale                      93     # Restore original locale
 94     set(ENV{LC_ALL}      ${_orig_lc_all})          94     set(ENV{LC_ALL}      ${_orig_lc_all})
 95     set(ENV{LC_MESSAGES} ${_orig_lc_messages})     95     set(ENV{LC_MESSAGES} ${_orig_lc_messages})
 96     set(ENV{LANG}        ${_orig_lang})            96     set(ENV{LANG}        ${_orig_lang})
 97                                                    97 
 98     set(${_dirs} ${_resultIncludeDirs} PARENT_     98     set(${_dirs} ${_resultIncludeDirs} PARENT_SCOPE)
 99   else()                                           99   else()
100     set(${_dirs} "" PARENT_SCOPE)                 100     set(${_dirs} "" PARENT_SCOPE)
101   endif()                                         101   endif()
102 endfunction()                                     102 endfunction()
103                                                   103 
104 #---------------------------------------------    104 #-----------------------------------------------------------------------
105 # Only create script if we have a global libra    105 # Only create script if we have a global library build...
106 #                                                 106 #
107 #if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX)   << 107 if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX)
108 if(NOT GEANT4_BUILD_GRANULAR_LIBS)             << 
109   # Get implicit search paths                     108   # Get implicit search paths
110   get_system_include_dirs(_cxx_compiler_dirs)     109   get_system_include_dirs(_cxx_compiler_dirs)
111                                                   110 
112   # Setup variables needed for expansion in co    111   # Setup variables needed for expansion in configuration file
113   # - C++ Filesystem, if needed                << 
114   if(GEANT4_CXX_FILESYSTEM_LIBRARY)            << 
115     set(G4_LINK_CXX_FILESYSTEM "-l${GEANT4_CXX << 
116   endif()                                      << 
117                                                << 
118   # - Static libs                                 112   # - Static libs
119   if(BUILD_STATIC_LIBS)                           113   if(BUILD_STATIC_LIBS)
120     set(G4_BUILTWITH_STATICLIBS "yes")            114     set(G4_BUILTWITH_STATICLIBS "yes")
121   else()                                          115   else()
122     set(G4_BUILTWITH_STATICLIBS "no")             116     set(G4_BUILTWITH_STATICLIBS "no")
123   endif()                                         117   endif()
124                                                   118 
125   # - Multithreading                              119   # - Multithreading
126   if(GEANT4_BUILD_MULTITHREADED)                  120   if(GEANT4_BUILD_MULTITHREADED)
127     set(G4_BUILTWITH_MULTITHREADING "yes")        121     set(G4_BUILTWITH_MULTITHREADING "yes")
128   else()                                          122   else()
129     set(G4_BUILTWITH_MULTITHREADING "no")         123     set(G4_BUILTWITH_MULTITHREADING "no")
130   endif()                                         124   endif()
131                                                   125 
132   # - PHP_AS_HP                                   126   # - PHP_AS_HP
133   if(GEANT4_BUILD_PHP_AS_HP)                      127   if(GEANT4_BUILD_PHP_AS_HP)
134     set(G4_BUILTWITH_PHP_AS_HP "yes")             128     set(G4_BUILTWITH_PHP_AS_HP "yes")
135   else()                                          129   else()
136     set(G4_BUILTWITH_PHP_AS_HP "no")              130     set(G4_BUILTWITH_PHP_AS_HP "no")
137   endif()                                         131   endif()
138                                                   132 
139   # - Smart Stack                                 133   # - Smart Stack
140   if(GEANT4_USE_SMARTSTACK)                       134   if(GEANT4_USE_SMARTSTACK)
141     set(G4_BUILTWITH_SMARTSTACK "yes")            135     set(G4_BUILTWITH_SMARTSTACK "yes")
142   else()                                          136   else()
143     set(G4_BUILTWITH_SMARTSTACK "no")             137     set(G4_BUILTWITH_SMARTSTACK "no")
144   endif()                                         138   endif()
145                                                   139 
146   # - CLHEP                                       140   # - CLHEP
147   if(GEANT4_USE_SYSTEM_CLHEP)                     141   if(GEANT4_USE_SYSTEM_CLHEP)
148     set(G4_BUILTWITH_CLHEP "no")                  142     set(G4_BUILTWITH_CLHEP "no")
149     #inc path                                     143     #inc path
150     get_filename_component(G4_SYSTEM_CLHEP_INC    144     get_filename_component(G4_SYSTEM_CLHEP_INCLUDE_DIR "${CLHEP_INCLUDE_DIR}" ABSOLUTE)
151                                                   145 
152     #libpath                                      146     #libpath
153     list(GET CLHEP_LIBRARIES 0 _zeroth_clhep_l    147     list(GET CLHEP_LIBRARIES 0 _zeroth_clhep_lib)
154     get_target_property(_system_clhep_libdir "    148     get_target_property(_system_clhep_libdir "${_zeroth_clhep_lib}" LOCATION)
155     get_filename_component(_system_clhep_libdi    149     get_filename_component(_system_clhep_libdir "${_system_clhep_libdir}" REALPATH)
156     get_filename_component(_system_clhep_libdi    150     get_filename_component(_system_clhep_libdir "${_system_clhep_libdir}" DIRECTORY)
157     set(G4_SYSTEM_CLHEP_LIBRARIES "-L${_system    151     set(G4_SYSTEM_CLHEP_LIBRARIES "-L${_system_clhep_libdir}")
158                                                   152 
159     foreach(_clhep_lib ${CLHEP_LIBRARIES})        153     foreach(_clhep_lib ${CLHEP_LIBRARIES})
160       get_target_property(_curlib "${_clhep_li    154       get_target_property(_curlib "${_clhep_lib}" LOCATION)
161       get_filename_component(_curlib "${_curli    155       get_filename_component(_curlib "${_curlib}" NAME)
162       string(REGEX REPLACE "^lib(.*)\\.(so|a|d    156       string(REGEX REPLACE "^lib(.*)\\.(so|a|dylib|lib|dll)$" "\\1" _curlib "${_curlib}")
163       set(G4_SYSTEM_CLHEP_LIBRARIES "${G4_SYST    157       set(G4_SYSTEM_CLHEP_LIBRARIES "${G4_SYSTEM_CLHEP_LIBRARIES} -l${_curlib}")
164     endforeach()                                  158     endforeach()
165   else()                                          159   else()
166     set(G4_BUILTWITH_CLHEP "yes")                 160     set(G4_BUILTWITH_CLHEP "yes")
167   endif()                                         161   endif()
168                                                   162 
169   # - EXPAT                                       163   # - EXPAT
170   if(GEANT4_USE_SYSTEM_EXPAT)                     164   if(GEANT4_USE_SYSTEM_EXPAT)
171     set(G4_BUILTWITH_EXPAT "no")                  165     set(G4_BUILTWITH_EXPAT "no")
172   else()                                          166   else()
173     set(G4_BUILTWITH_EXPAT "yes")                 167     set(G4_BUILTWITH_EXPAT "yes")
174   endif()                                         168   endif()
175                                                   169 
176   # - ZLIB                                        170   # - ZLIB
177   if(GEANT4_USE_SYSTEM_ZLIB)                      171   if(GEANT4_USE_SYSTEM_ZLIB)
178     set(G4_BUILTWITH_ZLIB "no")                   172     set(G4_BUILTWITH_ZLIB "no")
179   else()                                          173   else()
180     set(G4_BUILTWITH_ZLIB "yes")                  174     set(G4_BUILTWITH_ZLIB "yes")
181   endif()                                         175   endif()
182                                                   176 
183   # - PTL                                         177   # - PTL
184   if(GEANT4_USE_SYSTEM_PTL)                       178   if(GEANT4_USE_SYSTEM_PTL)
185     set(G4_BUILTWITH_PTL "no")                    179     set(G4_BUILTWITH_PTL "no")
186   else()                                          180   else()
187     set(G4_BUILTWITH_PTL "yes")                   181     set(G4_BUILTWITH_PTL "yes")
188   endif()                                         182   endif()
189                                                   183 
190   # - GDML                                        184   # - GDML
191   if(GEANT4_USE_GDML)                             185   if(GEANT4_USE_GDML)
192     set(G4_BUILTWITH_GDML "yes")                  186     set(G4_BUILTWITH_GDML "yes")
193     set(G4_XERCESC_INCLUDE_DIRS ${XercesC_INCL    187     set(G4_XERCESC_INCLUDE_DIRS ${XercesC_INCLUDE_DIR})
194     list(REMOVE_DUPLICATES G4_XERCESC_INCLUDE_    188     list(REMOVE_DUPLICATES G4_XERCESC_INCLUDE_DIRS)
195     if(_cxx_compiler_dirs)                        189     if(_cxx_compiler_dirs)
196       list(REMOVE_ITEM G4_XERCESC_INCLUDE_DIRS    190       list(REMOVE_ITEM G4_XERCESC_INCLUDE_DIRS ${_cxx_compiler_dirs})
197     endif()                                       191     endif()
198                                                   192 
199     set(G4_XERCESC_CFLAGS )                       193     set(G4_XERCESC_CFLAGS )
200     foreach(_dir ${G4_XERCESC_INCLUDE_DIRS})      194     foreach(_dir ${G4_XERCESC_INCLUDE_DIRS})
201       set(G4_XERCESC_CFLAGS "${G4_XERCESC_CFLA    195       set(G4_XERCESC_CFLAGS "${G4_XERCESC_CFLAGS} -I${_dir}")
202     endforeach()                                  196     endforeach()
203   else()                                          197   else()
204     set(G4_BUILTWITH_GDML "no")                   198     set(G4_BUILTWITH_GDML "no")
205   endif()                                         199   endif()
206                                                   200 
207   # - G3ToG4                                      201   # - G3ToG4
208   if(GEANT4_USE_G3TOG4)                           202   if(GEANT4_USE_G3TOG4)
209     set(G4_BUILTWITH_G3TOG4 "yes")                203     set(G4_BUILTWITH_G3TOG4 "yes")
210   else()                                          204   else()
211     set(G4_BUILTWITH_G3TOG4 "no")                 205     set(G4_BUILTWITH_G3TOG4 "no")
212   endif()                                         206   endif()
213                                                   207 
214   # - USolids                                     208   # - USolids
215   if(GEANT4_USE_USOLIDS OR GEANT4_USE_PARTIAL_    209   if(GEANT4_USE_USOLIDS OR GEANT4_USE_PARTIAL_USOLIDS)
216     set(G4_BUILTWITH_USOLIDS "yes")               210     set(G4_BUILTWITH_USOLIDS "yes")
217     get_target_property(G4_USOLIDS_INCLUDE_DIR    211     get_target_property(G4_USOLIDS_INCLUDE_DIRS VecGeom::vecgeom INTERFACE_INCLUDE_DIRECTORIES)
218     list(REMOVE_DUPLICATES G4_USOLIDS_INCLUDE_    212     list(REMOVE_DUPLICATES G4_USOLIDS_INCLUDE_DIRS)
219     foreach(_dir ${G4_USOLIDS_INCLUDE_DIRS})      213     foreach(_dir ${G4_USOLIDS_INCLUDE_DIRS})
220       set(G4_USOLIDS_CFLAGS "${G4_USOLIDS_CFLA    214       set(G4_USOLIDS_CFLAGS "${G4_USOLIDS_CFLAGS} -I${_dir}")
221     endforeach()                                  215     endforeach()
222     # NB: should ALSO account for VecGeom havi    216     # NB: should ALSO account for VecGeom having compile_options, but
223     # this is better handled through proper pk    217     # this is better handled through proper pkg-config support
224   else()                                          218   else()
225     set(G4_BUILTWITH_USOLIDS "no")                219     set(G4_BUILTWITH_USOLIDS "no")
226   endif()                                         220   endif()
227                                                   221 
228   # - Freetype                                    222   # - Freetype
229   if(GEANT4_USE_FREETYPE)                         223   if(GEANT4_USE_FREETYPE)
230     set(G4_BUILTWITH_FREETYPE "yes")              224     set(G4_BUILTWITH_FREETYPE "yes")
231   else()                                          225   else()
232     set(G4_BUILTWITH_FREETYPE "no")               226     set(G4_BUILTWITH_FREETYPE "no")
233   endif()                                         227   endif()
234                                                   228 
235   # - HDF5                                        229   # - HDF5
236   if(GEANT4_USE_HDF5)                             230   if(GEANT4_USE_HDF5)
237     set(G4_BUILTWITH_HDF5 "yes")                  231     set(G4_BUILTWITH_HDF5 "yes")
238   else()                                          232   else()
239     set(G4_BUILTWITH_HDF5 "no")                   233     set(G4_BUILTWITH_HDF5 "no")
240   endif()                                         234   endif()
241                                                   235 
242   # - Qt                                          236   # - Qt
243   if(GEANT4_USE_QT)                               237   if(GEANT4_USE_QT)
244     set(G4_BUILTWITH_QT "yes")                    238     set(G4_BUILTWITH_QT "yes")
245     set(_qtcomps Core Gui Widgets OpenGL)      << 239     set(G4_QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS} ${Qt53DCore_INCLUDE_DIRS} ${Qt53DExtras_INCLUDE_DIRS} ${Qt53DRender_INCLUDE_DIRS})
246     if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL  << 
247       list(APPEND _qtcomp 3DCore 3DExtras 3DRe << 
248     endif()                                    << 
249                                                << 
250     set(G4_QT_INCLUDE_DIRS )                   << 
251     foreach(_qtc ${_qtcomps})                  << 
252       list(APPEND G4_QT_INCLUDE_DIRS ${Qt${QT_ << 
253     endforeach()                               << 
254                                                   240 
255     list(REMOVE_DUPLICATES G4_QT_INCLUDE_DIRS)    241     list(REMOVE_DUPLICATES G4_QT_INCLUDE_DIRS)
256     if(_cxx_compiler_dirs)                        242     if(_cxx_compiler_dirs)
257       list(REMOVE_ITEM G4_QT_INCLUDE_DIRS ${_c    243       list(REMOVE_ITEM G4_QT_INCLUDE_DIRS ${_cxx_compiler_dirs})
258     endif()                                       244     endif()
259                                                   245 
260     set(G4_QT_CFLAGS )                            246     set(G4_QT_CFLAGS )
261     foreach(_dir ${G4_QT_INCLUDE_DIRS})           247     foreach(_dir ${G4_QT_INCLUDE_DIRS})
262       set(G4_QT_CFLAGS "${G4_QT_CFLAGS} -I${_d    248       set(G4_QT_CFLAGS "${G4_QT_CFLAGS} -I${_dir}")
263     endforeach()                                  249     endforeach()
264                                                   250 
265     if(APPLE AND G4_QT_CFLAGS MATCHES "QtCore\ << 
266       set(G4_QT_CFLAGS "${G4_QT_CFLAGS} -F${G4 << 
267     endif()                                    << 
268   else()                                          251   else()
269     set(G4_BUILTWITH_QT "no")                     252     set(G4_BUILTWITH_QT "no")
270   endif()                                         253   endif()
271                                                   254 
272   # - QT3D                                     << 255   # - Wt
273   if(GEANT4_USE_QT3D)                          << 256   #if(GEANT4_USE_WT)
274     set(G4_BUILTWITH_QT3D "yes")               << 257   #  set(G4_BUILTWITH_WT "yes")
275   else()                                       << 258   #  set(G4_WT_INCLUDE_DIRS ${Wt_INCLUDE_DIR} ${Boost_INCLUDE_DIR} )
276     set(G4_BUILTWITH_QT3D "no")                << 259 
277   endif()                                      << 260   #  set(G4_WT_CFLAGS )
                                                   >> 261   #  foreach(_dir ${G4_WT_INCLUDE_DIRS})
                                                   >> 262   #    set(G4_WT_CFLAGS "${G4_WT_CFLAGS} -I${_dir}")
                                                   >> 263   #  endforeach()
                                                   >> 264 
                                                   >> 265   #else()
                                                   >> 266   #  set(G4_BUILTWITH_WT "no")
                                                   >> 267   #endif()
278                                                   268 
279   # - Motif                                       269   # - Motif
280   if(GEANT4_USE_XM)                               270   if(GEANT4_USE_XM)
281     set(G4_BUILTWITH_MOTIF "yes")                 271     set(G4_BUILTWITH_MOTIF "yes")
282     set(G4_CONFIG_NEEDS_X11 TRUE)                 272     set(G4_CONFIG_NEEDS_X11 TRUE)
283   else()                                          273   else()
284     set(G4_BUILTWITH_MOTIF "no")                  274     set(G4_BUILTWITH_MOTIF "no")
285   endif()                                         275   endif()
286                                                   276 
287   # - RayTracerX                                  277   # - RayTracerX
288   if(GEANT4_USE_RAYTRACER_X11)                    278   if(GEANT4_USE_RAYTRACER_X11)
289     set(G4_BUILTWITH_RAYTRACERX11 "yes")          279     set(G4_BUILTWITH_RAYTRACERX11 "yes")
290     set(G4_CONFIG_NEEDS_X11 TRUE)                 280     set(G4_CONFIG_NEEDS_X11 TRUE)
291   else()                                          281   else()
292     set(G4_BUILTWITH_RAYTRACERX11 "no")           282     set(G4_BUILTWITH_RAYTRACERX11 "no")
293   endif()                                         283   endif()
294                                                   284 
295   # - OpenGL X11                                  285   # - OpenGL X11
296   if(GEANT4_USE_OPENGL_X11)                       286   if(GEANT4_USE_OPENGL_X11)
297     set(G4_BUILTWITH_OPENGLX11 "yes")             287     set(G4_BUILTWITH_OPENGLX11 "yes")
298     set(G4_CONFIG_NEEDS_X11 TRUE)                 288     set(G4_CONFIG_NEEDS_X11 TRUE)
299   else()                                          289   else()
300     set(G4_BUILTWITH_OPENGLX11 "no")              290     set(G4_BUILTWITH_OPENGLX11 "no")
301   endif()                                         291   endif()
302                                                   292 
303   # - OpenInventor                                293   # - OpenInventor
304   if(GEANT4_USE_INVENTOR)                         294   if(GEANT4_USE_INVENTOR)
305     set(G4_BUILTWITH_INVENTOR "yes")              295     set(G4_BUILTWITH_INVENTOR "yes")
306   else()                                          296   else()
307     set(G4_BUILTWITH_INVENTOR "no")               297     set(G4_BUILTWITH_INVENTOR "no")
308   endif()                                         298   endif()
309                                                   299 
310   # - VTK                                      << 
311   if(GEANT4_USE_VTK)                           << 
312     set(G4_BUILTWITH_VTK "yes")                << 
313   else()                                       << 
314     set(G4_BUILTWITH_VTK "no")                 << 
315   endif()                                      << 
316                                                << 
317   # If we have a module that uses X11, We have    300   # If we have a module that uses X11, We have to play with the X11
318   # paths to get a clean set suitable for incl    301   # paths to get a clean set suitable for inclusion
319   if(G4_CONFIG_NEEDS_X11)                         302   if(G4_CONFIG_NEEDS_X11)
320     set(_raw_x11_includes ${X11_INCLUDE_DIR})     303     set(_raw_x11_includes ${X11_INCLUDE_DIR})
321     list(REMOVE_DUPLICATES _raw_x11_includes)     304     list(REMOVE_DUPLICATES _raw_x11_includes)
322     if(_cxx_compiler_dirs)                        305     if(_cxx_compiler_dirs)
323       list(REMOVE_ITEM _raw_x11_includes ${_cx    306       list(REMOVE_ITEM _raw_x11_includes ${_cxx_compiler_dirs})
324     endif()                                       307     endif()
325     set(G4_X11_CFLAGS )                           308     set(G4_X11_CFLAGS )
326     foreach(_p ${_raw_x11_includes})              309     foreach(_p ${_raw_x11_includes})
327       set(G4_X11_CFLAGS "-I${_p} ${G4_X11_CFLA    310       set(G4_X11_CFLAGS "-I${_p} ${G4_X11_CFLAGS}")
328     endforeach()                                  311     endforeach()
329   endif()                                         312   endif()
330                                                   313 
331   # Configure the script                          314   # Configure the script
332   # - BUILD TREE                                  315   # - BUILD TREE
333   # Ouch, the include path will be LONG, but a    316   # Ouch, the include path will be LONG, but at least we always have
334   # absolute paths...                             317   # absolute paths...
335   set(GEANT4_CONFIG_SELF_LOCATION "# BUILD TRE    318   set(GEANT4_CONFIG_SELF_LOCATION "# BUILD TREE IS NON-RELOCATABLE")
336   set(GEANT4_CONFIG_INSTALL_PREFIX "${PROJECT_    319   set(GEANT4_CONFIG_INSTALL_PREFIX "${PROJECT_BINARY_DIR}")
337   set(GEANT4_CONFIG_INSTALL_EXECPREFIX \"\")      320   set(GEANT4_CONFIG_INSTALL_EXECPREFIX \"\")
338   # NB: this only works for *single* mode gene    321   # NB: this only works for *single* mode generators. With multimode
339   # generators, which mode to use is not clear    322   # generators, which mode to use is not clear...
340   set(GEANT4_CONFIG_LIBDIR ${CMAKE_LIBRARY_OUT    323   set(GEANT4_CONFIG_LIBDIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
341                                                   324 
342   get_property(__geant4_buildtree_include_dirs    325   get_property(__geant4_buildtree_include_dirs GLOBAL PROPERTY
343     GEANT4_BUILDTREE_INCLUDE_DIRS)                326     GEANT4_BUILDTREE_INCLUDE_DIRS)
344                                                   327 
345   foreach(_dir ${__geant4_buildtree_include_di    328   foreach(_dir ${__geant4_buildtree_include_dirs})
346     set(GEANT4_CONFIG_INCLUDE_DIRS "${GEANT4_C    329     set(GEANT4_CONFIG_INCLUDE_DIRS "${GEANT4_CONFIG_INCLUDE_DIRS} \\
347     ${_dir}")                                     330     ${_dir}")
348   endforeach()                                    331   endforeach()
349                                                   332 
350   # - Data                                        333   # - Data
351   geant4_export_datasets(BUILD GEANT4_CONFIG_D    334   geant4_export_datasets(BUILD GEANT4_CONFIG_DATASET_DESCRIPTIONS)
352                                                   335 
353   # Configure the build tree script               336   # Configure the build tree script
354   configure_file(                              << 337   # If we're on CMake 2.8 and above, we try to use file(COPY) to create an
355     ${PROJECT_SOURCE_DIR}/cmake/Templates/gean << 338   # executable script
356     ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTO << 339   # Not sure if version check is o.k., but I'll be shocked if we ever see
357     @ONLY                                      << 340   # a CMake 2.7 in the wild...
358     )                                          << 341   if(${CMAKE_VERSION} VERSION_GREATER 2.7)
                                                   >> 342     configure_file(
                                                   >> 343       ${CMAKE_SOURCE_DIR}/cmake/Templates/geant4-config.in
                                                   >> 344       ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/geant4-config
                                                   >> 345       @ONLY
                                                   >> 346       )
359                                                   347 
360   file(COPY                                    << 348     file(COPY
361     ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTO << 349       ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/geant4-config
362     DESTINATION ${PROJECT_BINARY_DIR}          << 350       DESTINATION ${PROJECT_BINARY_DIR}
363     FILE_PERMISSIONS                           << 351       FILE_PERMISSIONS
364       OWNER_READ OWNER_WRITE OWNER_EXECUTE     << 352         OWNER_READ OWNER_WRITE OWNER_EXECUTE
365       GROUP_READ GROUP_EXECUTE                 << 353         GROUP_READ GROUP_EXECUTE
366       WORLD_READ WORLD_EXECUTE                 << 354         WORLD_READ WORLD_EXECUTE
367     )                                          << 355       )
                                                   >> 356   else()
                                                   >> 357     # Changing permissions is awkward, so just configure and document
                                                   >> 358     # that you have to do 'sh geant4-config' in this case.
                                                   >> 359     configure_file(
                                                   >> 360       ${CMAKE_SOURCE_DIR}/cmake/Templates/geant4-config.in
                                                   >> 361       ${PROJECT_BINARY_DIR}/geant4-config
                                                   >> 362       @ONLY
                                                   >> 363       )
                                                   >> 364   endif()
368                                                   365 
369   # - Install Tree                                366   # - Install Tree
370   # Much easier :-)                               367   # Much easier :-)
371   # Non-Relocatable case...                       368   # Non-Relocatable case...
372   if(CMAKE_INSTALL_IS_NONRELOCATABLE)             369   if(CMAKE_INSTALL_IS_NONRELOCATABLE)
373     # Hardcoded paths                             370     # Hardcoded paths
374     set(GEANT4_CONFIG_INSTALL_PREFIX "${CMAKE_    371     set(GEANT4_CONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
375     set(GEANT4_CONFIG_INSTALL_EXECPREFIX \"\")    372     set(GEANT4_CONFIG_INSTALL_EXECPREFIX \"\")
376     set(GEANT4_CONFIG_LIBDIR "${CMAKE_INSTALL_    373     set(GEANT4_CONFIG_LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
377     set(GEANT4_CONFIG_INCLUDE_DIRS "${CMAKE_IN    374     set(GEANT4_CONFIG_INCLUDE_DIRS "${CMAKE_INSTALL_FULL_INCLUDEDIR}/Geant4")
378   else()                                          375   else()
379     # Calculate base of self contained install    376     # Calculate base of self contained install based on relative path from
380     # CMAKE_INSTALL_FULL_BINDIR to CMAKE_INSTA    377     # CMAKE_INSTALL_FULL_BINDIR to CMAKE_INSTALL_PREFIX.
381     file(RELATIVE_PATH _bin_to_prefix ${CMAKE_    378     file(RELATIVE_PATH _bin_to_prefix ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_PREFIX})
382     # Strip any trailing path separators just     379     # Strip any trailing path separators just for neatness.
383     string(REGEX REPLACE "[/\\]$" "" _bin_to_p    380     string(REGEX REPLACE "[/\\]$" "" _bin_to_prefix "${_bin_to_prefix}")
384                                                   381 
385     set(GEANT4_CONFIG_INSTALL_PREFIX "$scriptl    382     set(GEANT4_CONFIG_INSTALL_PREFIX "$scriptloc/${_bin_to_prefix}")
386     set(GEANT4_CONFIG_INSTALL_EXECPREFIX \"\")    383     set(GEANT4_CONFIG_INSTALL_EXECPREFIX \"\")
387     set(GEANT4_CONFIG_LIBDIR "\${prefix}/${CMA    384     set(GEANT4_CONFIG_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
388     set(GEANT4_CONFIG_INCLUDE_DIRS "\${prefix}    385     set(GEANT4_CONFIG_INCLUDE_DIRS "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}/Geant4")
389   endif()                                         386   endif()
390                                                   387 
391   # - Data                                        388   # - Data
392   geant4_export_datasets(INSTALL GEANT4_CONFIG    389   geant4_export_datasets(INSTALL GEANT4_CONFIG_DATASET_DESCRIPTIONS)
393                                                   390 
394   # Configure the install tree script             391   # Configure the install tree script
395   configure_file(                                 392   configure_file(
396     ${PROJECT_SOURCE_DIR}/cmake/Templates/gean << 393     ${CMAKE_SOURCE_DIR}/cmake/Templates/geant4-config.in
397     ${PROJECT_BINARY_DIR}/InstallTreeFiles/gea    394     ${PROJECT_BINARY_DIR}/InstallTreeFiles/geant4-config
398     @ONLY                                         395     @ONLY
399     )                                             396     )
400                                                   397 
401   # Install it                                    398   # Install it
402   install(FILES ${PROJECT_BINARY_DIR}/InstallT    399   install(FILES ${PROJECT_BINARY_DIR}/InstallTreeFiles/geant4-config
403     DESTINATION ${CMAKE_INSTALL_BINDIR}           400     DESTINATION ${CMAKE_INSTALL_BINDIR}
404     PERMISSIONS                                   401     PERMISSIONS
405       OWNER_READ OWNER_WRITE OWNER_EXECUTE        402       OWNER_READ OWNER_WRITE OWNER_EXECUTE
406       GROUP_READ GROUP_EXECUTE                    403       GROUP_READ GROUP_EXECUTE
407       WORLD_READ WORLD_EXECUTE                    404       WORLD_READ WORLD_EXECUTE
408     COMPONENT Development                         405     COMPONENT Development
409     )                                             406     )
410                                                << 
411   # Win32 helper file geant4-config.cmd        << 
412   if(WIN32)                                    << 
413     # No configuration just a copy             << 
414     configure_file(                            << 
415       ${PROJECT_SOURCE_DIR}/cmake/Templates/ge << 
416       ${PROJECT_BINARY_DIR}/InstallTreeFiles/g << 
417       @ONLY                                    << 
418       )                                        << 
419                                                << 
420     # Install helper                           << 
421     install(FILES ${PROJECT_BINARY_DIR}/Instal << 
422       DESTINATION ${CMAKE_INSTALL_BINDIR}      << 
423       PERMISSIONS                              << 
424         OWNER_READ OWNER_WRITE OWNER_EXECUTE   << 
425         GROUP_READ GROUP_EXECUTE               << 
426         WORLD_READ WORLD_EXECUTE               << 
427       COMPONENT Development                    << 
428       )                                        << 
429 endif()                                        << 
430 endif()                                           407 endif()
                                                   >> 408