IAP GITLAB

Commit 820f042b authored by Ralf Ulrich's avatar Ralf Ulrich

Merge branch 'cmake_export' into 'master'

cmake export

See merge request !3
parents 18021520 c9cad675
Pipeline #3285 passed with stage
in 3 minutes and 12 seconds
......@@ -7,6 +7,13 @@ set (CMAKE_Fortran_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/src/ -I${CMAKE_CURRENT_B
message ("***** Configuring CxRoot/CONEX version")
set (MODEL_HEADERS
src/conexConfig.h
src/conexHEModels.h
${CMAKE_CURRENT_BINARY_DIR}/src/conexConfigAuto.h
)
#+++++++++++++++++++++++++++++
# Location, saved in conexConfigAuto.h
#
......@@ -88,25 +95,24 @@ foreach (MODEL ${MODELS})
set_target_properties (
CONEX${MODEL}
PROPERTIES
# INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/src/;${CMAKE_CURRENT_BINARY_DIR}/src/;${CMAKE_CURRENT_SOURCE_DIR}/src/urqmd13/"
COMPILE_OPTIONS "-std=legacy;-Wfunction-elimination;-w;-fno-second-underscore;-fno-automatic;-Wno-conversion"
COMPILE_DEFINITIONS "${${MODEL_DEF}};CX_NO_ROOT;CORSIKA_8;__CORSIKA8__;__URQMD__;__CXSUB__;CORSIKA_DATA=${CORSIKA_DATA}"
POSITION_INDEPENDENT_CODE 1
LINK_LIBRARIES CorsikaData
)
target_include_directories (
CONEX${MODEL}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/urqmd13/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/modules/conex>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/modules/urqmd>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include/conex>
)
# make sure to link to actual model library
target_link_libraries (
CONEX${MODEL}
CorsikaData
${OBJ_${MODEL}}
UrQMD_static # AND urqmd
)
......@@ -127,14 +133,24 @@ foreach (MODEL ${MODELS})
add_dependencies (CORSIKA8 CONEX${MODEL})
target_link_libraries (CORSIKA8 INTERFACE CONEX${MODEL})
#
# install and export
#
install (
TARGETS CONEX${MODEL}
EXPORT CORSIKA8
EXPORT CORSIKA8PublicTargets
DESTINATION lib
PUBLIC_HEADER DESTINATION include/modules/conex
PUBLIC_HEADER DESTINATION include/conex
)
endforeach ()
#
# also install headers
#
install (
FILES ${MODEL_HEADERS}
DESTINATION include/conex
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment