Skip to content

Commit

Permalink
CMake fixes: (#3437)
Browse files Browse the repository at this point in the history
CMake fixes:
Added FindVGM.cmake to amend the target provided by VGM installation
  • Loading branch information
ihrivnac authored Apr 26, 2020
1 parent 4a0b344 commit 351640f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
31 changes: 31 additions & 0 deletions dependencies/FindVGM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

# Copyright CERN and copyright holders of ALICE O2. This software is distributed
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
# verbatim in the file "COPYING".
#
# See http://alice-o2.web.cern.ch/license for full licensing information.
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization or
# submit itself to any jurisdiction.

# use the VGMConfig.cmake provided by the VGM installation but
# amend the target VGM::XmlVGM with the include and link directories

find_package(VGM NO_MODULE)
if(NOT VGM_FOUND)
return()
endif()

# VGM uses namespace since 4.7
if(${VGM_VERSION} VERSION_LESS "4.7")
set(targetVGM XmlVGM)
else()
set(targetVGM VGM::XmlVGM)
endif()

set_target_properties(${targetVGM}
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${VGM_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES
$<TARGET_FILE_DIR:${targetVGM}>)
7 changes: 6 additions & 1 deletion dependencies/O2SimulationDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,20 @@ set_package_properties(Geant3
PROPERTIES
TYPE ${mcPackageRequirement} DESCRIPTION
"the legacy but not slow MC transport engine")

find_package(Geant4 MODULE)
set_package_properties(Geant4
PROPERTIES
TYPE ${mcPackageRequirement} DESCRIPTION
"more recent and more complete MC transport engine")


find_package(Geant4VMC MODULE)
set_package_properties(Geant4VMC PROPERTIES TYPE ${mcPackageRequirement})
find_package(VGM CONFIG)

find_package(VGM MODULE)
set_package_properties(VGM PROPERTIES TYPE ${mcPackageRequirement})

find_package(HepMC MODULE)
set_package_properties(HepMC
PROPERTIES
Expand Down

0 comments on commit 351640f

Please sign in to comment.