IAP GITLAB

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

make conex work

parent 01dd5920
No related branches found
No related tags found
1 merge request!191Resolve "Runtime error with pythia"
......@@ -136,6 +136,22 @@ else (WITH_PYTHIA8)
find_package (Pythia8) # if not found here, will automatically pick ThirdParty version
endif (WITH_PYTHIA8)
# check for CxRoot/CONEX: either use ThirdParty/cxroot or system-level installation
message ("***** Configuring CxRoot/CONEX version")
if (WITH_CONEX)
string (TOLOWER ${WITH_CONEX} WITH_CONEX_LOWER)
if ("x_${WITH_CONEX_LOWER}" STREQUAL "x_c8")
message ("Use CONEX from ThirdParty folder")
else ()
message ("Searching CxRoot/CONEX installed at location ${WITH_CONEX}")
set (CONEX_DIR ${WITH_CONEX})
find_package (CONEX REQUIRED)
endif ()
else (WITH_CONEX)
message ("Searching CxRoot/CONEX installed at system-level")
find_package (CONEX) # if not found here, will automatically pick ThirdParty version
endif (WITH_CONEX)
# check for Eigen3: either use ThirdParty/eigen3 or system-level installation
message ("***** Configuring eigen3 version")
if (WITH_EIGEN3)
......
......@@ -8,6 +8,9 @@ add_subdirectory (QGSJetII)
if (Pythia8_FOUND)
add_subdirectory (Pythia)
endif (Pythia8_FOUND)
if (CONEX_FOUND)
add_subdirectory (CONEX)
endif (CONEX_FOUND)
add_subdirectory (HadronicElasticModel)
add_subdirectory (UrQMD)
......
......@@ -50,13 +50,6 @@ target_include_directories (
$<INSTALL_INTERFACE:include/include>
)
target_include_directories (
ProcessPythia8
SYSTEM
PUBLIC ${PYTHIA8_INCLUDE_DIR}
INTERFACE ${PYTHIA8_INCLUDE_DIR}
)
install (
TARGETS ProcessPythia8
LIBRARY DESTINATION lib
......
......@@ -160,3 +160,58 @@ else (NOT Pythia8_FOUND)
endif (NOT Pythia8_FOUND)
# CONEX/CXROOT
add_library (CORSIKAconex STATIC IMPORTED GLOBAL)
if (NOT CONEX_FOUND)
message ("Building ThirdParty/cxroot is obtained via git and compiled")
message ("This will take a bit.....")
ExternalProject_Add (cxroot
GIT_REPOSITORY https://gitlab.ikp.kit.edu/AirShowerPhysics/cxroot.git
GIT_TAG origin/master
GIT_SHALLOW 1
GIT_PROGRESS 1
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/cxroot/source
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/cxroot/source
CONFIGURE_COMMAND ""
BUILD_COMMAND make CX_NO_ROOT=1 all
INSTALL_COMMAND ""
BUILD_IN_SOURCE ON
EXCLUDE_FROM_ALL TRUE
)
set (HAVE_CONEX 1 CACHE BOOL "presence of conex, via external-project-add in ThirdParty folder")
set (CONEX_FOUND 1 PARENT_SCOPE)
ExternalProject_Get_Property (cxroot INSTALL_DIR)
set (CONEX_PREFIX ${INSTALL_DIR})
set (CONEX_INCLUDE_DIR ${CONEX_PREFIX}/src)
set (CONEX_INCLUDE_DIR ${CONEX_PREFIX}/src PARENT_SCOPE)
add_dependencies (CORSIKAconex cxroot)
# create include directory at config time
file (MAKE_DIRECTORY ${CONEX_INCLUDE_DIR})
set (CONEX_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/externals/cxroot)
install (DIRECTORY ${INSTALL_DIR}/ DESTINATION ${CONEX_INSTALL_DIR})
set_target_properties (
CORSIKAconex PROPERTIES
IMPORTED_LOCATION ${CONEX_PREFIX}/lib/Linux/libCONEXdynamic.a
IMPORTED_LINK_INTERFACE_LIBRARIES dl
INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CONEX_INCLUDE_DIR}>
)
else (NOT CONEX_FOUND)
message ("Using system-level CONEX version at ${CXROOT_INCLUDE_DIR}")
set_target_properties (
CORSIKAconex PROPERTIES
IMPORTED_LOCATION ${CONEX_PREFIX}/lib/${CMAKE_SYSTEM_NAME}/libCONEXdynamic.a
IMPORTED_LINK_INTERFACE_LIBRARIES dl
INTERFACE_INCLUDE_DIRECTORIES ${CONEX_INCLUDE_DIR}
)
endif (NOT CONEX_FOUND)
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