IAP GITLAB

Skip to content
Snippets Groups Projects
Commit acd163db authored by ralfulrich's avatar ralfulrich
Browse files

use FindZLIB to build cnpy and dependencies

parent 1166a88e
No related branches found
No related tags found
No related merge requests found
...@@ -31,9 +31,27 @@ set ( ...@@ -31,9 +31,27 @@ set (
sgn.h sgn.h
CorsikaFenv.h CorsikaFenv.h
MetaProgramming.h MetaProgramming.h
SaveBoostHistogram.hpp
) )
set (
UTILITIES_DEPENDS
CORSIKAgeometry
CORSIKAunits
C8::ext::boost # so far only for MetaProgramming
C8::ext::eigen3 # for COMboost
)
if (TARGET cnpy)
LIST (APPEND
UTILITIES_HEADERS
SaveBoostHistogram.hpp
)
LIST (APPEND
UTILITIES_DEPENDS
cnpy # for SaveBoostHistogram
)
endif (TARGET cnpy)
set ( set (
UTILITIES_NAMESPACE UTILITIES_NAMESPACE
corsika/utl corsika/utl
...@@ -53,11 +71,7 @@ set_target_properties ( ...@@ -53,11 +71,7 @@ set_target_properties (
# target dependencies on other libraries (also the header onlys) # target dependencies on other libraries (also the header onlys)
target_link_libraries ( target_link_libraries (
CORSIKAutilities CORSIKAutilities
CORSIKAgeometry ${UTILITIES_DEPENDS}
CORSIKAunits
C8::ext::boost # so far only for MetaProgramming
C8::ext::eigen3 # for COMboost
cnpy # for SaveBoostHistogram
) )
target_include_directories ( target_include_directories (
...@@ -91,9 +105,11 @@ target_link_libraries ( ...@@ -91,9 +105,11 @@ target_link_libraries (
CORSIKAtesting CORSIKAtesting
) )
CORSIKA_ADD_TEST(testSaveBoostHistogram) if (TARGET cnpy)
target_link_libraries ( CORSIKA_ADD_TEST(testSaveBoostHistogram)
testSaveBoostHistogram target_link_libraries (
CORSIKAutilities testSaveBoostHistogram
CORSIKAtesting CORSIKAutilities
) CORSIKAtesting
)
endif (TARGET cnpy)
...@@ -35,7 +35,7 @@ message (STATUS "USE_BOOST_C8='${USE_BOOST_C8}'") ...@@ -35,7 +35,7 @@ message (STATUS "USE_BOOST_C8='${USE_BOOST_C8}'")
add_library (C8::ext::boost INTERFACE IMPORTED GLOBAL) add_library (C8::ext::boost INTERFACE IMPORTED GLOBAL)
if ("x_${USE_BOOST_C8}" STREQUAL "x_SYSTEM") if ("x_${USE_BOOST_C8}" STREQUAL "x_SYSTEM")
find_package (Boost REQUIRED mp11 iterator core format interval optional type_index histogram) find_package (Boost REQUIRED COMPONENTS mp11 iterator core format interval optional type_index histogram)
message (STATUS "Using system-level boost version ${Boost_VERSION} at ${Boost_INCLUDE_DIR}") message (STATUS "Using system-level boost version ${Boost_VERSION} at ${Boost_INCLUDE_DIR}")
set_target_properties ( set_target_properties (
...@@ -300,4 +300,13 @@ else (Boost_IOSTREAMS_FOUND) ...@@ -300,4 +300,13 @@ else (Boost_IOSTREAMS_FOUND)
) )
endif (Boost_IOSTREAMS_FOUND) endif (Boost_IOSTREAMS_FOUND)
add_subdirectory(cnpy)
# libz needed for cnpy, used for SaveHistograms
find_package (ZLIB QUIET)
if (ZLIB_FOUND)
message (STATUS "Found ZLIB. Build cnpy for SaveHistograms")
add_subdirectory (cnpy)
else (ZLIB_FOUND)
message (WARNING "Did not find ZLIB. Cannot build cnpy for SaveHistograms")
endif (ZLIB_FOUND)
...@@ -21,15 +21,13 @@ set_target_properties ( ...@@ -21,15 +21,13 @@ set_target_properties (
PROPERTIES PROPERTIES
VERSION ${PROJECT_VERSION} VERSION ${PROJECT_VERSION}
SOVERSION 1 SOVERSION 1
# PUBLIC_HEADER "${MODEL_HEADERS}"
) )
find_package(ZLIB)
# target dependencies on other libraries (also the header onlys) # target dependencies on other libraries (also the header onlys)
target_link_libraries ( target_link_libraries (
cnpy cnpy
${ZLIB_LIBRARIES} PUBLIC
ZLIB::ZLIB
) )
target_include_directories ( target_include_directories (
...@@ -43,18 +41,5 @@ install ( ...@@ -43,18 +41,5 @@ install (
TARGETS cnpy TARGETS cnpy
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib ARCHIVE DESTINATION lib
# PUBLIC_HEADER DESTINATION include/${MODEL_NAMESPACE}
) )
# --------------------
# code unit testing
# CORSIKA_ADD_TEST(testNullModel)
#target_link_libraries (
# testNullModel ProcessNullModel
# CORSIKAsetup
# CORSIKAgeometry
# CORSIKAunits
# CORSIKAthirdparty # for catch2
# )
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