Skip to content

Commit

Permalink
Rename cmake option to enable sio support
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 16, 2020
1 parent dee3403 commit a8a23ea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/scripts/compile_and_test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

SIO_HANDLERS=${USE_SIO:-OFF}
ENABLE_SIO=${USE_SIO:-OFF}

# Depending on whether we need SIO or not setup the environment accordingly
if [ ${SIO_HANDLERS} = "OFF" ]; then
if [ ${ENABLE_SIO} = "OFF" ]; then
source /cvmfs/sft.cern.ch/lcg/views/${VIEW}/setup.sh
else
source /cvmfs/clicdp.cern.ch/iLCSoft/${VIEW}/init_ilcsoft.sh
Expand All @@ -16,7 +16,7 @@ cd /Package
source init.sh
mkdir build install
cd build
cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_STANDARD=17 -DSIO_HANDLERS=${SIO_HANDLERS} -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " -G Ninja .. && \
cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_STANDARD=17 -DENABLE_SIO=${ENABLE_SIO} -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " -G Ninja .. && \
ninja -k0 && \
ninja install && \
ctest --output-on-failure
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ endif()

#--- Declare options -----------------------------------------------------------
option(CREATE_DOC "Whether or not to create doxygen doc target." OFF)
option(SIO_HANDLERS "Build the SIO block handlers and readers and writers." OFF)
option(ENABLE_SIO "Build the SIO block handlers and readers and writers." OFF)

#--- Declare ROOT dependency ---------------------------------------------------
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
Expand All @@ -81,7 +81,7 @@ if(ROOT_VERSION VERSION_LESS 6.14)
endif()

#--- optionally build with SIO -------------------------------------------------
if(SIO_HANDLERS)
if(ENABLE_SIO)
find_package( SIO REQUIRED)
if (SIO_FOUND)
MESSAGE( STATUS "Found SIO library - will build SIO I/O support" )
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ file(GLOB sources *.cc)
SET(root_sources ${sources})

# --- Store the sources for sio into a separate list
if(SIO_HANDLERS)
if(ENABLE_SIO)
SET(sio_sources ${sources})
LIST(FILTER sio_sources INCLUDE REGEX SIO.*)
endif()
Expand Down Expand Up @@ -57,7 +57,7 @@ set_target_properties(podioDict-dictgen PROPERTIES EXCLUDE_FROM_ALL TRUE)
target_sources(podioDict PRIVATE podioDict.cxx)

# SIO I/O library
if(SIO_HANDLERS)
if(ENABLE_SIO)
add_library(podioSioIO SHARED ${sio_sources})
add_library(podio::podioSioIO ALIAS podioSioIO)
target_include_directories(podioSioIO PUBLIC
Expand Down
8 changes: 4 additions & 4 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ endforeach()

PODIO_GENERATE_DATAMODEL(datamodel datalayout.yaml headers sources)

if (SIO_HANDLERS)
if (ENABLE_SIO)
# Filter out the sio block handlers to avoid polluting the TestDataModel lib
# with sio related things
SET(sio_headers ${headers})
Expand Down Expand Up @@ -40,7 +40,7 @@ PODIO_GENERATE_DICTIONARY(TestDataModelDict ${headers} SELECTION src/selection.x
set_target_properties(TestDataModelDict-dictgen PROPERTIES EXCLUDE_FROM_ALL TRUE)
add_dependencies(TestDataModelDict TestDataModel)

if (SIO_HANDLERS)
if (ENABLE_SIO)
add_library(TestDataModelSioBlocks SHARED ${sio_sources} ${sio_headers})
target_link_libraries(TestDataModelSioBlocks PUBLIC podio::podio)
target_include_directories(TestDataModelSioBlocks PUBLIC
Expand Down Expand Up @@ -78,7 +78,7 @@ foreach( sourcefile ${independent_tests} )
endforeach()


if (SIO_HANDLERS)
if (ENABLE_SIO)
set(sio_dependent_tests write_sio.cpp read_sio.cpp )
set(sio_libs podio::podioSioIO)
foreach( sourcefile ${sio_dependent_tests} )
Expand All @@ -89,7 +89,7 @@ endif()
#--- set some dependencies between the different tests to ensure input generating ones are run first
set_property(TEST read PROPERTY DEPENDS write)
set_property(TEST read-multiple PROPERTY DEPENDS write)
if (SIO_HANDLERS)
if (ENABLE_SIO)
set_property(TEST read_sio PROPERTY DEPENDS write_sio)
endif()

Expand Down

0 comments on commit a8a23ea

Please sign in to comment.