From 72a26c9fc628f1534480094c71a772a6978d23c5 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 10 Sep 2024 10:26:34 +0200 Subject: [PATCH 1/2] Use the Key4hepConfig flag to set the standard, compiler flags and rpath magic. --- CMakeLists.txt | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 368451e..10ef960 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,37 +21,12 @@ find_package(ROOT COMPONENTS RIO Tree MathCore) find_package(EDM4HEP) find_package(k4FWCore) find_package(Gaudi) +find_package(MarlinUtil REQUIRED) #--------------------------------------------------------------- +include(cmake/Key4hepConfig.cmake) include(GNUInstallDirs) -# Set up C++ Standard -# ``-DCMAKE_CXX_STANDARD=`` when invoking CMake -set(CMAKE_CXX_STANDARD 17 CACHE STRING "") - -if(NOT CMAKE_CXX_STANDARD MATCHES "14|17|20") - message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}") -endif() - -# use, i.e. don't skip the full RPATH for the build tree -set(CMAKE_SKIP_BUILD_RPATH FALSE) - -# when building, don't use the install RPATH already -# (but later on when installing) -set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") - -# add the automatically determined parts of the RPATH -# which point to directories outside the build tree to the install RPATH -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - -# the RPATH to be used when installing, but only if it's not a system directory -list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) -if("${isSystemDir}" STREQUAL "-1") - set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") -endif("${isSystemDir}" STREQUAL "-1") - include(CTest) function(set_test_env _testname) set_property(TEST ${test_name} APPEND PROPERTY ENVIRONMENT "ROOT_INCLUDE_PATH=$<$:$/../include>:$<$:$/../include>:$ENV{ROOT_INCLUDE_PATH}") From 3223e5b6c393e6703c9534a9f9fbdd9627e4a3ca Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 10 Sep 2024 10:31:49 +0200 Subject: [PATCH 2/2] Don't ask for MarlinUtil since this is in another PR --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10ef960..81c9bc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,6 @@ find_package(ROOT COMPONENTS RIO Tree MathCore) find_package(EDM4HEP) find_package(k4FWCore) find_package(Gaudi) -find_package(MarlinUtil REQUIRED) #--------------------------------------------------------------- include(cmake/Key4hepConfig.cmake)