diff --git a/CMakeLists.txt b/CMakeLists.txt index c8a4cb765ec196e42197e9a802f5dbfa0959ad7d..b6fc495dfa5d787a4aab9764fffe0fbfa0ae6861 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,9 +13,10 @@ endif () #+++++++++++++++++++++++++++++ # project name # +set (c8_version 8.0.0) project ( corsika - VERSION 8.0.0 + VERSION ${c8_version} DESCRIPTION "CORSIKA C++ project (alpha status)" LANGUAGES CXX ) @@ -195,13 +196,20 @@ find_package (PythonInterp 3 REQUIRED) # CORSIKA8 # add_library (CORSIKA8 INTERFACE) +set_target_properties ( + CORSIKA8 + PROPERTIES + INTERFACE_CORSIKA8_MAJOR_VERSION 0 + COMPATIBLE_INTERFACE_STRING CORSIKA8_MAJOR_VERSION + ) +# target_include_directories ( CORSIKA8 INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}> - ) + ) # since CORSIKA8 is a header only library we must specify all link dependencies here: target_link_libraries ( CORSIKA8 @@ -217,9 +225,8 @@ add_subdirectory (src) add_subdirectory (documentation) #+++++++++++++++++++++++++++++ -# =~~~~~~~~~~~~~~~~~~~~~~~~~= # = Add of subdirectories = -# =~~~~~~~~~~~~~~~~~~~~~~~~~= +# #+++++++++++++++++++++++++++++ # modules @@ -249,6 +256,36 @@ add_subdirectory (tests) # add_subdirectory (examples) + +#+++++++++++++++++++++++++++++++ +# export CMake targets +# +include(CMakePackageConfigHelpers) +install ( + TARGETS CORSIKA8 + EXPORT CORSIKA8 + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + INCLUDES DESTINATION include + ) +# +install ( + EXPORT CORSIKA8 + FILE CORSIKA8.cmake + NAMESPACE CORSIKA8:: + DESTINATION lib/cmake/CORSIKA8 + ) +# +write_basic_package_version_file ( + "${CMAKE_CURRENT_BINARY_DIR}/CORSIKA8ConfigVersion.cmake" + VERSION ${c8_version} + COMPATIBILITY SameMajorVersion + ) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CORSIKA8Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/CORSIKA8ConfigVersion.cmake + DESTINATION ${LIB_INSTALL_DIR}/CORSIKA8/cmake ) + #+++++++++++++++++++++++++++++++ # # final summary output diff --git a/cmake/CORSIKA8Config.cmake.in b/cmake/CORSIKA8Config.cmake.in new file mode 100644 index 0000000000000000000000000000000000000000..fbd489417eebb8b3ee8aaabf8abc02d3f357403b --- /dev/null +++ b/cmake/CORSIKA8Config.cmake.in @@ -0,0 +1,8 @@ +set(CORSIKA8_VERSION x.y.z) +... +@PACKAGE_INIT@ +... +set_and_check(CORSIKA8_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") +set_and_check(CORSIKA8_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@") + +check_required_components (CORSIKA8) diff --git a/corsika/framework/geometry/Point.hpp b/corsika/framework/geometry/Point.hpp index 82d783212b5f2309b1936b465c86434f5674e784..b06a68bdebc236f2520007da1031bb76491f6a70 100644 --- a/corsika/framework/geometry/Point.hpp +++ b/corsika/framework/geometry/Point.hpp @@ -52,7 +52,7 @@ namespace corsika { inline QuantityVector<length_d>& getCoordinates(CoordinateSystemPtr const& pCS); /** - * \defgroup access coordinate components + * \name access coordinate components * \{ * * Note, if you access components in a different CoordinateSystem diff --git a/externals/cnpy/CMakeLists.txt b/externals/cnpy/CMakeLists.txt index 0fa38d3bd16804b024f83700a2ba6c7c2c316c08..85591744386358aee6dcba2c0009046442f64393 100644 --- a/externals/cnpy/CMakeLists.txt +++ b/externals/cnpy/CMakeLists.txt @@ -26,6 +26,7 @@ target_include_directories ( install ( TARGETS cnpy + EXPORT CORSIKA8 LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) diff --git a/modules/CMakeLists_PROPOSAL.txt b/modules/CMakeLists_PROPOSAL.txt index a752d8f7be5a72349f908c2721461a69f3665e58..b17c217a2c52912f241ae45d778ec8f9350676d4 100644 --- a/modules/CMakeLists_PROPOSAL.txt +++ b/modules/CMakeLists_PROPOSAL.txt @@ -70,6 +70,13 @@ install( LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) +else (NOT IN_CORSIKA8) +install( + TARGETS PROPOSAL + EXPORT CORSIKA8 + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) endif (NOT IN_CORSIKA8) # input version from the project call, so the library knows its own version diff --git a/modules/qgsjetII/CMakeLists.txt b/modules/qgsjetII/CMakeLists.txt index 2ddb6b023f7e4d0320a7f827027c165d504b6a48..eaaeb9ebec4215457227e101b3dbd4d68c753f83 100644 --- a/modules/qgsjetII/CMakeLists.txt +++ b/modules/qgsjetII/CMakeLists.txt @@ -36,6 +36,17 @@ target_include_directories ( ) target_link_libraries (QGSJetII_static CorsikaData) +install ( + TARGETS QGSJetII + EXPORT CORSIKA8 + DESTINATION lib + ) + +install ( + TARGETS QGSJetII_static + EXPORT CORSIKA8 + DESTINATION lib + ) # add qgsjetII to corsika8 build add_dependencies (CORSIKA8 QGSJetII_static) diff --git a/modules/sibyll/CMakeLists.txt b/modules/sibyll/CMakeLists.txt index 6dfe2d5c3f739d4494024adfe04bff1d3b861749..c6d8c74d0f136e710f5ffcc9e48fa226ebf731ad 100644 --- a/modules/sibyll/CMakeLists.txt +++ b/modules/sibyll/CMakeLists.txt @@ -40,6 +40,18 @@ target_link_libraries ( gfortran ) +install ( + TARGETS Sibyll + EXPORT CORSIKA8 + DESTINATION lib + ) + +install ( + TARGETS Sibyll_static + EXPORT CORSIKA8 + DESTINATION lib + ) + # add sibyll to corsika8 build add_dependencies (CORSIKA8 Sibyll_static) target_link_libraries (CORSIKA8 INTERFACE Sibyll_static) diff --git a/modules/urqmd/CMakeLists.txt b/modules/urqmd/CMakeLists.txt index 4c37ed1e0cd735cc3dca3364570e84dee550b5c0..bab5fb3f076cdc727a326dd7ae995e776570646f 100644 --- a/modules/urqmd/CMakeLists.txt +++ b/modules/urqmd/CMakeLists.txt @@ -43,14 +43,36 @@ set ( ) enable_language (Fortran) + add_library (UrQMD SHARED ${MODEL_SOURCES}) -target_include_directories (UrQMD PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories (UrQMD PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/modules/urqmd> + ) set_target_properties (UrQMD PROPERTIES POSITION_INDEPENDENT_CODE 1) add_library (UrQMD_static STATIC ${MODEL_SOURCES}) -target_include_directories (UrQMD_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories (UrQMD_static PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/modules/urqmd> + ) set_target_properties (UrQMD_static PROPERTIES POSITION_INDEPENDENT_CODE 1) +install ( + TARGETS UrQMD + EXPORT CORSIKA8 + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + INCLUDES DESTINATION include + ) + +install ( + TARGETS UrQMD_static + EXPORT CORSIKA8 + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + INCLUDES DESTINATION include + ) # add UrQMD to CORSIKA8 build add_dependencies (CORSIKA8 UrQMD_static)