Skip to content

Commit

Permalink
Use FILE_SET to install the headers in /include together with the…
Browse files Browse the repository at this point in the history
… edm4hep library (#235)
  • Loading branch information
jmcarcell authored Dec 5, 2023
1 parent d3066e5 commit 073cd9e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/lcg_linux_with_podio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 \
Expand All @@ -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
Expand Down
14 changes: 1 addition & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.23)

project(EDM4HEP LANGUAGES CXX)

Expand All @@ -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 -----------------------------------------------
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions edm4hep/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit 073cd9e

Please sign in to comment.