diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b745c862ae11b6ddc87be28a11dde0d1884ef7e..4299084b3179cb709682e2633652c7ec580cd1bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,11 +146,11 @@ if (WITH_EIGEN3) message ("Using eigen3 installed at location ${WITH_EIGEN3}") list (APPEND CMAKE_MODULE_PATH "${WITH_EIGEN3}/cmake") # set (EIGEN3_INCLUDE_DIR "${WITH_EIGEN3}" CACHE PATH "eigen3 directory") - find_package (Eigen3 REQUIRED) + find_package (Eigen3 REQUIRED NO_MODULE) endif () else (WITH_EIGEN3) message ("Searching eigen3 installed at system-level") - find_package (Eigen3) # if not found here, will automatically pick ThirdParty version + find_package (Eigen3 NO_MODULE) # if not found here, will automatically pick ThirdParty version endif (WITH_EIGEN3) # some final info output diff --git a/Framework/Geometry/CMakeLists.txt b/Framework/Geometry/CMakeLists.txt index 5735e7a1a0f82532f2a536c6d99fb3f362afc100..1a2754d1c42f5b75ce8f654a3d5adfb4f7a0ab38 100644 --- a/Framework/Geometry/CMakeLists.txt +++ b/Framework/Geometry/CMakeLists.txt @@ -41,6 +41,7 @@ target_link_libraries ( CORSIKAgeometry CORSIKAunits CORSIKAutilities + CORSIKAeigen3 ) target_include_directories ( @@ -50,11 +51,11 @@ target_include_directories ( $<INSTALL_INTERFACE:include/include> ) -target_include_directories ( - CORSIKAgeometry - SYSTEM - PUBLIC "${EIGEN3_INCLUDE_DIR}" - ) +#target_include_directories ( +# CORSIKAgeometry +# SYSTEM +# PUBLIC "${EIGEN3_INCLUDE_DIR}" +# ) install ( TARGETS CORSIKAgeometry diff --git a/Framework/Utilities/CMakeLists.txt b/Framework/Utilities/CMakeLists.txt index 13b544518774e1e5b21001c89d1d4e5e04a27832..1cd925d90e4effc14a09a752ce08387c44c45669 100644 --- a/Framework/Utilities/CMakeLists.txt +++ b/Framework/Utilities/CMakeLists.txt @@ -54,6 +54,7 @@ target_link_libraries ( CORSIKAgeometry CORSIKAunits CORSIKAboost # so far only for MetaProgramming + CORSIKAeigen3 # for COMboost ) target_include_directories ( diff --git a/Framework/Utilities/testCOMBoost.cc b/Framework/Utilities/testCOMBoost.cc index b665c5fc004e938a370d2befd3f050a76a57ca4d..572839296b07634b219f518eac5192e086cda5e4 100644 --- a/Framework/Utilities/testCOMBoost.cc +++ b/Framework/Utilities/testCOMBoost.cc @@ -16,8 +16,6 @@ #include <corsika/units/PhysicalUnits.h> #include <corsika/utl/COMBoost.h> -#include <Eigen/Dense> - #include <iostream> using namespace corsika::geometry; diff --git a/Processes/Pythia/CMakeLists.txt b/Processes/Pythia/CMakeLists.txt index 9a30ba573fb5cef1b3b0f20739b2e98012d2dbf5..047c6283cbc4ebf8634e2bd1eaf1b2298a85d9dc 100644 --- a/Processes/Pythia/CMakeLists.txt +++ b/Processes/Pythia/CMakeLists.txt @@ -40,7 +40,7 @@ target_link_libraries ( CORSIKAenvironment CORSIKAsetup CORSIKArandom - CORSIKAPythia8 + CORSIKApythia8 ) target_include_directories ( diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt index 824b9b6ed3165216c534026e91b039b57207272b..ea6f2483bab9bbafb29e2162a141c28e9c1791a2 100644 --- a/ThirdParty/CMakeLists.txt +++ b/ThirdParty/CMakeLists.txt @@ -43,28 +43,26 @@ if (NOT Boost_FOUND) set (Boost_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/externals/boost) install (DIRECTORY ${Boost_PREFIX}/ DESTINATION ${Boost_INSTALL_DIR}) + message ("Use ThirdParty boost include dir ${Boost_INCLUDE_DIR}") set_target_properties ( CORSIKAboost PROPERTIES INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${Boost_INCLUDE_DIR}> ) - message ("Use ThirdParty boost include dir ${Boost_INCLUDE_DIR}") - include_directories (${Boost_INCLUDE_DIR}) - + else (NOT Boost_FOUND) message ("Using system-level boost version ${Boost_VERSION} at ${Boost_INCLUDE_DIR}") set_target_properties ( CORSIKAboost PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES - $<BUILD_INTERFACE:${Boost_INCLUDE_DIR}> + INTERFACE_LINK_LIBRARIES Boost::headers ) - + endif (NOT Boost_FOUND) # eigen3 -add_library (CORSIKAEigen3 INTERFACE IMPORTED GLOBAL) +add_library (CORSIKAeigen3 INTERFACE IMPORTED GLOBAL) if (NOT Eigen3_FOUND) set (_C8_Eigen3_VERSION "eigen-eigen-b3f3d4950030") @@ -82,11 +80,11 @@ if (NOT Eigen3_FOUND) ) set (HAVE_Eigen3 1 CACHE BOOL "presence of eigen3, via external-project-add in ThirdParty folder") set (Eigen3_FOUND 1 PARENT_SCOPE) - ExternalProject_Get_Property (boost INSTALL_DIR) + ExternalProject_Get_Property (eigen3 INSTALL_DIR) set (Eigen3_PREFIX ${INSTALL_DIR}/..) set (Eigen3_INCLUDE_DIR ${Eigen3_PREFIX}) set (Eigen3_LIBRARY_DIR ${Eigen3_PREFIX}) - add_dependencies (CORSIKAboost boost) + add_dependencies (CORSIKAeigen3 eigen3) # create include directory at config time file (MAKE_DIRECTORY ${Eigen3_INCLUDE_DIR}) @@ -94,25 +92,26 @@ if (NOT Eigen3_FOUND) set (Eigen3_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/externals/eigen3) install (DIRECTORY ${Eigen3_PREFIX}/ DESTINATION ${Eigen3_INSTALL_DIR}) + message ("Use ThirdParty eigen3 include dir ${Eigen3_INCLUDE_DIR}") set_target_properties ( - CORSIKAEigen3 PROPERTIES + CORSIKAeigen3 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${Eigen3_INCLUDE_DIR}> ) - + else (NOT Eigen3_FOUND) + message ("Using system-level eigen3 version ${Eigen3_VERSION} at ${Eigen3_INCLUDE_DIR}") set_target_properties ( - CORSIKAEigen3 PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES - $<BUILD_INTERFACE:${Eigen3_INCLUDE_DIR}> - ) + CORSIKAeigen3 PROPERTIES + INTERFACE_LINK_LIBRARIES Eigen3::Eigen + ) endif (NOT Eigen3_FOUND) # Pythia8 -add_library (CORSIKAPythia8 STATIC IMPORTED GLOBAL) +add_library (CORSIKApythia8 STATIC IMPORTED GLOBAL) if (NOT Pythia8_FOUND) set (_C8_Pythia8_VERSION "8235") message ("Building ThirdParty/pythia8 using pythia${_C8_Pythia8_VERSION}-stripped.tar.bz2") @@ -133,7 +132,7 @@ if (NOT Pythia8_FOUND) set (Pythia8_PREFIX ${INSTALL_DIR}) set (Pythia8_INCLUDE_DIR ${Pythia8_PREFIX}/include) set (Pythia8_LIBRARY ${Pythia8_PREFIX}/lib/libpythia8.a) - add_dependencies (CORSIKAPythia8 pythia8) + add_dependencies (CORSIKApythia8 pythia8) # create include directory at config time file (MAKE_DIRECTORY ${Pythia8_INCLUDE_DIR}) @@ -142,7 +141,7 @@ if (NOT Pythia8_FOUND) install (DIRECTORY ${INSTALL_DIR}/ DESTINATION ${Pythia8_INSTALL_DIR}) set_target_properties ( - CORSIKAPythia8 PROPERTIES + CORSIKApythia8 PROPERTIES IMPORTED_LOCATION ${Pythia8_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES dl INTERFACE_INCLUDE_DIRECTORIES @@ -153,7 +152,7 @@ else (NOT Pythia8_FOUND) message ("Using system-level Pythia8 version ${Pythia8_VERSION} at ${Pythia8_INCLUDE_DIR}") set_target_properties ( - CORSIKAPythia8 PROPERTIES + CORSIKApythia8 PROPERTIES IMPORTED_LOCATION ${Pythia8_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES dl INTERFACE_INCLUDE_DIRECTORIES ${Pythia8_INCLUDE_DIR}