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

Streamlined sub-package CMakeLists.txt #306

Merged
merged 1 commit into from
Jul 21, 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 analyzers/dataframe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ message(STATUS " ====== DELPHES LIBRARY = " ${DELPHES_LIBRARY} )
message(STATUS " ====== DELPHES_EXTERNALS_TKCOV_INCLUDE_DIR = " ${DELPHES_EXTERNALS_TKCOV_INCLUDE_DIR} )


target_link_libraries(FCCAnalyses
target_link_libraries(FCCAnalyses PUBLIC
ROOT::Physics
ROOT::MathCore
ROOT::ROOTVecOps
Expand All @@ -73,11 +73,11 @@ target_link_libraries(FCCAnalyses
)

if(WITH_DD4HEP)
target_link_libraries(FCCAnalyses DD4hep::DDCore)
target_link_libraries(FCCAnalyses PUBLIC DD4hep::DDCore)
endif()

if(WITH_ACTS)
target_link_libraries(FCCAnalyses ActsCore)
target_link_libraries(FCCAnalyses PUBLIC ActsCore)
endif()

set_target_properties(FCCAnalyses PROPERTIES
Expand Down
2 changes: 2 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ if [ "${0}" != "${BASH_SOURCE}" ]; then
export PATH=${LOCAL_DIR}/install/bin:${PATH}
export LD_LIBRARY_PATH=${LOCAL_DIR}/install/lib:${LD_LIBRARY_PATH}
export CMAKE_PREFIX_PATH=${LOCAL_DIR}/install:${CMAKE_PREFIX_PATH}

export ROOT_INCLUDE_PATH=`fastjet-config --prefix`/include:${ROOT_INCLUDE_PATH}
export ROOT_INCLUDE_PATH=${LOCAL_DIR}/install/include:${ROOT_INCLUDE_PATH}

export ONNXRUNTIME_ROOT_DIR=`python -c "import onnxruntime; print(onnxruntime.__path__[0]+'/../../../..')" 2> /dev/null`
Expand Down
15 changes: 4 additions & 11 deletions templates/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
cmake_minimum_required(VERSION 3.16.9)
project(__pkgname__ CXX)
set(lib_name "FCCAnalysis___pkgname__")
find_package(ROOT COMPONENTS ROOTVecOps ROOTDataFrame REQUIRED)
find_package(EDM4HEP REQUIRED)
find_package(FCCAnalyses)
#--- Set a better default for installation directory---------------------------
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "__fccpath__/install" CACHE PATH "default install path" FORCE)
Expand All @@ -22,15 +21,9 @@ reflex_generate_dictionary(lib${lib_name} ${headers} ${classes}
#--- build the analysis library (linked against FCCAnalyses)
add_library(${lib_name} SHARED ${sources} ${headers} lib${lib_name}.cxx)
target_include_directories(${lib_name} PUBLIC include
${FCCANALYSES_DIR}
${FCCANALYSES_DIR}/addons
${FCCANALYSES_DIR}/analyzers/dataframe
$<INSTALL_INTERFACE:include>)
target_link_directories(${lib_name} PUBLIC ${FCCANALYSES_DIR}
${FCCANALYSES_DIR}/install/lib)
target_link_libraries(${lib_name} PUBLIC FCCAnalyses
EDM4HEP::edm4hep EDM4HEP::edm4hepDict
ROOT::ROOTVecOps)
$<INSTALL_INTERFACE:include>
)
target_link_libraries(${lib_name} PUBLIC FCCAnalyses::FCCAnalyses)
set_target_properties(${lib_name} PROPERTIES PUBLIC_HEADER "${headers}")
install(TARGETS ${lib_name}
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" COMPONENT bin
Expand Down