Commit 98c7dfbd by Sandro Christian Wenzel

Merge branch 'swenzel/newfindvecgeom'

parents 24794d1d 2d555af3
......@@ -43,12 +43,11 @@ find_package(VecGeom REQUIRED)
if( VECGEOM_FOUND )
find_package(Vc)
if ( VC_FOUND )
include_directories( AFTER SYSTEM ${VC_INCLUDE_DIR})
include_directories( AFTER SYSTEM ${VC_INCLUDE_DIR})
endif()
if( USE_VECGEOM_NAVIGATOR )
add_definitions( "-DUSE_VECGEOM_NAVIGATOR" )
endif()
add_definitions( "-DVECGEOM_ROOT" )
include_directories(${VECGEOM_INCLUDE_DIR})
else()
message(FATAL_ERROR "Required VecGeom library not found")
......@@ -155,7 +154,7 @@ include_directories("${PROJECT_SOURCE_DIR}/vecprot_v2/inc")
include_directories("${PROJECT_SOURCE_DIR}/base/inc")
# Work around VecCore not being its own project yet.
include_directories("${VECGEOM_INCLUDE_DIR}/VecCore")
include_directories("${VECGEOM_INSTALL_DIR}/include/VecCore")
#----------------------------------------------------------------------------
# Add subdirectories
......
# Finds VecGeom installation ( the vectorized geometry library )
# This module sets up VecGeom information
# It defines:
# VECGEOM_FOUND If the library is found
# VECGEOM_INCLUDE_DIR PATH to the include directory
# VECGEOM_LIBRARIES Most common libraries
# VECGEOM_LIBRARY_DIR PATH to the library directory
# Locate the VecGeom library.
#
# This file is meant to be copied into projects that want to use VecGeom. It will
# search for VecGeomConfig.cmake, which ships with VecGeom and which will provide
# up-to-date buildsystem changes.
#
# 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
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()
find_package(VecGeom ${VecGeom_FIND_VERSION} NO_MODULE PATHS $ENV{HOME} $ENV{VECGEOMROOT})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VecGeom CONFIG_MODE)
......@@ -7,7 +7,7 @@ set_property(GLOBAL PROPERTY COMPILE_DEFINITIONS "${GEANT5_COMPILE_DEFINITIONS}"
set(CMAKE_CXX_FLAGS "${GEANT5_CXX_FLAGS}")
if( USE_VECGEOM_NAVIGATOR )
# 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()
set(CMAKE_CXX_FLAGS_MINSIZEREL "${GEANT5_CXX_FLAGS_MINSIZEREL}")
set(CMAKE_CXX_FLAGS_RELEASE "${GEANT5_CXX_FLAGS_RELEASE}")
......@@ -77,7 +77,7 @@ add_library(Geant_v SHARED ${sources} G__Geant.cxx)
if( VECGEOM_FOUND )
target_link_libraries(Geant_v ${ROOT_LIBRARIES} -lEG -lGeom ${VECGEOM_LIBRARIES} ${VC_LIBRARIES})
# 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()
target_link_libraries(Geant_v ${ROOT_LIBRARIES} -lEG -lGeom )
endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment