diff --git a/.github/workflows/lcg_linux_with_podio.yml b/.github/workflows/lcg_linux_with_podio.yml index d01a41684..e811fab2f 100644 --- a/.github/workflows/lcg_linux_with_podio.yml +++ b/.github/workflows/lcg_linux_with_podio.yml @@ -14,9 +14,7 @@ jobs: include: - LCG: "dev4/x86_64-centos7-gcc11-opt" CXX_STANDARD: 17 - - LCG: "LCG_102/x86_64-centos7-clang12-opt" - CXX_STANDARD: 17 - - LCG: "LCG_102/x86_64-centos8-gcc11-opt" + - LCG: "LCG_104/x86_64-centos8-gcc11-opt" CXX_STANDARD: 17 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 80d1c3e31..11ee0a715 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -10,7 +10,7 @@ jobs: - uses: cvmfs-contrib/github-action-cvmfs@v3 - uses: aidasoft/run-lcg-view@v4 with: - release-platform: LCG_99/x86_64-centos7-clang10-opt + release-platform: LCG_104/x86_64-el9-clang16-opt run: | STARTDIR=$(pwd) echo "::group::Build podio" @@ -37,7 +37,6 @@ jobs: export PYTHONPATH=$(python -m site --user-site):$PYTHONPATH export PATH=/root/.local/bin:$PATH pip install argparse --user - pip install pre-commit --user mkdir build cd build cmake .. -DENABLE_SIO=ON \ @@ -47,6 +46,7 @@ jobs: -DUSE_EXTERNAL_CATCH2=OFF ln -s $(pwd)/compile_commands.json ../ cd .. + pip install pre-commit --user pre-commit run --show-diff-on-failure \ --color=always \ --all-files diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c7094d91..5ff1f23e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.23) project(EDM4HEP LANGUAGES CXX) @@ -9,14 +9,7 @@ SET( ${PROJECT_NAME}_VERSION_PATCH 2 ) SET( ${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}" ) - -#--- Run the podio class generator and link library ------- - find_package(podio REQUIRED HINTS $ENV{PODIO}) - -#--- Declare ROOT dependency --------------------------------------------------- -list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS}) -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) find_package(ROOT REQUIRED COMPONENTS RIO Tree Physics) #--- Define basic build settings ----------------------------------------------- @@ -104,11 +97,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/NOTICE DESTINATION ${CMAKE_INSTALL_DOCDIR}) - -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/edm4hep/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/edm4hep - FILES_MATCHING PATTERN "*.h") - find_package(nlohmann_json 3.10.5) add_subdirectory(edm4hep) diff --git a/edm4hep/CMakeLists.txt b/edm4hep/CMakeLists.txt index 1f91f0b17..16b6c10d2 100644 --- a/edm4hep/CMakeLists.txt +++ b/edm4hep/CMakeLists.txt @@ -7,6 +7,9 @@ PODIO_ADD_DATAMODEL_CORE_LIB(edm4hep "${headers}" "${sources}") add_library(EDM4HEP::edm4hep ALIAS edm4hep) set_target_properties(edm4hep PROPERTIES ALIAS_GLOBAL true) +file(GLOB_RECURSE top_headers ${PROJECT_SOURCE_DIR}/include/*.h) +target_sources(edm4hep PUBLIC FILE_SET headers TYPE HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR}/include FILES ${top_headers}) + if (nlohmann_json_FOUND) target_compile_definitions(edm4hep PUBLIC PODIO_JSON_OUTPUT) target_link_libraries(edm4hep PUBLIC nlohmann_json::nlohmann_json) @@ -29,16 +32,14 @@ install(TARGETS ${EDM4HEP_INSTALL_LIBS} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/edm4hep" + FILE_SET headers DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT dev) install(FILES "${PROJECT_BINARY_DIR}/edm4hep/edm4hepDictDict.rootmap" + "${PROJECT_BINARY_DIR}/edm4hep/libedm4hepDict_rdict.pcm" DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT dev) install(FILES ../edm4hep.yaml DESTINATION "${CMAKE_INSTALL_DATADIR}/edm4hep" COMPONENT dev) - -install(FILES - "${PROJECT_BINARY_DIR}/edm4hep/libedm4hepDict_rdict.pcm" - DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT dev)