diff --git a/CMakeLists.txt b/CMakeLists.txt index 476c97851d6d6f5417d8bda09acc6fb1ee5df90f..30262941a7e3ccb96092b4ec12459eb890407e60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,19 +5,17 @@ set(CXX_STANDARD 17) set(CXX_STANDARD_REQUIRED ON) if(DEFINED ENV{ROOTSYS}) - set(ROOT_INCLUDE_DIRS "$ENV{ROOTSYS}/include") - set(ROOT_LIBRARIES "$ENV{ROOTSYS}/lib") - MESSAGE(STATUS "found env var ROOTSYS") - MESSAGE(STATUS "root include path is: ${ROOT_INCLUDE_DIRS}") - MESSAGE(STATUS "root lib path is: ${ROOT_LIBRARIES}") + MESSAGE(STATUS "ROOTSYS is defined, trying to find package in this directory") + find_package(ROOT PATHS $ENV{ROOTSYS} NO_DEFAULT_PATH) + MESSAGE(STATUS "${ROOT_INCLUDE_DIRS}") else() MESSAGE(STATUS "ROOTSYS not defined using find_package(ROOT)") find_package(ROOT) + MESSAGE(STATUS "${ROOT_INCLUDE_DIRS}") endif() find_package(Boost) find_package(Boost COMPONENTS program_options unit_test_framework serialization filesystem timer REQUIRED) - find_package(GSL REQUIRED) #include_directories( diff --git a/FitParams/CMakeLists.txt b/FitParams/CMakeLists.txt index 97b03d6853fcc815d9c8ee0d7b976cc55760a8ae..7a7979373e55874b91661df3c4daf29887e42ac6 100644 --- a/FitParams/CMakeLists.txt +++ b/FitParams/CMakeLists.txt @@ -15,7 +15,7 @@ target_include_directories(FitParams ) target_link_libraries(FitParams - ${ROOT_LIBRARIES}/libMinuit2.so + ROOT::Minuit2 ) install(TARGETS FitParams @@ -38,7 +38,7 @@ target_link_libraries(StreamerTestApp ConfigParser qft++Extension ErrLogger - ${ROOT_LIBRARIES}/libMinuit2.so + ROOT::Minuit2 ) add_executable(PwaCovMatrixApp diff --git a/KMatrixExtract/CMakeLists.txt b/KMatrixExtract/CMakeLists.txt index 5f6198e3853afabccaeb21521133534cbfd8e6a3..85585f6ccf3712f87db7f03da883775b5254e826 100644 --- a/KMatrixExtract/CMakeLists.txt +++ b/KMatrixExtract/CMakeLists.txt @@ -16,7 +16,7 @@ target_include_directories(KMatrixExtract ) target_link_libraries(KMatrixExtract - ${ROOT_LIBRARIES}/libMinuit2.so + ROOT::Minuit2 ) install(TARGETS KMatrixExtract diff --git a/MinFunctions/CMakeLists.txt b/MinFunctions/CMakeLists.txt index f3361de9947210be77c76ee38fdf78c25dfc5296..0f8eeee369c71d32e56e022de90f71a0bcaad55c 100644 --- a/MinFunctions/CMakeLists.txt +++ b/MinFunctions/CMakeLists.txt @@ -25,7 +25,7 @@ target_link_libraries(MinFunctions PwaDynamics PspGen PwaUtils - ${ROOT_LIBRARIES}/libMinuit2.so + ROOT::Minuit2 ${Boost_LIBRARIES} ) diff --git a/PwaDynamics/CMakeLists.txt b/PwaDynamics/CMakeLists.txt index 18a06db397afe492014d4f5a897558f2ccdb9de2..6156927d32c889a54eb029090fbc6769520091dc 100644 --- a/PwaDynamics/CMakeLists.txt +++ b/PwaDynamics/CMakeLists.txt @@ -20,7 +20,7 @@ target_link_libraries(PwaDynamics qft++ qft++Extension ErrLogger - ${ROOT_LIBRARIES}/libMinuit2.so + ROOT::Minuit2 ) install(TARGETS PwaDynamics diff --git a/ggUtils/CMakeLists.txt b/ggUtils/CMakeLists.txt index c6c7efd8dff8eed39918f968414a2c3b9c2c6c88..358f59afc54b4d494a9171d2e5dc6440b5e5017d 100644 --- a/ggUtils/CMakeLists.txt +++ b/ggUtils/CMakeLists.txt @@ -16,7 +16,7 @@ target_include_directories(ggUtils ) target_link_libraries(ggUtils - ${ROOT_LIBRARIES}/libMinuit2.so + ROOT::Minuit2 ) install(TARGETS ggUtils diff --git a/gslUtils/CMakeLists.txt b/gslUtils/CMakeLists.txt index 0495bd8731e50771ea7bcaa807ab1bf300fbbf0b..ea99d47864379bc08edaad39dd7167c0489a1a94 100644 --- a/gslUtils/CMakeLists.txt +++ b/gslUtils/CMakeLists.txt @@ -22,7 +22,7 @@ target_link_libraries(gslUtils qft++ qft++Extension ErrLogger - ${ROOT_LIBRARIES}/libMinuit2.so + ROOT::Minuit2 GSL::gsl GSL::gslcblas )