diff --git a/FSL/CMakeLists.txt b/FSL/CMakeLists.txt index 60e9a7b7df968f992767ef439c08746b67e35b24..5396d570adde235cbe2b9d5f79d02fb7c00e32cd 100644 --- a/FSL/CMakeLists.txt +++ b/FSL/CMakeLists.txt @@ -28,29 +28,28 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) find_package (FullSimLight REQUIRED) add_definitions (-DFSLPLUGINROOT="${FullSimLight_DIR}/../../../${CMAKE_INSTALL_DATAROOTDIR}" ) message ( STATUS "FSL plugin files sought here: ${FullSimLight_DIR}/../../../${CMAKE_INSTALL_DATAROOTDIR}" ) - + if(FullSimLight_HAS_HEPMC3) + add_compile_definitions( USE_HEPMC3 ) + message (STATUS "HEPMC3 Enabled in FullSimLight") + else() + message (STATUS "HEPMC3 Disabled in FullSimLight") + endif() else() # I am called from other project with add_subdirectory(). message( STATUS "Building ${PROJECT_NAME} as part of the root GeoModel project.") # Set the project project( "fsl" VERSION ${GeoModel_VERSION} LANGUAGES CXX ) add_definitions (-DFSLPLUGINROOT="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}" ) + if(GEOMODEL_USE_HEPMC3) + add_compile_definitions( USE_HEPMC3 ) + endif() endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) -# Support for the HepMC3 exchange format -# This is ON by default, but it can be disabled by the user if not used/needed, -# or if HepMC3 is not installed. -option(GEOMODEL_USE_HEPMC3 "Build GeoModel tools with support for the HepMC3 exchancge format (Note: HepMC3 must be installed on the target machine)" ON) -if(GEOMODEL_USE_HEPMC3) - find_package(HepMC3 REQUIRED) # required by default, but it can be disabled -endif() -if(HepMC3_FOUND) - add_compile_definitions( USE_HEPMC3 ) -endif() + # Find the dependencies of the project. diff --git a/FullSimLight/cmake/FullSimLightConfig.cmake.in b/FullSimLight/cmake/FullSimLightConfig.cmake.in index 0319c74691629885deb16ae6047fcfc5616e9d86..52058d30241a2d1bf7a1cb749b86c58c5b88a51d 100644 --- a/FullSimLight/cmake/FullSimLightConfig.cmake.in +++ b/FullSimLight/cmake/FullSimLightConfig.cmake.in @@ -4,6 +4,7 @@ include( ${SELF_DIR}/FullSimLightTargets.cmake ) # Set the version of the installed project. set( FullSimLight_VERSION "@PROJECT_VERSION@" ) +set( FullSimLight_HAS_HEPMC3 @GEOMODEL_USE_HEPMC3@ ) # Print some standard messages about the package being found. include( FindPackageHandleStandardArgs )