Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rename CMAKE_{SOURCE,BIN}_DIR to PROJECT_{SOURCE,BIN}_DIR #454

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmake/podioCPack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "valentin.volkl@cern.ch")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CPACK_PACKAGE_HOMEPAGE_URL})
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "hep-root, python-yaml")

set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")

#--- source package settings ---------------------------------------------------
set(CPACK_SOURCE_IGNORE_FILES
Expand Down
2 changes: 1 addition & 1 deletion cmake/podioCreateConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/podioConfig.cmake.in

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/podioConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/podioConfigVersion.cmake
${CMAKE_SOURCE_DIR}/cmake/podioMacros.cmake
${PROJECT_SOURCE_DIR}/cmake/podioMacros.cmake
DESTINATION ${CMAKE_INSTALL_CMAKEDIR}/${PROJECT_NAME} )
install(EXPORT podioTargets
DESTINATION ${CMAKE_INSTALL_CMAKEDIR}/${PROJECT_NAME}
Expand Down
8 changes: 4 additions & 4 deletions cmake/podioTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ function(PODIO_SET_TEST_ENV test)
set_property(TEST ${test}
PROPERTY ENVIRONMENT
LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests:${CMAKE_BINARY_DIR}/src:$<TARGET_FILE_DIR:ROOT::Tree>:$<$<TARGET_EXISTS:SIO::sio>:$<TARGET_FILE_DIR:SIO::sio>>:$ENV{LD_LIBRARY_PATH}
PYTHONPATH=${CMAKE_SOURCE_DIR}/python:$ENV{PYTHONPATH}
PYTHONPATH=${PROJECT_SOURCE_DIR}/python:$ENV{PYTHONPATH}
PODIO_SIOBLOCK_PATH=${CMAKE_BINARY_DIR}/tests
ROOT_INCLUDE_PATH=${CMAKE_BINARY_DIR}/tests/datamodel:${CMAKE_SOURCE_DIR}/include
ROOT_INCLUDE_PATH=${CMAKE_BINARY_DIR}/tests/datamodel:${PROJECT_SOURCE_DIR}/include
SKIP_SIO_TESTS=$<NOT:$<BOOL:${ENABLE_SIO}>>
IO_HANDLERS=${IO_HANDLERS}
PODIO_USE_CLANG_FORMAT=${PODIO_USE_CLANG_FORMAT}
PODIO_BASE=${CMAKE_SOURCE_DIR}
PODIO_BASE=${PROJECT_SOURCE_DIR}
ENABLE_SIO=${ENABLE_SIO}
)
endfunction()
Expand All @@ -35,7 +35,7 @@ macro(PODIO_DOWNLOAD_LEGACY_INPUTS legacy_versions)
if (NOT DEFINED CACHE{PODIO_TEST_INPUT_DATA_DIR} OR NOT EXISTS ${PODIO_TEST_INPUT_DATA_DIR}/v00-16-05/example_frame.root)
message(STATUS "Getting test input files")
execute_process(
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/scripts/get_test_inputs.sh ${legacy_versions}
COMMAND bash ${PROJECT_SOURCE_DIR}/tests/scripts/get_test_inputs.sh ${legacy_versions}
OUTPUT_VARIABLE podio_test_input_data_dir
RESULT_VARIABLE test_inputs_available
)
Expand Down
6 changes: 3 additions & 3 deletions doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.

STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ @CMAKE_BINARY_DIR@
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ @CMAKE_BINARY_DIR@

# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
Expand Down Expand Up @@ -743,7 +743,7 @@ WARN_LOGFILE = @CMAKE_BINARY_DIR@/doxygen-warnings.log
# spaces.
# Note: If this tag is empty the current directory is searched.

INPUT = @CMAKE_SOURCE_DIR@
INPUT = @PROJECT_SOURCE_DIR@
INPUT += @CMAKE_BINARY_DIR@/include
INPUT += @CMAKE_CURRENT_BINARY_DIR@

Expand Down Expand Up @@ -818,7 +818,7 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).

EXAMPLE_PATH = @CMAKE_SOURCE_DIR@
EXAMPLE_PATH = @PROJECT_SOURCE_DIR@

# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
Expand Down
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/templates
DESTINATION ${podio_PYTHON_INSTALLDIR})

IF (BUILD_TESTING)
add_test( NAME pyunittest COMMAND python3 -m unittest discover -s ${CMAKE_SOURCE_DIR}/python/podio)
add_test( NAME pyunittest COMMAND python3 -m unittest discover -s ${PROJECT_SOURCE_DIR}/python/podio)
PODIO_SET_TEST_ENV(pyunittest)

set_property(TEST pyunittest PROPERTY DEPENDS write write_frame_root)
Expand Down
38 changes: 19 additions & 19 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ SET(core_sources
)

SET(core_headers
${CMAKE_SOURCE_DIR}/include/podio/CollectionBase.h
${CMAKE_SOURCE_DIR}/include/podio/CollectionIDTable.h
${CMAKE_SOURCE_DIR}/include/podio/EventStore.h
${CMAKE_SOURCE_DIR}/include/podio/ICollectionProvider.h
${CMAKE_SOURCE_DIR}/include/podio/IReader.h
${CMAKE_SOURCE_DIR}/include/podio/ObjectID.h
${CMAKE_SOURCE_DIR}/include/podio/UserDataCollection.h
${CMAKE_SOURCE_DIR}/include/podio/podioVersion.h
${CMAKE_SOURCE_DIR}/include/podio/DatamodelRegistry.h
${CMAKE_SOURCE_DIR}/include/podio/utilities/DatamodelRegistryIOHelpers.h
${PROJECT_SOURCE_DIR}/include/podio/CollectionBase.h
${PROJECT_SOURCE_DIR}/include/podio/CollectionIDTable.h
${PROJECT_SOURCE_DIR}/include/podio/EventStore.h
${PROJECT_SOURCE_DIR}/include/podio/ICollectionProvider.h
${PROJECT_SOURCE_DIR}/include/podio/IReader.h
${PROJECT_SOURCE_DIR}/include/podio/ObjectID.h
${PROJECT_SOURCE_DIR}/include/podio/UserDataCollection.h
${PROJECT_SOURCE_DIR}/include/podio/podioVersion.h
${PROJECT_SOURCE_DIR}/include/podio/DatamodelRegistry.h
${PROJECT_SOURCE_DIR}/include/podio/utilities/DatamodelRegistryIOHelpers.h
)

PODIO_ADD_LIB_AND_DICT(podio "${core_headers}" "${core_sources}" selection.xml)
Expand All @@ -94,14 +94,14 @@ if(ENABLE_RNTUPLE)
endif()

SET(root_headers
${CMAKE_SOURCE_DIR}/include/podio/ROOTFrameReader.h
${CMAKE_SOURCE_DIR}/include/podio/ROOTLegacyReader.h
${CMAKE_SOURCE_DIR}/include/podio/ROOTFrameWriter.h
${PROJECT_SOURCE_DIR}/include/podio/ROOTFrameReader.h
${PROJECT_SOURCE_DIR}/include/podio/ROOTLegacyReader.h
${PROJECT_SOURCE_DIR}/include/podio/ROOTFrameWriter.h
)
if(ENABLE_RNTUPLE)
list(APPEND root_headers
${CMAKE_SOURCE_DIR}/include/podio/ROOTNTupleReader.h
${CMAKE_SOURCE_DIR}/include/podio/ROOTNTupleWriter.h
${PROJECT_SOURCE_DIR}/include/podio/ROOTNTupleReader.h
${PROJECT_SOURCE_DIR}/include/podio/ROOTNTupleWriter.h
)
endif()

Expand All @@ -119,7 +119,7 @@ SET(python_sources
)

SET(python_headers
${CMAKE_SOURCE_DIR}/include/podio/PythonEventStore.h
${PROJECT_SOURCE_DIR}/include/podio/PythonEventStore.h
)
PODIO_ADD_LIB_AND_DICT(podioPythonStore "${python_headers}" "${python_sources}" python_selection.xml)
target_link_libraries(podioPythonStore PUBLIC podio::podio)
Expand All @@ -140,9 +140,9 @@ if(ENABLE_SIO)
)

