Files
geant4/cmake/Modules/G4VecGeomShim.cmake
T
2020-02-14 15:32:52 +01:00

21 lines
839 B
CMake

# Create imported target to help use VecGeom (a mess because the VecGeomConfig is...)
if(VecGeom_FOUND)
if(NOT TARGET VecGeom::VecGeom)
add_library(VecGeom::VecGeom UNKNOWN IMPORTED)
# VecGeom's config file is awful, so the following is neccessary...
foreach(__vglib ${VECGEOM_LIBRARIES})
if(__vglib MATCHES ".*libvecgeom\.(a|so|dylib|lib|dll)$")
set(VECGEOM_LIBRARY "${__vglib}")
endif()
endforeach()
string(REGEX REPLACE "^\-D|;-D" ";" VECGEOM_COMPILE_DEFINITIONS "${VECGEOM_DEFINITIONS}")
set_target_properties(VecGeom::VecGeom PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${VECGEOM_COMPILE_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${VECGEOM_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${VECGEOM_LIBRARIES}"
IMPORTED_LOCATION "${VECGEOM_LIBRARY}")
endif()
endif()