IAP GITLAB

Commit 658934f8 authored by Ralf Ulrich's avatar Ralf Ulrich Committed by Ralf Ulrich

first full export of CORSIKA8 as cmake library

parent 767d6d77
......@@ -92,7 +92,7 @@ check-clang-format:
script:
- mkdir -p build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DUSE_PYTHIA8_C8=C8
- cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_PYTHIA8_C8=C8
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_TAG
......@@ -344,7 +344,10 @@ example-clang-8:
- cd build
- cmake --build . -- -j4
- set -o pipefail
- ctest -j4
- ctest -j4
- make install
- cd install/share/examples
- make -j4
- make -j4 run_examples | gzip -v -9 > examples.log.gz
rules:
- if: '$CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TITLE =~ /^Draft:/'
......@@ -362,7 +365,7 @@ example-clang-8:
junit:
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
paths:
- ${CI_PROJECT_DIR}/build/examples.log.gz
- ${CI_PROJECT_DIR}/build/install/share/examples/examples.log.gz
cache:
paths:
- ${CI_PROJECT_DIR}/build/
......@@ -453,7 +456,10 @@ install-clang-8:
- cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_PYTHIA8_C8=C8
- cmake --build . -- -j4
- set -o pipefail
- ctest -j4
- ctest -j4
- make install
- cd install/share/examples
- make -j4
- make -j4 run_examples | gzip -v -9 > examples.log.gz
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /Ready for code review/' # run on merge requests, if label 'Ready for code review' is set
......@@ -478,7 +484,7 @@ install-clang-8:
junit:
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
paths:
- ${CI_PROJECT_DIR}/build/examples.log.gz
- ${CI_PROJECT_DIR}/build/install/share/examples/examples.log.gz
# release for gcc
release-full-u-18_04:
......@@ -575,5 +581,3 @@ sanity:
untracked: true
policy: pull
key: "${CI_COMMIT_REF_SLUG}-gcc"
cmake_minimum_required (VERSION 3.9)
#+++++++++++++++++++++++++++++
# project name
#
set (c8_version 8.0.0)
project (
corsika
VERSION ${c8_version}
DESCRIPTION "CORSIKA C++ project (alpha status)"
LANGUAGES CXX
)
#+++++++++++++++++++++++++++++
# prevent in-source builds and give warning message
#
......@@ -10,16 +21,16 @@ if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
You must delete them, or cmake will refuse to work.")
endif ()
#+++++++++++++++++++++++++++++
# project name
#++++++++++++++++++++++++++++
# cmake version-specific settings
#
set (c8_version 8.0.0)
project (
corsika
VERSION ${c8_version}
DESCRIPTION "CORSIKA C++ project (alpha status)"
LANGUAGES CXX
)
# https://cmake.org/cmake/help/latest/policy/CMP0079.html
if (${CMAKE_VERSION} VERSION_GREATER "3.13.0")
cmake_policy (SET CMP0079 NEW)
endif ()
if (POLICY CMP0079)
cmake_policy (SET CMP0079 NEW)
endif ()
#+++++++++++++++++++++++++++++
# as long as there still are modules using it:
......@@ -47,7 +58,7 @@ set (CMAKE_INSTALL_MESSAGE LAZY)
#+++++++++++++++++++++++++++++
# Setup hardware and infrastructure dependent defines
#
include(CorsikaDefines)
include (CorsikaDefines)
#+++++++++++++++++++++++++++++
# check if compiler is C++17 compliant
......@@ -69,7 +80,6 @@ set (CMAKE_CXX_EXTENSIONS OFF)
# FYI: optimizer flags: -O2 would not trade speed for size, neither O2/3 use fast-math
# debug: O0, relwithdebinfo: 02, release: O3, minsizerel: Os (all defaults)
set (CMAKE_CXX_FLAGS "-Wall -pedantic -Wextra -Wno-ignored-qualifiers")
set (CMAKE_Fortran_FLAGS "-std=legacy -Wfunction-elimination")
set (DEFAULT_BUILD_TYPE "Release")
# clang produces a lot of unecessary warnings without this:
......@@ -150,7 +160,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Coverage)
add_custom_command (
OUTPUT coverage.info
COMMAND ${LCOV_BIN_DIR}/lcov -q --remove raw-coverage.info "*/usr/*" "/usr/*" --output-file coverage2.info
COMMAND ${LCOV_BIN_DIR}/lcov --remove coverage2.info "*/externals/*" "*/tests/*" "*/sibyll2.3d.cpp" "*/.conan/*" "*/include/Pythia8/*" "${CMAKE_CURRENT_SOURCE_DIR}/modules/*" "${CMAKE_CURRENT_BINARY_DIR}/modules/*" --output-file coverage.info
COMMAND ${LCOV_BIN_DIR}/lcov --remove coverage2.info "*/externals/*" "*/tests/*" "*/sibyll2.3d.cpp" "*/.conan/*" "*/include/Pythia8/*" "${CMAKE_SOURCE_DIR}/modules/*" "${CMAKE_BINARY_DIR}/modules/*" --output-file coverage.info
COMMAND ${CMAKE_COMMAND} -E remove coverage2.info
DEPENDS raw-coverage.info
)
......@@ -176,7 +186,7 @@ set (CTEST_CUSTOM_COVERAGE_EXCLUDE "./tests/" "./examples/" "./modules/" "test*.
# include this test only if NOT run on gitlab-ci; On CI this is a dedicated job:
if (NOT DEFINED ENV{CI})
# add call to ./do-copyright.py to run as unit-test-case
add_test (NAME copyright_notices COMMAND ./do-copyright.py WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test (NAME copyright_notices COMMAND ./do-copyright.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif (NOT DEFINED ENV{CI})
#+++++++++++++++++++++++++++++
......@@ -191,6 +201,15 @@ option (WITH_HISTORY "Flag to switch on/off HISTORY" ON)
set (Python_ADDITIONAL_VERSIONS 3)
find_package (PythonInterp 3 REQUIRED)
#+++++++++++++++++++++++++++++++
# exporting of CMake targets
#
include (CMakePackageConfigHelpers)
# list of targets that will be INSTALLed and EXPORTed
# Important: all those targets must be individually INSTALLed with "EXPORT CORSIKA8PublicTargets"
set (public_CORSIKA8_targets CORSIKA8)
#+++++++++++++++++++++++++++++
# CORSIKA8
......@@ -206,9 +225,9 @@ set_target_properties (
target_include_directories (
CORSIKA8
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
)
# since CORSIKA8 is a header only library we must specify all link dependencies here:
target_link_libraries (
......@@ -239,7 +258,7 @@ add_subdirectory (modules/qgsjetII)
add_subdirectory (modules/urqmd)
add_subdirectory (modules/conex)
#
# we really need a better proposal CMakeList.txt files:
# we really need a better proposal CMakeList.txt file:
set (ADD_PYTHON OFF)
file (READ modules/CMakeLists_PROPOSAL.txt overwrite_CMakeLists_PROPOSAL_txt)
file (WRITE modules/proposal/CMakeLists.txt ${overwrite_CMakeLists_PROPOSAL_txt})
......@@ -252,40 +271,60 @@ target_link_libraries (CORSIKA8 INTERFACE PROPOSAL)
add_subdirectory (tests)
#+++++++++++++++++++++++++++++++
# examples
#
add_subdirectory (examples)
#+++++++++++++++++++++++++++++++
# export CMake targets
# installation
#
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
EXPORT CORSIKA8PublicTargets
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}
)
#
# header only part
#
install (DIRECTORY corsika DESTINATION include)
configure_package_config_file (
cmake/CORSIKA8Config.cmake.in
${PROJECT_BINARY_DIR}/CORSIKA8Config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
)
write_basic_package_version_file (
"${CMAKE_CURRENT_BINARY_DIR}/CORSIKA8ConfigVersion.cmake"
${PROJECT_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 )
install (
EXPORT CORSIKA8PublicTargets
FILE CORSIKA8Targets.cmake
NAMESPACE CORSIKA8::
DESTINATION lib/cmake/CORSIKA8
)
install (FILES
${CMAKE_BINARY_DIR}/conanbuildinfo.cmake
${CMAKE_BINARY_DIR}/conaninfo.txt
${CMAKE_BINARY_DIR}/CORSIKA8Config.cmake
${CMAKE_BINARY_DIR}/CORSIKA8ConfigVersion.cmake
DESTINATION lib/cmake/CORSIKA8
)
#
# examples
#
install (DIRECTORY examples DESTINATION share/)
#
# tools
#
install (DIRECTORY tools DESTINATION share/)
#+++++++++++++++++++++++++++++++
#
# final summary output
......
set(CORSIKA8_VERSION x.y.z)
...
set (CORSIKA8_VERSION @c8_version@)
@PACKAGE_INIT@
...
set_and_check(CORSIKA8_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(CORSIKA8_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
#++++++++++++++++++++++++++++
# General config and flags
#
set (CMAKE_CXX_STANDARD @CMAKE_CXX_STANDARD@)
set (CMAKE_CXX_EXTENSIONS @CMAKE_CXX_EXTENSIONS@)
set (COMPILE_OPTIONS @COMPILE_OPTIONS@)
set (CMAKE_VERBOSE_MAKEFILE @CMAKE_VERBOSE_MAKEFILE@)
#+++++++++++++++++++++++++++++
# Setup external dependencies via conan
#
include (${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo.cmake)
conan_basic_setup (TARGETS)
#+++++++++++++++++++++++++++++
# Import Pythia8
# since we always import pythia (ExternalProject_Add) we have to
# import here, too.
#
add_library (C8::ext::pythia8 STATIC IMPORTED GLOBAL)
set_target_properties (
C8::ext::pythia8 PROPERTIES
IMPORTED_LOCATION @Pythia8_LIBRARY@/libpythia8.a
IMPORTED_LINK_INTERFACE_LIBRARIES dl
INTERFACE_INCLUDE_DIRECTORIES @Pythia8_INCLUDE_DIR@
)
set (Pythia8_FOUND @Pythia8_FOUND@)
message ("Pythia8 lib: @Pythia8_LIBRARY@, inc: @Pythia8_INCLUDE_DIR@")
#++++++++++++++++++++++++++++++
# import CORSIKA8
#
include ("${CMAKE_CURRENT_LIST_DIR}/CORSIKA8Targets.cmake")
check_required_components (CORSIKA8)
### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE:
@PACKAGE_INIT@
......@@ -68,55 +68,3 @@ function (CORSIKA_ADD_TEST)
endif ()
add_test (NAME ${name} COMMAND ${name} -o ${PROJECT_BINARY_DIR}/test_outputs/junit-${name}.xml -s -r junit)
endfunction (CORSIKA_ADD_TEST)
#################################################
#
# central macro to register an examples in cmake
#
# Examples can be globally executed by 'make run_examples'
#
# 1) Simple use:
# Pass the name of the source.cc file as the first
# argument, without the ".cc" extention.
#
# Example: CORSIKA_REGISTER_EXAMPLE (doSomething)
#
# The TARGET doSomething must already exists,
# i.e. typically via add_executable (doSomething src.cc).
#
# Example: CORSIKA_ADD_EXAMPLE (example_one
# RUN_OPTION "extra command line options"
# )
#
# In all cases, you can further customize the target with
# target_link_libraries(example_one ...) and so on.
#
function (CORSIKA_REGISTER_EXAMPLE)
cmake_parse_arguments (PARSE_ARGV 1 C8_EXAMPLE "" "" "RUN_OPTIONS")
set (name ${ARGV0})
if (NOT C8_EXAMPLE_RUN_OPTIONS)
set (run_options "")
else ()
set (run_options ${C8_EXAMPLE_RUN_OPTIONS})
endif ()
target_compile_options (${name} PRIVATE -g) # do not skip asserts
file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/example_outputs/)
if (TARGET run_examples)
else ()
add_custom_target (run_examples)
endif ()
add_dependencies (run_examples ${name})
# just run the command as-is
set (CMD ${CMAKE_BINARY_DIR}/bin/${name} ${run_options})
add_custom_command (TARGET run_examples
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo ""
COMMAND ${CMAKE_COMMAND} -E echo "**************************************"
COMMAND ${CMAKE_COMMAND} -E echo "***** running example: ${name} " ${run_options} VERBATIM
COMMAND ${CMD} VERBATIM
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/example_outputs)
install (TARGETS ${name} DESTINATION share/examples)
endfunction (CORSIKA_REGISTER_EXAMPLE)
set (
HISTORY_HEADERS
EventType.hpp
Event.hpp
HistorySecondaryProducer.hpp
HistoryObservationPlane.hpp
HistoryStackExtension.hpp
SecondaryParticle.hpp
)
set (
HISTORY_NAMESPACE
corsika/stack/history
)
if (WITH_HISTORY)
set (
HISTORY_SOURCES
HistoryObservationPlane.cpp
)
add_library (CORSIKAhistory STATIC ${HISTORY_SOURCES})
set (IS_INTERFACE "")
else (WITH_HISTORY)
add_library (CORSIKAhistory INTERFACE)
set (IS_INTERFACE "INTERFACE")
endif (WITH_HISTORY)
CORSIKA_COPY_HEADERS_TO_NAMESPACE (CORSIKAhistory ${HISTORY_NAMESPACE} ${HISTORY_HEADERS})
target_link_libraries (
CORSIKAhistory
${IS_INTERFACE}
CORSIKAparticles
CORSIKAgeometry
CORSIKAprocesssequence # for HistoryObservationPlane
CORSIKAsetup # for HistoryObservationPlane
CORSIKAlogging
SuperStupidStack
NuclearStackExtension # for testHistoryView.cc
C8::ext::boost # for HistoryObservationPlane
)
target_include_directories (
CORSIKAhistory
INTERFACE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/include>
)
install (
FILES ${HISTORY_HEADERS}
DESTINATION include/${HISTORY_NAMESPACE}
)
# ----------------
# code unit testing
CORSIKA_ADD_TEST(testHistoryStack)
target_link_libraries (
testHistoryStack
CORSIKAhistory
CORSIKAtesting
DummyStack
)
CORSIKA_ADD_TEST(testHistoryView)
target_link_libraries (
testHistoryView
CORSIKAhistory
CORSIKAtesting
)
......@@ -3,7 +3,7 @@ find_package (Doxygen OPTIONAL_COMPONENTS dot mscgen dia)
if (DOXYGEN_FOUND)
if (NOT DOXYGEN_DOT_EXECUTABLE)
message (FATAL_ERROR "Found doxygen but not 'dot' command, please install graphviz or set DOXYGEN_DOT_EXECUTABLE")
endif()
endif (NOT DOXYGEN_DOT_EXECUTABLE)
set (DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set (DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
......@@ -17,14 +17,15 @@ if (DOXYGEN_FOUND)
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
VERBATIM
)
add_custom_command(TARGET doxygen POST_BUILD
add_custom_command (TARGET doxygen POST_BUILD
COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/latex; pdflatex refman.tex
)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc OPTIONAL)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf DESTINATION share/doc OPTIONAL)
install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc OPTIONAL)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf DESTINATION share/doc OPTIONAL)
else (DOXYGEN_FOUND)
......
#################################################
#
# central macro to register an examples in cmake
#
# Examples can be globally executed by 'make run_examples'
#
# 1) Simple use:
# Pass the name of the source.cc file as the first
# argument, without the ".cc" extention.
#
# Example: CORSIKA_REGISTER_EXAMPLE (doSomething)
#
# The TARGET doSomething must already exists,
# i.e. typically via add_executable (doSomething src.cc).
#
# Example: CORSIKA_ADD_EXAMPLE (example_one
# RUN_OPTION "extra command line options"
# )
#
# In all cases, you can further customize the target with
# target_link_libraries (example_one ...) and so on.
#
function (CORSIKA_REGISTER_EXAMPLE)
cmake_parse_arguments (PARSE_ARGV 1 C8_EXAMPLE "" "" "RUN_OPTIONS")
set (name ${ARGV0})
if (NOT C8_EXAMPLE_RUN_OPTIONS)
set (run_options "")
else ()
set (run_options ${C8_EXAMPLE_RUN_OPTIONS})
endif ()
target_compile_options (${name} PRIVATE -g) # do not skip asserts
file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/example_outputs/)
if (TARGET run_examples)
else ()
add_custom_target (run_examples)
endif ()
add_dependencies (run_examples ${name})
# just run the command as-is
set (CMD ${CMAKE_CURRENT_BINARY_DIR}/bin/${name} ${run_options})
add_custom_command (TARGET run_examples
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo ""
COMMAND ${CMAKE_COMMAND} -E echo "**************************************"
COMMAND ${CMAKE_COMMAND} -E echo "***** running example: ${name} " ${run_options} VERBATIM
COMMAND ${CMD} VERBATIM
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/example_outputs)
install (TARGETS ${name} DESTINATION share/examples)
endfunction (CORSIKA_REGISTER_EXAMPLE)
cmake_minimum_required (VERSION 3.9)
project (CORSIKA8_examples)
# this is enough to use CORSIKA8
find_package (CORSIKA8 CONFIG REQUIRED)
# this is only for CORSIKA_REGISTER_EXAMPLE
include ("${CMAKE_CURRENT_SOURCE_DIR}/CMakeHelper.cmake")
add_executable (helix_example helix_example.cpp)
target_link_libraries (helix_example CORSIKA8)
target_link_libraries (helix_example CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (helix_example)
add_executable (geometry_example geometry_example.cpp)
target_link_libraries (geometry_example CORSIKA8)
target_link_libraries (geometry_example CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (geometry_example)
# # logging back in March was not used
# #add_executable (logger_example logger_example.cpp)
# #target_link_libraries (logger_example CORSIKA8)
# #CORSIKA_REGISTER_EXAMPLE (logger_example)
add_executable (stack_example stack_example.cpp)
target_link_libraries (stack_example CORSIKA8)
target_link_libraries (stack_example CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (stack_example)
add_executable (cascade_example cascade_example.cpp)
target_link_libraries (cascade_example CORSIKA8)
target_link_libraries (cascade_example CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (cascade_example)
add_executable (boundary_example boundary_example.cpp)
target_link_libraries (boundary_example CORSIKA8)
target_link_libraries (boundary_example CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (boundary_example)
add_executable (cascade_proton_example cascade_proton_example.cpp)
target_link_libraries (cascade_proton_example CORSIKA8)
target_link_libraries (cascade_proton_example CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (cascade_proton_example)
add_executable (vertical_EAS vertical_EAS.cpp)
target_link_libraries (vertical_EAS CORSIKA8)
target_link_libraries (vertical_EAS CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (vertical_EAS RUN_OPTIONS 4 2 10000.)
add_executable (stopping_power stopping_power.cpp)
target_link_libraries (stopping_power CORSIKA8)
target_link_libraries (stopping_power CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (stopping_power)
add_executable (staticsequence_example staticsequence_example.cpp)
target_link_libraries (staticsequence_example CORSIKA8)
target_link_libraries (staticsequence_example CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (staticsequence_example)
add_executable (particle_list_example particle_list_example.cpp)
target_link_libraries (particle_list_example CORSIKA8)
target_link_libraries (particle_list_example CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (particle_list_example)
add_executable (em_shower em_shower.cpp)
target_link_libraries (em_shower CORSIKA8)
target_link_libraries (em_shower CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (em_shower RUN_OPTIONS "100.")
add_executable (hybrid_MC hybrid_MC.cpp)
target_link_libraries (hybrid_MC CORSIKA8)
target_link_libraries (hybrid_MC CORSIKA8::CORSIKA8)
CORSIKA_REGISTER_EXAMPLE (hybrid_MC RUN_OPTIONS 4 2 10000.)
......@@ -21,13 +21,18 @@ target_include_directories (
cnpy
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/externals/cnpy>
$<INSTALL_INTERFACE:external/cnpy/include>
)
install (
FILES cnpy.hpp
DESTINATION external/cnpy/include
)
install (
TARGETS cnpy
EXPORT CORSIKA8
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
EXPORT CORSIKA8PublicTargets
LIBRARY DESTINATION external/cnpy/lib
ARCHIVE DESTINATION external/cnpy/lib
)
......@@ -73,7 +73,7 @@ install(
else (NOT IN_CORSIKA8)
install(
TARGETS PROPOSAL
EXPORT CORSIKA8
EXPORT CORSIKA8PublicTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
......@@ -89,21 +89,37 @@ install(
FILES ${PROJECT_BINARY_DIR}/include/PROPOSAL/version.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/include/PROPOSAL
)
endif (NOT IN_CORSIKA8)
target_include_directories(
PROPOSAL PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
)
else (NOT IN_CORSIKA8)
install(
FILES ${PROJECT_BINARY_DIR}/include/PROPOSAL/version.h
DESTINATION include/PROPOSAL
)
target_include_directories(
PROPOSAL PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/>
)
endif (NOT IN_CORSIKA8)
# install header files
if (NOT IN_CORSIKA8)
file(GLOB_RECURSE INC_FILES ${PROJECT_SOURCE_DIR}/include/*)
if (NOT IN_CORSIKA8)
foreach(INC_FILE ${INC_FILES})
file(RELATIVE_PATH REL_FILE ${PROJECT_SOURCE_DIR}/include ${INC_FILE})
get_filename_component(DIR ${REL_FILE} DIRECTORY)
install(FILES include/${REL_FILE} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${DIR})
endforeach()
else (NOT IN_CORSIKA8)
foreach(INC_FILE ${INC_FILES})
file(RELATIVE_PATH REL_FILE ${PROJECT_SOURCE_DIR}/include/ ${INC_FILE})
get_filename_component(DIR ${REL_FILE} DIRECTORY)
install(FILES include/${REL_FILE} DESTINATION include/${DIR})
endforeach()
endif (NOT IN_CORSIKA8)
......@@ -195,4 +211,6 @@ install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/PROPOSALConfigVersion.cmake"
DESTINATION lib/cmake/PROPOSAL
)
else (NOT IN_CORSIKA8)
endif (NOT IN_CORSIKA8)
......@@ -30,6 +30,7 @@ if ("x_${USE_PYTHIA8_C8}" STREQUAL "x_SYSTEM")
IMPORTED_LINK_INTERFACE_LIBRARIES dl
INTERFACE_INCLUDE_DIRECTORIES "${Pythia8_INCLUDE_DIRS_CMAKE}"
)
<<<<<<< HEAD
set (Pythia8_FOUND 1 PARENT_SCOPE)