Skip to content
Snippets Groups Projects
Commit 391659ef authored by Dmitry Kalinkin's avatar Dmitry Kalinkin Committed by Andre Sailer
Browse files

cmake: by default, enforce compression support for HepMC3 v3.2.5

parent 2e064e2e
No related branches found
No related tags found
No related merge requests found
...@@ -160,9 +160,17 @@ if(DD4HEP_USE_HEPMC3) ...@@ -160,9 +160,17 @@ if(DD4HEP_USE_HEPMC3)
# Optional dependencies for compressed input support # Optional dependencies for compressed input support
if(${HEPMC3_VERSION} VERSION_GREATER_EQUAL "3.02.05") if(${HEPMC3_VERSION} VERSION_GREATER_EQUAL "3.02.05")
find_package(ZLIB) option(DD4HEP_HEPMC3_COMPRESSION_SUPPORT "Enable reading of compressed HepMC files" ON)
find_package(LibLZMA) if(${DD4HEP_HEPMC3_COMPRESSION_SUPPORT})
find_package(BZip2) find_package(ZLIB REQUIRED)
find_package(LibLZMA REQUIRED)
find_package(BZip2 REQUIRED)
endif()
else()
option(DD4HEP_HEPMC3_COMPRESSION_SUPPORT "Enable reading of compressed HepMC files" OFF)
if(${DD4HEP_HEPMC3_COMPRESSION_SUPPORT})
message(FATAL "HepMC3 v3.2.5 is required for -DDD4HEP_HEPMC3_COMPRESSION_SUPPORT=ON")
endif()
endif() endif()
endif() endif()
......
...@@ -60,31 +60,25 @@ if (DD4HEP_USE_GEANT4) ...@@ -60,31 +60,25 @@ if (DD4HEP_USE_GEANT4)
if(DD4HEP_USE_HEPMC3) if(DD4HEP_USE_HEPMC3)
set(TEST_HEPMC3_EXTENSIONS) set(TEST_HEPMC3_EXTENSIONS)
if(${HEPMC3_VERSION} VERSION_GREATER_EQUAL "3.02.05") if(${DD4HEP_HEPMC3_COMPRESSION_SUPPORT})
if(ZLIB_FOUND) file(ARCHIVE_CREATE
file(ARCHIVE_CREATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Pythia_output.hepmc.gz
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Pythia_output.hepmc.gz PATHS ${CMAKE_CURRENT_SOURCE_DIR}/inputFiles/Pythia_output.hepmc
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/inputFiles/Pythia_output.hepmc FORMAT raw
FORMAT raw COMPRESSION GZip)
COMPRESSION GZip) list(APPEND TEST_HEPMC3_EXTENSIONS .gz)
list(APPEND TEST_HEPMC3_EXTENSIONS .gz) file(ARCHIVE_CREATE
endif() OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Pythia_output.hepmc.xz
if(LIBLZMA_FOUND) PATHS ${CMAKE_CURRENT_SOURCE_DIR}/inputFiles/Pythia_output.hepmc
file(ARCHIVE_CREATE FORMAT raw
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Pythia_output.hepmc.xz COMPRESSION XZ)
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/inputFiles/Pythia_output.hepmc list(APPEND TEST_HEPMC3_EXTENSIONS .xz)
FORMAT raw file(ARCHIVE_CREATE
COMPRESSION XZ) OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Pythia_output.hepmc.bz2
list(APPEND TEST_HEPMC3_EXTENSIONS .xz) PATHS ${CMAKE_CURRENT_SOURCE_DIR}/inputFiles/Pythia_output.hepmc
endif() FORMAT raw
if(BZIP2_FOUND) COMPRESSION BZip2)
file(ARCHIVE_CREATE list(APPEND TEST_HEPMC3_EXTENSIONS .bz2)
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Pythia_output.hepmc.bz2
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/inputFiles/Pythia_output.hepmc
FORMAT raw
COMPRESSION BZip2)
list(APPEND TEST_HEPMC3_EXTENSIONS .bz2)
endif()
endif() endif()
foreach(TEST_HEPMC3_EXTENSION "" ${TEST_HEPMC3_EXTENSIONS}) foreach(TEST_HEPMC3_EXTENSION "" ${TEST_HEPMC3_EXTENSIONS})
......
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