Skip to content
Snippets Groups Projects
Commit 98c7dfbd authored by Sandro Christian Wenzel's avatar Sandro Christian Wenzel
Browse files

Merge branch 'swenzel/newfindvecgeom'

parents 24794d1d 2d555af3
No related branches found
No related tags found
No related merge requests found
...@@ -43,12 +43,11 @@ find_package(VecGeom REQUIRED) ...@@ -43,12 +43,11 @@ find_package(VecGeom REQUIRED)
if( VECGEOM_FOUND ) if( VECGEOM_FOUND )
find_package(Vc) find_package(Vc)
if ( VC_FOUND ) if ( VC_FOUND )
include_directories( AFTER SYSTEM ${VC_INCLUDE_DIR}) include_directories( AFTER SYSTEM ${VC_INCLUDE_DIR})
endif() endif()
if( USE_VECGEOM_NAVIGATOR ) if( USE_VECGEOM_NAVIGATOR )
add_definitions( "-DUSE_VECGEOM_NAVIGATOR" ) add_definitions( "-DUSE_VECGEOM_NAVIGATOR" )
endif() endif()
add_definitions( "-DVECGEOM_ROOT" )
include_directories(${VECGEOM_INCLUDE_DIR}) include_directories(${VECGEOM_INCLUDE_DIR})
else() else()
message(FATAL_ERROR "Required VecGeom library not found") message(FATAL_ERROR "Required VecGeom library not found")
...@@ -155,7 +154,7 @@ include_directories("${PROJECT_SOURCE_DIR}/vecprot_v2/inc") ...@@ -155,7 +154,7 @@ include_directories("${PROJECT_SOURCE_DIR}/vecprot_v2/inc")
include_directories("${PROJECT_SOURCE_DIR}/base/inc") include_directories("${PROJECT_SOURCE_DIR}/base/inc")
# Work around VecCore not being its own project yet. # Work around VecCore not being its own project yet.
include_directories("${VECGEOM_INCLUDE_DIR}/VecCore") include_directories("${VECGEOM_INSTALL_DIR}/include/VecCore")
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Add subdirectories # Add subdirectories
......
# Finds VecGeom installation ( the vectorized geometry library ) # Locate the VecGeom library.
# This module sets up VecGeom information #
# It defines: # This file is meant to be copied into projects that want to use VecGeom. It will
# VECGEOM_FOUND If the library is found # search for VecGeomConfig.cmake, which ships with VecGeom and which will provide
# VECGEOM_INCLUDE_DIR PATH to the include directory # up-to-date buildsystem changes.
# VECGEOM_LIBRARIES Most common libraries #
# VECGEOM_LIBRARY_DIR PATH to the library directory # This module defines the following variables:
# VECGEOM_FOUND
# VECGEOM_INCLUDE_DIR
# VECGEOM_LIBRARIES
# VECGEOM_DEFINITIONS
# VECGEOM_VERSION_MAJOR # not yet
# VECGEOM_VERSION_MINOR # not yet
# VECGEOM_VERSION_PATCH # not yet
# VECGEOM_VERSION # not yet
# VECGEOM_VERSION_STRING # not yet
# VECGEOM_INSTALL_DIR
# VECGEOM_LIB_DIR
# VECGEOM_CMAKE_MODULES_DIR
#
# look if an environment variable VCROOT exists find_package(VecGeom ${VecGeom_FIND_VERSION} NO_MODULE PATHS $ENV{HOME} $ENV{VECGEOMROOT})
set(VECGEOMROOT $ENV{VECGEOMROOT})
find_library(VECGEOM_LIBRARIES libvecgeom.a PATHS ${VECGEOMROOT}/lib)
# find_library(USOLIDS_LIBRARIES libusolids.a PATHS ${VECGEOMROOT}/lib)
# if (VECGEOM_LIBRARIES AND USOLIDS_LIBRARIES)
if (VECGEOM_LIBRARIES)
set(VECGEOM_FOUND TRUE)
string(REPLACE "/lib/libvecgeom.a" "" VECGEOMROOT ${VECGEOM_LIBRARIES})
# set(VECGEOM_LIBRARIES ${VECGEOM_LIBRARIES} ${USOLIDS_LIBRARIES})
set(VECGEOM_INCLUDE_DIR ${VECGEOMROOT}/include)
set(VECGEOM_LIBRARY_DIR ${VECGEOMROOT}/lib)
if (CUDA)
find_library(VECGEOM_CUDA_LIBRARY libvecgeomcuda.a PATHS ${VECGEOMROOT}/lib)
if (VECGEOM_CUDA_LIBRARY)
SET(VECGEOM_LIBRARIES ${VECGEOM_LIBRARIES} ${VECGEOM_CUDA_LIBRARY} )
endif()
endif()
message(STATUS "Found VecGeom in ${VECGEOMROOT} with ${VECGEOM_LIBRARIES}")
message(STATUS "VECGEOM_INCLUDE_DIR = ${VECGEOM_INCLUDE_DIR}")
message(STATUS "VECGEOM_LIBRARY_DIR = ${VECGEOM_LIBRARY_DIR}")
else()
message(STATUS "VecGeom library not found; try to set a VECGEOMROOT environment variable to the base installation path or add -DVECGEOMROOT = to the cmake command")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VecGeom CONFIG_MODE)
...@@ -7,7 +7,7 @@ set_property(GLOBAL PROPERTY COMPILE_DEFINITIONS "${GEANT5_COMPILE_DEFINITIONS}" ...@@ -7,7 +7,7 @@ set_property(GLOBAL PROPERTY COMPILE_DEFINITIONS "${GEANT5_COMPILE_DEFINITIONS}"
set(CMAKE_CXX_FLAGS "${GEANT5_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${GEANT5_CXX_FLAGS}")
if( USE_VECGEOM_NAVIGATOR ) if( USE_VECGEOM_NAVIGATOR )
# Bug in VC (?), cannot compile without optimisation # Bug in VC (?), cannot compile without optimisation
set(CMAKE_CXX_FLAGS_DEBUG "${GEANT5_CXX_FLAGS_DEBUG} -O1") set(CMAKE_CXX_FLAGS_DEBUG "${GEANT5_CXX_FLAGS_DEBUG} -O0")
endif() endif()
set(CMAKE_CXX_FLAGS_MINSIZEREL "${GEANT5_CXX_FLAGS_MINSIZEREL}") set(CMAKE_CXX_FLAGS_MINSIZEREL "${GEANT5_CXX_FLAGS_MINSIZEREL}")
set(CMAKE_CXX_FLAGS_RELEASE "${GEANT5_CXX_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_RELEASE "${GEANT5_CXX_FLAGS_RELEASE}")
...@@ -77,7 +77,7 @@ add_library(Geant_v SHARED ${sources} G__Geant.cxx) ...@@ -77,7 +77,7 @@ add_library(Geant_v SHARED ${sources} G__Geant.cxx)
if( VECGEOM_FOUND ) if( VECGEOM_FOUND )
target_link_libraries(Geant_v ${ROOT_LIBRARIES} -lEG -lGeom ${VECGEOM_LIBRARIES} ${VC_LIBRARIES}) target_link_libraries(Geant_v ${ROOT_LIBRARIES} -lEG -lGeom ${VECGEOM_LIBRARIES} ${VC_LIBRARIES})
# Bug in VC (?), cannot compile without optimisation # Bug in VC (?), cannot compile without optimisation
#set(CMAKE_CXX_FLAGS_DEBUG "${GEANT5_CXX_FLAGS_DEBUG} -O1") #set(CMAKE_CXX_FLAGS_DEBUG "${GEANT5_CXX_FLAGS_DEBUG} -O0")
else() else()
target_link_libraries(Geant_v ${ROOT_LIBRARIES} -lEG -lGeom ) target_link_libraries(Geant_v ${ROOT_LIBRARIES} -lEG -lGeom )
endif() endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment