Select Git revision
CMakeLists.txt
Forked from
LHCb / Geant4
337 commits behind the upstream repository.
Marco Clemencic authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
CMakeLists.txt 1.14 KiB
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
set(Geant4_version 4.9.5.p02)
if(DEFINED ENV{G4_NATIVE_VERSION})
# Override the version of Geant4 from the variable
set(Geant4_version $ENV{G4_NATIVE_VERSION})
if(NOT Geant4_version MATCHES "^4\\.")
# G4_NATIVE_VERSION might not contain the initial '4.' that we need
# see https://its.cern.ch/jira/browse/LHCBGAUSS-43
set(Geant4_version 4.${Geant4_version})
endif()
endif()
find_package(GaudiProject)
gaudi_project(Geant4 v95r2p7g2)
file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX})
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../include ${CMAKE_INSTALL_PREFIX}/include)
# FIXME: hack for compatibility with CMT build
file(WRITE ${CMAKE_BINARY_DIR}/dummy.cpp "")
link_directories(${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-as-needed")
macro(back_comp_lib name)
add_library(${name} SHARED ${CMAKE_BINARY_DIR}/dummy.cpp)
add_dependencies(${name} Geant4)
target_link_libraries(${name} ${ARGN})
install(TARGETS ${name} DESTINATION lib)
endmacro()
back_comp_lib(G4processeshad G4processes)
back_comp_lib(G4externals G4zlib G4gl2ps)