Files
geant4/examples/extended/persistency/CMakeLists.txt
T
2020-12-04 12:30:43 +01:00

43 lines
1.2 KiB
CMake

#---Adding all persistency examples subdirectories explicitly
cmake_minimum_required(VERSION 3.8...3.18)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()
find_package(Geant4)
include(${Geant4_USE_FILE})
#----------------------------------------------------------------------------
# P01, P02 examples require ROOT, GCCXML, BUILD_SHARED_LIBS
#
find_package(ROOT QUIET)
if(ROOT_FOUND AND Geant4_shared_FOUND)
#if(ROOT_FOUND AND GCCXML)
STRING(REGEX MATCH "6.*" VERSION6MATCH ${ROOT_VERSION})
if(NOT VERSION6MATCH)
message("-- G4 Examples : This example requires root6, disabled")
return()
else()
add_subdirectory(P01)
add_subdirectory(P02)
endif()
else()
if(NOT ROOT_FOUND)
message(STATUS "G4 Examples: ROOT package not found. ")
endif()
if(NOT Geant4_shared_FOUND)
message(STATUS "G4 Examples: Shared Libraires not available.")
endif()
message(STATUS "P01, P02 disabled")
endif()
#----------------------------------------------------------------------------
# gdml examples require Geant4 build with gdml
#
if(Geant4_gdml_FOUND)
add_subdirectory(gdml)
else()
message(STATUS "G4 Examples: GDML not installed --> gdml examples disabled")
endif()