IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 767d6d77 authored by ralfulrich's avatar ralfulrich Committed by Ralf Ulrich
Browse files

export CORSIKA8 target

parent 5c9ea67a
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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)
......@@ -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
......
......@@ -26,6 +26,7 @@ target_include_directories (
install (
TARGETS cnpy
EXPORT CORSIKA8
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
......
......@@ -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
......
......@@ -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)
......
......@@ -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)
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment