Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use FILE_SET to install the headers in /include together with the edm4hep library #235

Merged
merged 16 commits into from
Dec 5, 2023
Merged
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
3 changes: 1 addition & 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
jmcarcell marked this conversation as resolved.
Show resolved Hide resolved
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 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)

jmcarcell marked this conversation as resolved.
Show resolved Hide resolved
project(EDM4HEP LANGUAGES CXX)

Expand All @@ -9,14 +9,7 @@ SET( ${PROJECT_NAME}_VERSION_PATCH 1 )

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})
jmcarcell marked this conversation as resolved.
Show resolved Hide resolved

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)
Loading