IAP GITLAB

Skip to content
Snippets Groups Projects
Commit e2de53fc authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by Maximilian Reininghaus
Browse files

discover FLUKA also via FLUPRO env. var.

parent e0adbd93
No related branches found
No related tags found
1 merge request!516FLUKA improvements
set(C8_FLUKALIB CACHE FILEPATH "path to libflukahp.a") set(C8_FLUKALIB CACHE FILEPATH "path to libflukahp.a")
if (EXISTS "${C8_FLUKALIB}") set(C8_FLUKALIB_ "")
message("libflukahp.a found at ${C8_FLUKALIB}; FLUKA support is enabled.") if (EXISTS "$CACHE{C8_FLUKALIB}")
message("libflukahp.a found at ${C8_FLUKALIB} via C8_FLUKALIB")
set(C8_FLUKALIB_ "$CACHE{C8_FLUKALIB}")
elseif (EXISTS "$ENV{FLUPRO}/libflukahp.a")
message("libflukahp.a found in directory $ENV{FLUPRO} via FLUPRO environment variable")
set(C8_FLUKALIB_ "$ENV{FLUPRO}/libflukahp.a")
endif()
if ("${C8_FLUKALIB_}" STREQUAL "")
message("C8_FLUKALIB not set/invalid and FLUPRO not set, building without FLUKA support")
set(C8_FLUKA_ENABLED "" CACHE INTERNAL "" FORCE) # makeshift global var
else()
message("FLUKA support is enabled.")
set(C8_FLUKA_ENABLED "enabled" CACHE INTERNAL "" FORCE) # makeshift global var
set (input_dir ${PROJECT_SOURCE_DIR}/src/modules/fluka) set (input_dir ${PROJECT_SOURCE_DIR}/src/modules/fluka)
# we remove flrndm_.o from the original libflukahp.a and save the result as libflukahp-norndm.a # we remove flrndm_.o from the original libflukahp.a and save the result as libflukahp-norndm.a
...@@ -50,6 +64,4 @@ if (EXISTS "${C8_FLUKALIB}") ...@@ -50,6 +64,4 @@ if (EXISTS "${C8_FLUKALIB}")
# add fluka to corsika8 build # add fluka to corsika8 build
add_dependencies (CORSIKA8 fluka) add_dependencies (CORSIKA8 fluka)
target_link_libraries (CORSIKA8 INTERFACE fluka) target_link_libraries (CORSIKA8 INTERFACE fluka)
else()
message("C8_FLUKALIB not set/invalid, building without FLUKA support")
endif() endif()
...@@ -16,9 +16,10 @@ set (test_modules_sources ...@@ -16,9 +16,10 @@ set (test_modules_sources
testEMThinning.cpp testEMThinning.cpp
testSophia.cpp testSophia.cpp
) )
if (EXISTS "${C8_FLUKALIB}") if (NOT "$CACHE{C8_FLUKA_ENABLED}" STREQUAL "")
list(APPEND test_modules_sources "testFluka.cpp") list(APPEND test_modules_sources "testFluka.cpp")
message("testFluka enabled")
endif() endif()
CORSIKA_ADD_TEST (testModules SOURCES ${test_modules_sources}) CORSIKA_ADD_TEST (testModules SOURCES ${test_modules_sources})
......
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