SET(sio_headers
${CMAKE_SOURCE_DIR}/include/podio/SIOFrameReader.h
${CMAKE_SOURCE_DIR}/include/podio/SIOLegacyReader.h
${CMAKE_SOURCE_DIR}/include/podio/SIOFrameWriter.h
${PROJECT_SOURCE_DIR}/include/podio/SIOFrameReader.h
${PROJECT_SOURCE_DIR}/include/podio/SIOLegacyReader.h
${PROJECT_SOURCE_DIR}/include/podio/SIOFrameWriter.h
)

PODIO_ADD_LIB_AND_DICT(podioSioIO "${sio_headers}" "${sio_sources}" sio_selection.xml)
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ foreach( _conf ${CMAKE_CONFIGURATION_TYPES} )
endforeach()

# Set the podio_PYTHON_DIR manually here because the macros below expect it
SET(podio_PYTHON_DIR ${CMAKE_SOURCE_DIR}/python)
SET(podio_PYTHON_DIR ${PROJECT_SOURCE_DIR}/python)

PODIO_GENERATE_DATAMODEL(datamodel datalayout.yaml headers sources
IO_BACKEND_HANDLERS ${PODIO_IO_HANDLERS}
Expand Down
20 changes: 10 additions & 10 deletions tests/dumpmodel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Add tests for storing and retrieving the EDM definitions into the produced
# files
add_test(NAME datamodel_def_store_roundtrip_root COMMAND ${CMAKE_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh
add_test(NAME datamodel_def_store_roundtrip_root COMMAND ${PROJECT_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh
${CMAKE_BINARY_DIR}/tests/root_io/example_frame.root
datamodel
${CMAKE_SOURCE_DIR}/tests
${PROJECT_SOURCE_DIR}/tests
)
PODIO_SET_TEST_ENV(datamodel_def_store_roundtrip_root)

# The extension model needs to know about the upstream model for generation
add_test(NAME datamodel_def_store_roundtrip_root_extension COMMAND
${CMAKE_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh
${PROJECT_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh
${CMAKE_BINARY_DIR}/tests/root_io/example_frame.root
extension_model
${CMAKE_SOURCE_DIR}/tests/extension_model
--upstream-edm=datamodel:${CMAKE_SOURCE_DIR}/tests/datalayout.yaml
${PROJECT_SOURCE_DIR}/tests/extension_model
--upstream-edm=datamodel:${PROJECT_SOURCE_DIR}/tests/datalayout.yaml
)
PODIO_SET_TEST_ENV(datamodel_def_store_roundtrip_root_extension)

Expand All @@ -27,18 +27,18 @@ set_tests_properties(

set(sio_roundtrip_tests "")
if (ENABLE_SIO)
add_test(NAME datamodel_def_store_roundtrip_sio COMMAND ${CMAKE_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh
add_test(NAME datamodel_def_store_roundtrip_sio COMMAND ${PROJECT_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh
${CMAKE_BINARY_DIR}/tests/sio_io/example_frame.sio
datamodel
${CMAKE_SOURCE_DIR}/tests
${PROJECT_SOURCE_DIR}/tests
)
PODIO_SET_TEST_ENV(datamodel_def_store_roundtrip_sio)
# The extension model needs to know about the upstream model for generation
add_test(NAME datamodel_def_store_roundtrip_sio_extension COMMAND ${CMAKE_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh
add_test(NAME datamodel_def_store_roundtrip_sio_extension COMMAND ${PROJECT_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh
${CMAKE_BINARY_DIR}/tests/sio_io/example_frame.sio
extension_model
${CMAKE_SOURCE_DIR}/tests/extension_model
--upstream-edm=datamodel:${CMAKE_SOURCE_DIR}/tests/datalayout.yaml
${PROJECT_SOURCE_DIR}/tests/extension_model
--upstream-edm=datamodel:${PROJECT_SOURCE_DIR}/tests/datalayout.yaml
)
PODIO_SET_TEST_ENV(datamodel_def_store_roundtrip_sio_extension)

Expand Down