Geant4 Cross Reference (Editor's cut)

Cross-Referencing   Geant4
Geant4/externals/CMakeLists.txt

Version: [ ReleaseNotes ] [ 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 ]

  1 # - Build of external packages, if required
  2 
  3 if(NOT GEANT4_USE_SYSTEM_CLHEP)
  4   add_subdirectory(clhep)
  5 endif()
  6 
  7 if(NOT GEANT4_USE_SYSTEM_EXPAT)
  8   add_subdirectory(expat)
  9 endif()
 10 
 11 if(NOT GEANT4_USE_SYSTEM_ZLIB)
 12   add_subdirectory(zlib)
 13 endif()
 14 
 15 add_subdirectory(g4tools)
 16 
 17 if(NOT GEANT4_USE_SYSTEM_PTL)
 18   # We reuse PTL as a true subproject, configure settings before recursion
 19   set(PTL_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
 20   set(PTL_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/PTL)
 21   set(PTL_INSTALL_HEADERS ON)
 22   set(PTL_INSTALL_CONFIG ON)
 23   set(PTL_USE_TBB ${GEANT4_USE_TBB})
 24   set(PTL_USE_LOCKS ${GEANT4_USE_PTL_LOCKS})
 25 
 26   if(GEANT4_BUILD_SANITIZER AND NOT (GEANT4_BUILD_SANITIZER STREQUAL "none"))
 27     set(PTL_USE_SANITIZER ON)
 28     set(PTL_SANITIZER_TYPE ${GEANT4_BUILD_SANITIZER})
 29   endif()
 30 
 31   add_subdirectory(ptl)
 32 
 33   # Ensure include path is available from build dir in scripts
 34   set_property(GLOBAL APPEND PROPERTY GEANT4_BUILDTREE_INCLUDE_DIRS 
 35     ${CMAKE_CURRENT_SOURCE_DIR}/ptl/include)
 36 
 37   # Adapt targets to G4 naming scheme, whether
 38   if(TARGET ptl-shared)
 39     add_library(G4ptl INTERFACE)
 40     target_link_libraries(G4ptl INTERFACE PTL::ptl-shared)
 41     install(TARGETS G4ptl
 42       EXPORT Geant4LibraryDepends
 43       RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime
 44       LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
 45       ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
 46       INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
 47     add_library(Geant4::G4ptl ALIAS G4ptl)
 48   endif()
 49 
 50   if(TARGET ptl-static)
 51     add_library(G4ptl-static INTERFACE)
 52     target_link_libraries(G4ptl-static INTERFACE PTL::ptl-static)
 53     install(TARGETS G4ptl-static
 54       EXPORT Geant4LibraryDepends
 55       RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime
 56       LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
 57       ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
 58       INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
 59     add_library(Geant4::G4ptl-static ALIAS G4ptl-static)
 60   endif()
 61 
 62   geant4_add_external_category(G4ptl)
 63 endif()