Skip to content

Commit

Permalink
cmake: Get fastjetplugins.so via FindFastJet.cmake (#231)
Browse files Browse the repository at this point in the history
This saves some lines and fixes an issue on macOS where the library is called libfastjetplugins.dylib
  • Loading branch information
vvolkl authored Nov 30, 2022
1 parent 7e5fadc commit 510f677
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions addons/FastJet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ file(GLOB headers *.h)
fccanalyses_addon_build(FastJet
SOURCES ${sources} ${headers}
EXT_HEADERS ${FASTJET_INCLUDE_DIRS}
EXT_LIBS ${FASTJET_LIBRARY}
${FASTJET_LIBRARY_DIRS}/libfastjetplugins.so
EXT_LIBS ${FASTJET_LIBRARIES}
ROOT::MathCore
INSTALL_COMPONENT fastjet)
3 changes: 1 addition & 2 deletions analyzers/dataframe/case-studies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ target_link_libraries(FCCAnalysesCS
EDM4HEP::edm4hep
EDM4HEP::edm4hepDict
podio::podio
${FASTJET_LIBRARY}
${FASTJET_LIBRARY_DIRS}/libfastjetplugins.so
${FASTJET_LIBRARIES}
${acts_LIBRARY}
ActsCore
#${AWKWARD_LIBRARIES}
Expand Down
5 changes: 4 additions & 1 deletion cmake/FindFastJet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ find_path(FASTJET_INCLUDE_DIR fastjet/version.hh

find_library(FASTJET_LIBRARY NAMES fastjet
HINTS $ENV{FASTJET_ROOT_DIR}/lib ${FASTJET_ROOT_DIR}/lib)

find_library(FASTJETPLUGINS_LIBRARY NAMES fastjetplugins
HINTS $ENV{FASTJET_ROOT_DIR}/lib ${FASTJET_ROOT_DIR}/lib)

# handle the QUIETLY and REQUIRED arguments and set FASTJET_FOUND to TRUE if
# all listed variables are TRUE
Expand All @@ -22,5 +25,5 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(FastJet DEFAULT_MSG FASTJET_INCLUDE_DIR FASTJE
mark_as_advanced(FASTJET_FOUND FASTJET_INCLUDE_DIR FASTJET_LIBRARY)

set(FASTJET_INCLUDE_DIRS ${FASTJET_INCLUDE_DIR})
set(FASTJET_LIBRARIES ${FASTJET_LIBRARY})
set(FASTJET_LIBRARIES ${FASTJET_LIBRARY} ${FASTJETPLUGINS_LIBRARY})
get_filename_component(FASTJET_LIBRARY_DIRS ${FASTJET_LIBRARY} PATH)

0 comments on commit 510f677

Please sign in to comment.