diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eaf6879704..e33c42eb00 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ ci: - skip: [clang-format,cmake-format] + skip: [clang-format] repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 620313db24..724b798850 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,19 +40,27 @@ set_git_version(CMAKE_PROJECT_VERSION) # Set a default build type if none was specified set(default_build_type "Release") if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to '${default_build_type}' as none was specified.") - set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE - STRING "Choose the type of build." FORCE) + message( + STATUS + "Setting build type to '${default_build_type}' as none was specified.") + set(CMAKE_BUILD_TYPE + "${default_build_type}" + CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Release" "MinSizeRel" "RelWithDebInfo") + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo") endif() # Set default standard to C++20 set(CMAKE_CXX_STANDARD_MIN 20) -set(CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD_MIN} CACHE STRING "C++ standard to be used") +set(CMAKE_CXX_STANDARD + ${CMAKE_CXX_STANDARD_MIN} + CACHE STRING "C++ standard to be used") if(CMAKE_CXX_STANDARD LESS CMAKE_CXX_STANDARD_MIN) - message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD} (at least ${CMAKE_CXX_STANDARD_MIN} required)") + message( + FATAL_ERROR + "Unsupported C++ standard: ${CMAKE_CXX_STANDARD} (at least ${CMAKE_CXX_STANDARD_MIN} required)" + ) endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -60,20 +68,24 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Export compile commands as json for run-clang-tidy set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -# This PROJECT_SOURCE_DIR at this point corresponds to repository root. -# Saving it as EICRECON_SOURCE_DIR so can be used for jana_plugin.cmake -# to correctly set plugin includes (and in other places as needed) +# This PROJECT_SOURCE_DIR at this point corresponds to repository root. Saving +# it as EICRECON_SOURCE_DIR so can be used for jana_plugin.cmake to correctly +# set plugin includes (and in other places as needed) set(EICRECON_SOURCE_DIR ${PROJECT_SOURCE_DIR}) # Also use clang-tidy integration in CMake option(ENABLE_CLANG_TIDY "Enable clang-tidy integration in cmake" OFF) if(ENABLE_CLANG_TIDY) find_program(CLANG_TIDY_EXE NAMES "clang-tidy") - if (CLANG_TIDY_EXE) + if(CLANG_TIDY_EXE) message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") - set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}" CACHE STRING "" FORCE) + set(CMAKE_CXX_CLANG_TIDY + "${CLANG_TIDY_EXE}" + CACHE STRING "" FORCE) else() - set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE) + set(CMAKE_CXX_CLANG_TIDY + "" + CACHE STRING "" FORCE) endif() endif() @@ -81,8 +93,10 @@ endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) # Install to the top directory by default -if( ${CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT} ) - set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR} CACHE PATH "Install in top directory by default" FORCE) +if(${CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT}) + set(CMAKE_INSTALL_PREFIX + ${CMAKE_SOURCE_DIR} + CACHE PATH "Install in top directory by default" FORCE) endif() # Install to standard location @@ -90,37 +104,41 @@ include(GNUInstallDirs) # Default plugins installation directory is 'plugins' if(NOT DEFINED PLUGIN_OUTPUT_DIRECTORY) - set(PLUGIN_OUTPUT_DIRECTORY "lib/${PROJECT_NAME}/plugins") - message(STATUS "${CMAKE_PROJECT_NAME}: Set default PLUGIN_OUTPUT_DIRECTORY") + set(PLUGIN_OUTPUT_DIRECTORY "lib/${PROJECT_NAME}/plugins") + message(STATUS "${CMAKE_PROJECT_NAME}: Set default PLUGIN_OUTPUT_DIRECTORY") endif() -message(STATUS "${CMAKE_PROJECT_NAME}: PLUGIN_OUTPUT_DIRECTORY: ${PLUGIN_OUTPUT_DIRECTORY}") +message( + STATUS + "${CMAKE_PROJECT_NAME}: PLUGIN_OUTPUT_DIRECTORY: ${PLUGIN_OUTPUT_DIRECTORY}" +) # Default plugins static libraries installation directory is 'lib' if(NOT DEFINED PLUGIN_LIBRARY_OUTPUT_DIRECTORY) - set(PLUGIN_LIBRARY_OUTPUT_DIRECTORY "lib") - message(STATUS "${CMAKE_PROJECT_NAME}: Set default PLUGIN_OUTPUT_DIRECTORY") + set(PLUGIN_LIBRARY_OUTPUT_DIRECTORY "lib") + message(STATUS "${CMAKE_PROJECT_NAME}: Set default PLUGIN_OUTPUT_DIRECTORY") endif() -message(STATUS "${CMAKE_PROJECT_NAME}: PLUGIN_LIBRARY_OUTPUT_DIRECTORY: ${PLUGIN_LIBRARY_OUTPUT_DIRECTORY}") - +message( + STATUS + "${CMAKE_PROJECT_NAME}: PLUGIN_LIBRARY_OUTPUT_DIRECTORY: ${PLUGIN_LIBRARY_OUTPUT_DIRECTORY}" +) -# Use, i.e. don't skip the full RPATH for the build tree, -# and use relative paths for relocatable build products +# Use, i.e. don't skip the full RPATH for the build tree, and use relative paths +# for relocatable build products set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE) -# When building, don't use the install RPATH already -# (but later on when installing) +# When building, don't use the install RPATH already (but later on when +# installing) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_SKIP_INSTALL_RPATH FALSE) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${PLUGIN_LIBRARY_OUTPUT_DIRECTORY};${CMAKE_INSTALL_PREFIX}/${PLUGIN_OUTPUT_DIRECTORY}" ) -# Add the automatically determined parts of the RPATH -# which point to directories outside the build tree to the install RPATH +# Add the automatically determined parts of the RPATH which point to directories +# outside the build tree to the install RPATH set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - # Check and print what JANA2 is used find_package(JANA 2.0.8 REQUIRED) message(STATUS "${CMAKE_PROJECT_NAME}: JANA2 CMake : ${JANA_DIR}") @@ -146,102 +164,142 @@ find_package(spdlog REQUIRED) find_package(Microsoft.GSL CONFIG) # Remove PODIO_JSON_OUTPUT (ref: https://github.com/AIDASoft/podio/issues/475) -get_target_property(EDM4HEP_INTERFACE_COMPILE_DEFINITIONS EDM4HEP::edm4hep INTERFACE_COMPILE_DEFINITIONS) +get_target_property(EDM4HEP_INTERFACE_COMPILE_DEFINITIONS EDM4HEP::edm4hep + INTERFACE_COMPILE_DEFINITIONS) if(EDM4HEP_INTERFACE_COMPILE_DEFINITIONS) - list(FILTER EDM4HEP_INTERFACE_COMPILE_DEFINITIONS EXCLUDE REGEX [[^PODIO_JSON_OUTPUT$]]) - set_property(TARGET EDM4HEP::edm4hep PROPERTY INTERFACE_COMPILE_DEFINITIONS ${EDM4HEP_INTERFACE_COMPILE_DEFINITIONS}) + list(FILTER EDM4HEP_INTERFACE_COMPILE_DEFINITIONS EXCLUDE REGEX + [[^PODIO_JSON_OUTPUT$]]) + set_property( + TARGET EDM4HEP::edm4hep PROPERTY INTERFACE_COMPILE_DEFINITIONS + ${EDM4HEP_INTERFACE_COMPILE_DEFINITIONS}) endif() -get_target_property(EDM4EIC_INTERFACE_COMPILE_DEFINITIONS EDM4EIC::edm4eic INTERFACE_COMPILE_DEFINITIONS) +get_target_property(EDM4EIC_INTERFACE_COMPILE_DEFINITIONS EDM4EIC::edm4eic + INTERFACE_COMPILE_DEFINITIONS) if(EDM4EIC_INTERFACE_COMPILE_DEFINITIONS) - list(FILTER EDM4EIC_INTERFACE_COMPILE_DEFINITIONS EXCLUDE REGEX [[^PODIO_JSON_OUTPUT$]]) - set_property(TARGET EDM4EIC::edm4eic PROPERTY INTERFACE_COMPILE_DEFINITIONS ${EDM4EIC_INTERFACE_COMPILE_DEFINITIONS}) + list(FILTER EDM4EIC_INTERFACE_COMPILE_DEFINITIONS EXCLUDE REGEX + [[^PODIO_JSON_OUTPUT$]]) + set_property( + TARGET EDM4EIC::edm4eic PROPERTY INTERFACE_COMPILE_DEFINITIONS + ${EDM4EIC_INTERFACE_COMPILE_DEFINITIONS}) endif() # DD4Hep is required for the most of the part find_package(DD4hep REQUIRED) -# ACTS -# cmake-lint: disable=C0103 -find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep) +# ACTS cmake-lint: disable=C0103 +find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo + PluginDD4hep) set(Acts_VERSION_MIN "19.0.0") -set(Acts_VERSION "${Acts_VERSION_MAJOR}.${Acts_VERSION_MINOR}.${Acts_VERSION_PATCH}") -if(${Acts_VERSION} VERSION_LESS ${Acts_VERSION_MIN} - AND NOT "${Acts_VERSION}" STREQUAL "9.9.9") - message(FATAL_ERROR "Acts version ${Acts_VERSION_MIN} or higher required, but ${Acts_VERSION} found") +set(Acts_VERSION + "${Acts_VERSION_MAJOR}.${Acts_VERSION_MINOR}.${Acts_VERSION_PATCH}") +if(${Acts_VERSION} VERSION_LESS ${Acts_VERSION_MIN} AND NOT "${Acts_VERSION}" + STREQUAL "9.9.9") + message( + FATAL_ERROR + "Acts version ${Acts_VERSION_MIN} or higher required, but ${Acts_VERSION} found" + ) endif() # ActsCore get_target_property(ACTS_COMPILE_FEATURES ActsCore INTERFACE_COMPILE_FEATURES) -if (NOT "cxx_std_${CMAKE_CXX_STANDARD}" IN_LIST ACTS_COMPILE_FEATURES) - message(WARNING "Acts has not been built with the requested C++ standard ${CMAKE_CXX_STANDARD}.") +if(NOT "cxx_std_${CMAKE_CXX_STANDARD}" IN_LIST ACTS_COMPILE_FEATURES) + message( + WARNING + "Acts has not been built with the requested C++ standard ${CMAKE_CXX_STANDARD}." + ) endif() # ROOT find_package(ROOT REQUIRED) # Check that ROOT is compiled with a modern enough c++ standard get_target_property(ROOT_COMPILE_FEATURES ROOT::Core INTERFACE_COMPILE_FEATURES) -if (NOT "cxx_std_${CMAKE_CXX_STANDARD}" IN_LIST ROOT_COMPILE_FEATURES) - message(WARNING "ROOT has not been built with the requested C++ standard ${CMAKE_CXX_STANDARD}.") +if(NOT "cxx_std_${CMAKE_CXX_STANDARD}" IN_LIST ROOT_COMPILE_FEATURES) + message( + WARNING + "ROOT has not been built with the requested C++ standard ${CMAKE_CXX_STANDARD}." + ) endif() # Add CMake additional functionality: -include(cmake/jana_plugin.cmake) # Add common settings for plugins -list (APPEND CMAKE_MODULE_PATH ${EICRECON_SOURCE_DIR}/cmake) # Find Find.cmake +include(cmake/jana_plugin.cmake) # Add common settings for plugins +list(APPEND CMAKE_MODULE_PATH ${EICRECON_SOURCE_DIR}/cmake +)# Find Find.cmake enable_testing() # Address sanitizer option(USE_ASAN "Compile with address sanitizer" OFF) -if (${USE_ASAN}) - add_compile_options(-fsanitize=address -fno-omit-frame-pointer -g -O1) - add_link_options(-fsanitize=address) - install(FILES .github/asan.supp .github/lsan.supp DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) +if(${USE_ASAN}) + add_compile_options(-fsanitize=address -fno-omit-frame-pointer -g -O1) + add_link_options(-fsanitize=address) + install(FILES .github/asan.supp .github/lsan.supp + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) endif() # Thread sanitizer option(USE_TSAN "Compile with thread sanitizer" OFF) -if (${USE_TSAN}) - add_compile_options(-fsanitize=thread -g -O1) - add_link_options(-fsanitize=thread) - install(FILES .github/tsan.supp DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) +if(${USE_TSAN}) + add_compile_options(-fsanitize=thread -g -O1) + add_link_options(-fsanitize=thread) + install(FILES .github/tsan.supp + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) endif() # Undefined behavior sanitizer option(USE_UBSAN "Compile with undefined behavior sanitizer" OFF) -if (${USE_UBSAN}) - foreach (sanitizer undefined float-divide-by-zero unsigned-integer-overflow implicit-conversion local-bounds nullability) - check_cxx_compiler_flag("-fsanitize=${sanitizer}" CXX_COMPILER_HAS_sanitize_${sanitizer}) - if (CXX_COMPILER_HAS_sanitize_${sanitizer}) - add_compile_options(-fsanitize=${sanitizer}) - add_link_options(-fsanitize=${sanitizer}) - endif() - endforeach() - add_compile_options(-g -O1) - install(FILES .github/ubsan.supp DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) +if(${USE_UBSAN}) + foreach(sanitizer undefined float-divide-by-zero unsigned-integer-overflow + implicit-conversion local-bounds nullability) + check_cxx_compiler_flag("-fsanitize=${sanitizer}" + CXX_COMPILER_HAS_sanitize_${sanitizer}) + if(CXX_COMPILER_HAS_sanitize_${sanitizer}) + add_compile_options(-fsanitize=${sanitizer}) + add_link_options(-fsanitize=${sanitizer}) + endif() + endforeach() + add_compile_options(-g -O1) + install(FILES .github/ubsan.supp + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) endif() # Compress debug symbols if supported check_cxx_compiler_flag("-gz" CXX_COMPILER_HAS_gz) -if (CXX_COMPILER_HAS_gz) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -gz") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -gz") +if(CXX_COMPILER_HAS_gz) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -gz") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -gz") endif() -add_subdirectory( src/services ) -add_subdirectory( src/algorithms ) -add_subdirectory( src/benchmarks ) -add_subdirectory( src/detectors ) -add_subdirectory( src/examples ) -add_subdirectory( src/extensions ) -add_subdirectory( src/factories ) -add_subdirectory( src/global ) -add_subdirectory( src/scripts ) -add_subdirectory( src/tests ) -add_subdirectory( src/utilities ) +add_subdirectory(src/services) +add_subdirectory(src/algorithms) +add_subdirectory(src/benchmarks) +add_subdirectory(src/detectors) +add_subdirectory(src/examples) +add_subdirectory(src/extensions) +add_subdirectory(src/factories) +add_subdirectory(src/global) +add_subdirectory(src/scripts) +add_subdirectory(src/tests) +add_subdirectory(src/utilities) # Install all cmake helpers include(CMakePackageConfigHelpers) -configure_package_config_file(cmake/${PROJECT_NAME}Config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) -write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake VERSION ${CMAKE_PROJECT_VERSION} COMPATIBILITY SameMajorVersion) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) -install(EXPORT ${PROJECT_NAME}Targets NAMESPACE ${PROJECT_NAME}:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) -install(DIRECTORY cmake/ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} FILES_MATCHING PATTERN *.cmake) +configure_package_config_file( + cmake/${PROJECT_NAME}Config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake + VERSION ${CMAKE_PROJECT_VERSION} + COMPATIBILITY SameMajorVersion) +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) +install( + EXPORT ${PROJECT_NAME}Targets + NAMESPACE ${PROJECT_NAME}:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) +install( + DIRECTORY cmake/ + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} + FILES_MATCHING + PATTERN *.cmake) diff --git a/cmake/FindFastJet.cmake b/cmake/FindFastJet.cmake index d028f7f386..b696133539 100644 --- a/cmake/FindFastJet.cmake +++ b/cmake/FindFastJet.cmake @@ -1,23 +1,22 @@ -# - Locate FastJet library -# Defines: +# * Locate FastJet library Defines: # -# FASTJET_FOUND -# FASTJET_INCLUDE_DIR -# FASTJET_INCLUDE_DIRS (not cached) -# FASTJET_LIBRARY -# FASTJET_LIBRARIES (not cached) -# FASTJET_LIBRARY_DIRS (not cached) +# FASTJET_FOUND FASTJET_INCLUDE_DIR FASTJET_INCLUDE_DIRS (not cached) +# FASTJET_LIBRARY FASTJET_LIBRARIES (not cached) FASTJET_LIBRARY_DIRS (not +# cached) find_path(FASTJET_INCLUDE_DIR fastjet/version.hh HINTS $ENV{FASTJET_ROOT}/include ${FASTJET_ROOT_DIR}/include) -find_library(FASTJET_LIBRARY NAMES fastjet - HINTS $ENV{FASTJET_ROOT}/lib ${FASTJET_ROOT_DIR}/lib) +find_library( + FASTJET_LIBRARY + NAMES fastjet + HINTS $ENV{FASTJET_ROOT}/lib ${FASTJET_ROOT_DIR}/lib) -# handle the QUIETLY and REQUIRED arguments and set FASTJET_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(FastJet DEFAULT_MSG FASTJET_INCLUDE_DIR FASTJET_LIBRARY) +# handle the QUIETLY and REQUIRED arguments and set FASTJET_FOUND to TRUE if all +# listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FastJet DEFAULT_MSG FASTJET_INCLUDE_DIR + FASTJET_LIBRARY) mark_as_advanced(FASTJET_FOUND FASTJET_INCLUDE_DIR FASTJET_LIBRARY) diff --git a/cmake/git_version.cmake b/cmake/git_version.cmake index 486115c379..98e013cfe2 100644 --- a/cmake/git_version.cmake +++ b/cmake/git_version.cmake @@ -1,5 +1,4 @@ -# Determine version from git describe -# cmake-lint: disable=C0103 +# Determine version from git describe cmake-lint: disable=C0103 macro(set_git_version VERSION) if(NOT Git_Found) find_package(Git) @@ -18,10 +17,13 @@ macro(set_git_version VERSION) endif() endif() - # Final fallback: Just use a bogus version string that is semantically older than anything else and spit out a warning - # to the developer. + # Final fallback: Just use a bogus version string that is semantically older + # than anything else and spit out a warning to the developer. if(NOT DEFINED ${VERSION}) set(${VERSION} v0.0.0-unknown) - message(WARNING "Failed to determine VERSION from Git tags. Using default version \"${${VERSION}}\".") + message( + WARNING + "Failed to determine VERSION from Git tags. Using default version \"${${VERSION}}\"." + ) endif() endmacro() diff --git a/cmake/jana_plugin.cmake b/cmake/jana_plugin.cmake index 24b1c3608f..8450bcc055 100644 --- a/cmake/jana_plugin.cmake +++ b/cmake/jana_plugin.cmake @@ -4,366 +4,375 @@ include(GNUInstallDirs) # Common macro to add plugins macro(plugin_add _name) - # Default to plugin without library - set(${_name}_WITH_LIBRARY OFF) - set(${_name}_WITH_PLUGIN ON) - - # Check if build with library - foreach(arg IN ITEMS ${ARGN}) - if(${arg} STREQUAL "WITH_STATIC_LIBRARY") - set(${_name}_WITH_LIBRARY ON) - set(${_name}_LIBRARY_TYPE STATIC) - endif() - if(${arg} STREQUAL "WITH_SHARED_LIBRARY") - set(${_name}_WITH_LIBRARY ON) - set(${_name}_LIBRARY_TYPE SHARED) - endif() - if(${arg} STREQUAL "WITHOUT_PLUGIN") - set(${_name}_WITH_PLUGIN OFF) - endif() - endforeach() - - # Include JANA by default - find_package(JANA REQUIRED) - - # TODO: NWB: This really needs to be a dependency of JANA itself. - # If we don't do this here, CMake will later refuse to accept that podio is - # indeed a dependency of JANA and aggressively reorders my target_link_list - # to reflect this misapprehension. - # https://gitlab.kitware.com/cmake/cmake/blob/v3.13.2/Source/cmComputeLinkDepends.cxx - find_package(podio REQUIRED) - - # include logging by default - find_package(spdlog REQUIRED) - - # include fmt by default - find_package(fmt 9.0.0 REQUIRED) - - # include gsl by default - find_package(Microsoft.GSL CONFIG) - - # Define plugin - if(${_name}_WITH_PLUGIN) - add_library(${_name}_plugin SHARED ${PLUGIN_SOURCES}) - - target_include_directories(${_name}_plugin - PUBLIC - $ - $ - ) - target_include_directories(${_name}_plugin SYSTEM PUBLIC ${JANA_INCLUDE_DIR} ) - target_include_directories(${_name}_plugin SYSTEM PUBLIC ${ROOT_INCLUDE_DIRS} ) - set_target_properties(${_name}_plugin PROPERTIES PREFIX "" OUTPUT_NAME "${_name}" SUFFIX ".so") - target_link_libraries(${_name}_plugin ${JANA_LIB} podio::podio podio::podioRootIO spdlog::spdlog fmt::fmt) - target_link_libraries(${_name}_plugin Microsoft.GSL::GSL) - - # Install plugin - install(TARGETS ${_name}_plugin - EXPORT EICreconTargets - DESTINATION ${PLUGIN_OUTPUT_DIRECTORY} - ) - endif(${_name}_WITH_PLUGIN) - - # Define library - if(${_name}_WITH_LIBRARY) - add_library(${_name}_library ${${_name}_LIBRARY_TYPE} "") - if(${_name}_LIBRARY_TYPE STREQUAL "STATIC") - set(suffix ".a") - endif() - if(${_name}_LIBRARY_TYPE STREQUAL "SHARED") - set(suffix ".so") - endif() - set_target_properties(${_name}_library PROPERTIES PREFIX "lib" OUTPUT_NAME "${_name}" SUFFIX ${suffix}) - - target_include_directories(${_name}_library - PUBLIC - $ - $ - ) - target_include_directories(${_name}_library SYSTEM PUBLIC ${JANA_INCLUDE_DIR} ) - target_link_libraries(${_name}_library ${JANA_LIB} podio::podio podio::podioRootIO spdlog::spdlog) - target_link_libraries(${_name}_library ${JANA_LIB} podio::podio podio::podioRootIO fmt::fmt) - target_link_libraries(${_name}_library Microsoft.GSL::GSL) - - # Install library - install(TARGETS ${_name}_library - EXPORT EICreconTargets - DESTINATION ${PLUGIN_LIBRARY_OUTPUT_DIRECTORY} - ) - endif(${_name}_WITH_LIBRARY) - - if(${_name}_WITH_LIBRARY AND ${_name}_WITH_PLUGIN) - target_link_libraries(${_name}_plugin ${_name}_library) + # Default to plugin without library + set(${_name}_WITH_LIBRARY OFF) + set(${_name}_WITH_PLUGIN ON) + + # Check if build with library + foreach(arg IN ITEMS ${ARGN}) + if(${arg} STREQUAL "WITH_STATIC_LIBRARY") + set(${_name}_WITH_LIBRARY ON) + set(${_name}_LIBRARY_TYPE STATIC) + endif() + if(${arg} STREQUAL "WITH_SHARED_LIBRARY") + set(${_name}_WITH_LIBRARY ON) + set(${_name}_LIBRARY_TYPE SHARED) + endif() + if(${arg} STREQUAL "WITHOUT_PLUGIN") + set(${_name}_WITH_PLUGIN OFF) + endif() + endforeach() + + # Include JANA by default + find_package(JANA REQUIRED) + + # TODO: NWB: This really needs to be a dependency of JANA itself. If we don't + # do this here, CMake will later refuse to accept that podio is indeed a + # dependency of JANA and aggressively reorders my target_link_list to reflect + # this misapprehension. + # https://gitlab.kitware.com/cmake/cmake/blob/v3.13.2/Source/cmComputeLinkDepends.cxx + find_package(podio REQUIRED) + + # include logging by default + find_package(spdlog REQUIRED) + + # include fmt by default + find_package(fmt 9.0.0 REQUIRED) + + # include gsl by default + find_package(Microsoft.GSL CONFIG) + + # Define plugin + if(${_name}_WITH_PLUGIN) + add_library(${_name}_plugin SHARED ${PLUGIN_SOURCES}) + + target_include_directories( + ${_name}_plugin + PUBLIC $ + $) + target_include_directories(${_name}_plugin SYSTEM + PUBLIC ${JANA_INCLUDE_DIR}) + target_include_directories(${_name}_plugin SYSTEM + PUBLIC ${ROOT_INCLUDE_DIRS}) + set_target_properties( + ${_name}_plugin + PROPERTIES PREFIX "" + OUTPUT_NAME "${_name}" + SUFFIX ".so") + target_link_libraries(${_name}_plugin ${JANA_LIB} podio::podio + podio::podioRootIO spdlog::spdlog fmt::fmt) + target_link_libraries(${_name}_plugin Microsoft.GSL::GSL) + + # Install plugin + install( + TARGETS ${_name}_plugin + EXPORT EICreconTargets + DESTINATION ${PLUGIN_OUTPUT_DIRECTORY}) + endif(${_name}_WITH_PLUGIN) + + # Define library + if(${_name}_WITH_LIBRARY) + add_library(${_name}_library ${${_name}_LIBRARY_TYPE} "") + if(${_name}_LIBRARY_TYPE STREQUAL "STATIC") + set(suffix ".a") + endif() + if(${_name}_LIBRARY_TYPE STREQUAL "SHARED") + set(suffix ".so") endif() + set_target_properties( + ${_name}_library + PROPERTIES PREFIX "lib" + OUTPUT_NAME "${_name}" + SUFFIX ${suffix}) + + target_include_directories( + ${_name}_library + PUBLIC $ + $) + target_include_directories(${_name}_library SYSTEM + PUBLIC ${JANA_INCLUDE_DIR}) + target_link_libraries(${_name}_library ${JANA_LIB} podio::podio + podio::podioRootIO spdlog::spdlog) + target_link_libraries(${_name}_library ${JANA_LIB} podio::podio + podio::podioRootIO fmt::fmt) + target_link_libraries(${_name}_library Microsoft.GSL::GSL) + + # Install library + install( + TARGETS ${_name}_library + EXPORT EICreconTargets + DESTINATION ${PLUGIN_LIBRARY_OUTPUT_DIRECTORY}) + endif(${_name}_WITH_LIBRARY) + + if(${_name}_WITH_LIBRARY AND ${_name}_WITH_PLUGIN) + target_link_libraries(${_name}_plugin ${_name}_library) + endif() endmacro() - # target_link_libraries for both a plugin and a library macro(plugin_link_libraries _name) - if(${_name}_WITH_PLUGIN) - target_link_libraries(${_name}_plugin ${ARGN}) - endif(${_name}_WITH_PLUGIN) + if(${_name}_WITH_PLUGIN) + target_link_libraries(${_name}_plugin ${ARGN}) + endif(${_name}_WITH_PLUGIN) - if(${_name}_WITH_LIBRARY) - target_link_libraries(${_name}_library ${ARGN}) - endif(${_name}_WITH_LIBRARY) + if(${_name}_WITH_LIBRARY) + target_link_libraries(${_name}_library ${ARGN}) + endif(${_name}_WITH_LIBRARY) endmacro() # target_include_directories for both a plugin and a library macro(plugin_include_directories _name) - if(${_name}_WITH_PLUGIN) - target_include_directories(${_name}_plugin ${ARGN}) - endif(${_name}_WITH_PLUGIN) + if(${_name}_WITH_PLUGIN) + target_include_directories(${_name}_plugin ${ARGN}) + endif(${_name}_WITH_PLUGIN) - if(${_name}_WITH_LIBRARY) - target_include_directories(${_name}_library ${ARGN}) - endif(${_name}_WITH_LIBRARY) + if(${_name}_WITH_LIBRARY) + target_include_directories(${_name}_library ${ARGN}) + endif(${_name}_WITH_LIBRARY) endmacro() - # runs target_sources both for library and a plugin macro(plugin_sources _name) - # This is needed as this is a macro (see cmake macro documentation) - set(SOURCES ${ARGN}) - - # Add sources to plugin - target_sources(${_name}_plugin PRIVATE ${SOURCES}) - - if(${_name}_WITH_LIBRARY) - # Library don't need .cc in library - set(PLUGIN_CC_FILE ${_name}.cc) - get_filename_component(PLUGIN_CC_FILE "${CMAKE_CURRENT_LIST_DIR}/${PLUGIN_CC_FILE}" ABSOLUTE) - list(REMOVE_ITEM SOURCES ${PLUGIN_CC_FILE}) - - # Add sources to library - target_sources(${_name}_library PRIVATE ${SOURCES}) - endif(${_name}_WITH_LIBRARY) + # This is needed as this is a macro (see cmake macro documentation) + set(SOURCES ${ARGN}) + + # Add sources to plugin + target_sources(${_name}_plugin PRIVATE ${SOURCES}) + + if(${_name}_WITH_LIBRARY) + # Library don't need .cc in library + set(PLUGIN_CC_FILE ${_name}.cc) + get_filename_component( + PLUGIN_CC_FILE "${CMAKE_CURRENT_LIST_DIR}/${PLUGIN_CC_FILE}" ABSOLUTE) + list(REMOVE_ITEM SOURCES ${PLUGIN_CC_FILE}) + + # Add sources to library + target_sources(${_name}_library PRIVATE ${SOURCES}) + endif(${_name}_WITH_LIBRARY) endmacro() - # installs headers in current directory macro(plugin_headers_only _name) - # get all headers - file(GLOB HEADER_FILES CONFIGURE_DEPENDS *.h *.hh *.hpp) - - # We need plugin relative path for correct headers installation (FIXME cmake 3.20: cmake_path) - file(RELATIVE_PATH PLUGIN_RELATIVE_PATH ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}) - - # FIXME cmake 3.23: define FILE_SET on target_sources - install(FILES ${HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${PLUGIN_RELATIVE_PATH} - ) + # get all headers + file(GLOB HEADER_FILES CONFIGURE_DEPENDS *.h *.hh *.hpp) + + # We need plugin relative path for correct headers installation (FIXME cmake + # 3.20: cmake_path) + file(RELATIVE_PATH PLUGIN_RELATIVE_PATH ${PROJECT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}) + + # FIXME cmake 3.23: define FILE_SET on target_sources + install( + FILES ${HEADER_FILES} + DESTINATION + ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${PLUGIN_RELATIVE_PATH}) endmacro() - -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory macro(plugin_glob_all _name) - # But... GLOB here makes this file just hot pluggable - file(GLOB LIB_SRC_FILES CONFIGURE_DEPENDS *.cc *.cpp *.c) - if(${_name}_WITH_LIBRARY) - file(GLOB PLUGIN_SRC_FILES CONFIGURE_DEPENDS ${_name}.cc) - else() - file(GLOB PLUGIN_SRC_FILES CONFIGURE_DEPENDS *.cc *.cpp *.c) - endif() - file(GLOB HEADER_FILES CONFIGURE_DEPENDS *.h *.hh *.hpp) - - # We need plugin relative path for correct headers installation (FIXME cmake 3.20: cmake_path) - file(RELATIVE_PATH PLUGIN_RELATIVE_PATH ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}) - - # Add sources to plugin - if(TARGET ${_name}_plugin) - target_sources(${_name}_plugin PRIVATE ${PLUGIN_SRC_FILES}) - endif() - - # FIXME cmake 3.23: define FILE_SET on target_sources - install(FILES ${HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${PLUGIN_RELATIVE_PATH} - ) - - if(${_name}_WITH_LIBRARY) - # Library don't need .cc but Plugin does - set(PLUGIN_CC_FILE ${_name}.cc) - - # Make the path absolute as GLOB files will be absolute paths - get_filename_component(PLUGIN_CC_FILE_ABS "${CMAKE_CURRENT_LIST_DIR}/${PLUGIN_CC_FILE}" ABSOLUTE) - - # Remove plugin.cc file from libraries - list(REMOVE_ITEM LIB_SRC_FILES ${PLUGIN_CC_FILE_ABS}) - - # Finally add sources to library - target_sources(${_name}_library PRIVATE ${LIB_SRC_FILES}) - endif(${_name}_WITH_LIBRARY) - - # Debug output if needed - message(VERBOSE "plugin_glob_all:${_name}: PLUGIN_CC_FILE ${PLUGIN_CC_FILE}") - message(VERBOSE "plugin_glob_all:${_name}: LIB_SRC_FILES ${LIB_SRC_FILES}") - message(VERBOSE "plugin_glob_all:${_name}: PLUGIN_SRC_FILES ${PLUGIN_SRC_FILES}") - message(VERBOSE "plugin_glob_all:${_name}: HEADER_FILES ${HEADER_FILES}") - message(VERBOSE "plugin_glob_all:${_name}: PLUGIN_RLTV_PATH ${PLUGIN_RELATIVE_PATH}") + # But... GLOB here makes this file just hot pluggable + file(GLOB LIB_SRC_FILES CONFIGURE_DEPENDS *.cc *.cpp *.c) + if(${_name}_WITH_LIBRARY) + file(GLOB PLUGIN_SRC_FILES CONFIGURE_DEPENDS ${_name}.cc) + else() + file(GLOB PLUGIN_SRC_FILES CONFIGURE_DEPENDS *.cc *.cpp *.c) + endif() + file(GLOB HEADER_FILES CONFIGURE_DEPENDS *.h *.hh *.hpp) + + # We need plugin relative path for correct headers installation (FIXME cmake + # 3.20: cmake_path) + file(RELATIVE_PATH PLUGIN_RELATIVE_PATH ${PROJECT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}) + + # Add sources to plugin + if(TARGET ${_name}_plugin) + target_sources(${_name}_plugin PRIVATE ${PLUGIN_SRC_FILES}) + endif() + + # FIXME cmake 3.23: define FILE_SET on target_sources + install( + FILES ${HEADER_FILES} + DESTINATION + ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${PLUGIN_RELATIVE_PATH}) + + if(${_name}_WITH_LIBRARY) + # Library don't need .cc but Plugin does + set(PLUGIN_CC_FILE ${_name}.cc) + + # Make the path absolute as GLOB files will be absolute paths + get_filename_component( + PLUGIN_CC_FILE_ABS "${CMAKE_CURRENT_LIST_DIR}/${PLUGIN_CC_FILE}" ABSOLUTE) + + # Remove plugin.cc file from libraries + list(REMOVE_ITEM LIB_SRC_FILES ${PLUGIN_CC_FILE_ABS}) + + # Finally add sources to library + target_sources(${_name}_library PRIVATE ${LIB_SRC_FILES}) + endif(${_name}_WITH_LIBRARY) + + # Debug output if needed + message(VERBOSE + "plugin_glob_all:${_name}: PLUGIN_CC_FILE ${PLUGIN_CC_FILE}") + message(VERBOSE "plugin_glob_all:${_name}: LIB_SRC_FILES ${LIB_SRC_FILES}") + message(VERBOSE + "plugin_glob_all:${_name}: PLUGIN_SRC_FILES ${PLUGIN_SRC_FILES}") + message(VERBOSE "plugin_glob_all:${_name}: HEADER_FILES ${HEADER_FILES}") + message(VERBOSE + "plugin_glob_all:${_name}: PLUGIN_RLTV_PATH ${PLUGIN_RELATIVE_PATH}") endmacro() - # Adds algorithms for a plugin macro(plugin_add_algorithms _name) - if(NOT algorithms_FOUND) - find_package(algorithms REQUIRED) - endif() + if(NOT algorithms_FOUND) + find_package(algorithms REQUIRED) + endif() - plugin_link_libraries(${_name} - algorithms::algocore - ) + plugin_link_libraries(${_name} algorithms::algocore) endmacro() - # Adds dd4hep for a plugin macro(plugin_add_dd4hep _name) - if(NOT DD4hep_FOUND) - find_package(DD4hep REQUIRED) - endif() + if(NOT DD4hep_FOUND) + find_package(DD4hep REQUIRED) + endif() - plugin_link_libraries(${_name} - DD4hep::DDCore - DD4hep::DDRec - ) + plugin_link_libraries(${_name} DD4hep::DDCore DD4hep::DDRec) endmacro() - # Adds Eigen3 for a plugin macro(plugin_add_eigen3 _name) - if(NOT Eigen3_FOUND) - find_package(Eigen3 REQUIRED) - endif() + if(NOT Eigen3_FOUND) + find_package(Eigen3 REQUIRED) + endif() - plugin_link_libraries(${_name} - Eigen3::Eigen - ) + plugin_link_libraries(${_name} Eigen3::Eigen) endmacro() - # Adds ACTS tracking package for a plugin macro(plugin_add_acts _name) - if(NOT Acts_FOUND) - find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginJson PluginDD4hep) - set(Acts_VERSION_MIN "20.2.0") - set(Acts_VERSION "${Acts_VERSION_MAJOR}.${Acts_VERSION_MINOR}.${Acts_VERSION_PATCH}") - if(${Acts_VERSION} VERSION_LESS ${Acts_VERSION_MIN} - AND NOT "${Acts_VERSION}" STREQUAL "9.9.9") - message(FATAL_ERROR "Acts version ${Acts_VERSION_MIN} or higher required, but ${Acts_VERSION} found") - endif() - endif() - - # Get ActsExamples base - get_target_property(ActsCore_LOCATION ActsCore LOCATION) - get_filename_component(ActsCore_PATH ${ActsCore_LOCATION} DIRECTORY) - - # Add libraries (works same as target_include_directories) - plugin_link_libraries(${PLUGIN_NAME} - ActsCore - ActsPluginIdentification - ActsPluginTGeo - ActsPluginJson - ActsPluginDD4hep - ${ActsCore_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}ActsExamplesFramework${CMAKE_SHARED_LIBRARY_SUFFIX} - ) - if(${_name}_WITH_LIBRARY) - target_compile_definitions(${PLUGIN_NAME}_library PRIVATE "Acts_VERSION_MAJOR=${Acts_VERSION_MAJOR}") - endif() - if(${_name}_WITH_PLUGIN) - target_compile_definitions(${PLUGIN_NAME}_plugin PRIVATE "Acts_VERSION_MAJOR=${Acts_VERSION_MAJOR}") + if(NOT Acts_FOUND) + find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo + PluginJson PluginDD4hep) + set(Acts_VERSION_MIN "20.2.0") + set(Acts_VERSION + "${Acts_VERSION_MAJOR}.${Acts_VERSION_MINOR}.${Acts_VERSION_PATCH}") + if(${Acts_VERSION} VERSION_LESS ${Acts_VERSION_MIN} + AND NOT "${Acts_VERSION}" STREQUAL "9.9.9") + message( + FATAL_ERROR + "Acts version ${Acts_VERSION_MIN} or higher required, but ${Acts_VERSION} found" + ) endif() + endif() + + # Get ActsExamples base + get_target_property(ActsCore_LOCATION ActsCore LOCATION) + get_filename_component(ActsCore_PATH ${ActsCore_LOCATION} DIRECTORY) + + # Add libraries (works same as target_include_directories) + plugin_link_libraries( + ${PLUGIN_NAME} + ActsCore + ActsPluginIdentification + ActsPluginTGeo + ActsPluginJson + ActsPluginDD4hep + ${ActsCore_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}ActsExamplesFramework${CMAKE_SHARED_LIBRARY_SUFFIX} + ) + if(${_name}_WITH_LIBRARY) + target_compile_definitions( + ${PLUGIN_NAME}_library PRIVATE "Acts_VERSION_MAJOR=${Acts_VERSION_MAJOR}") + endif() + if(${_name}_WITH_PLUGIN) + target_compile_definitions( + ${PLUGIN_NAME}_plugin PRIVATE "Acts_VERSION_MAJOR=${Acts_VERSION_MAJOR}") + endif() endmacro() - # Adds IRT PID reconstruction package for a plugin macro(plugin_add_irt _name) - if(NOT IRT_FOUND) - find_package(IRT REQUIRED) - endif() + if(NOT IRT_FOUND) + find_package(IRT REQUIRED) + endif() - # FIXME: IRTConfig.cmake sets INTERFACE_INCLUDE_DIRECTORIES to /include/IRT - # instead of /include, allowing for short-form #include - get_target_property(IRT_INTERFACE_INCLUDE_DIRECTORIES IRT INTERFACE_INCLUDE_DIRECTORIES) - list(TRANSFORM IRT_INTERFACE_INCLUDE_DIRECTORIES REPLACE "/IRT$" "") - list(REMOVE_DUPLICATES IRT_INTERFACE_INCLUDE_DIRECTORIES) - set_target_properties(IRT PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${IRT_INTERFACE_INCLUDE_DIRECTORIES}") + # FIXME: IRTConfig.cmake sets INTERFACE_INCLUDE_DIRECTORIES to + # /include/IRT instead of /include, allowing for short-form + # #include + get_target_property(IRT_INTERFACE_INCLUDE_DIRECTORIES IRT + INTERFACE_INCLUDE_DIRECTORIES) + list(TRANSFORM IRT_INTERFACE_INCLUDE_DIRECTORIES REPLACE "/IRT$" "") + list(REMOVE_DUPLICATES IRT_INTERFACE_INCLUDE_DIRECTORIES) + set_target_properties(IRT PROPERTIES INTERFACE_INCLUDE_DIRECTORIES + "${IRT_INTERFACE_INCLUDE_DIRECTORIES}") - plugin_link_libraries(${PLUGIN_NAME} IRT) + plugin_link_libraries(${PLUGIN_NAME} IRT) endmacro() # Adds podio, edm4hep, edm4eic for a plugin macro(plugin_add_event_model _name) - if(NOT podio_FOUND) - find_package(podio REQUIRED) - endif() + if(NOT podio_FOUND) + find_package(podio REQUIRED) + endif() - if(NOT EDM4HEP_FOUND) - find_package(EDM4HEP REQUIRED) - endif() + if(NOT EDM4HEP_FOUND) + find_package(EDM4HEP REQUIRED) + endif() - if(NOT EDM4EIC_FOUND) - find_package(EDM4EIC REQUIRED) - endif() + if(NOT EDM4EIC_FOUND) + find_package(EDM4EIC REQUIRED) + endif() - # Add include directories - plugin_include_directories(${PLUGIN_NAME} - PUBLIC - $ - $ - ) - - # Add libraries - # (same as target_include_directories but for both plugin and library) - plugin_link_libraries(${PLUGIN_NAME} - podio::podio - EDM4EIC::edm4eic - EDM4HEP::edm4hep - ) + # Add include directories + plugin_include_directories( + ${PLUGIN_NAME} PUBLIC $ + $) -endmacro() + # Add libraries (same as target_include_directories but for both plugin and + # library) + plugin_link_libraries(${PLUGIN_NAME} podio::podio EDM4EIC::edm4eic + EDM4HEP::edm4hep) +endmacro() # Adds cern ROOT for a plugin macro(plugin_add_cern_root _name) - if(NOT ROOT_FOUND) - find_package(ROOT REQUIRED) - endif() + if(NOT ROOT_FOUND) + find_package(ROOT REQUIRED) + endif() - # Add libraries - plugin_link_libraries(${PLUGIN_NAME} - ROOT::Core - ROOT::EG - ) + # Add libraries + plugin_link_libraries(${PLUGIN_NAME} ROOT::Core ROOT::EG) endmacro() - # Adds FastJet for a plugin macro(plugin_add_fastjet _name) - if(NOT FASTJET_FOUND) - find_package(FastJet REQUIRED) - endif() + if(NOT FASTJET_FOUND) + find_package(FastJet REQUIRED) + endif() - # Add include directories - plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ${FASTJET_INCLUDE_DIRS} ) + # Add include directories + plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC + ${FASTJET_INCLUDE_DIRS}) - # Add libraries - plugin_link_libraries(${PLUGIN_NAME} ${FASTJET_LIBRARIES}) + # Add libraries + plugin_link_libraries(${PLUGIN_NAME} ${FASTJET_LIBRARIES}) endmacro() diff --git a/src/algorithms/CMakeLists.txt b/src/algorithms/CMakeLists.txt index 52fb3b33a4..dddced5bff 100644 --- a/src/algorithms/CMakeLists.txt +++ b/src/algorithms/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.16) -add_subdirectory( interfaces ) -add_subdirectory( calorimetry ) -add_subdirectory( tracking ) -add_subdirectory( pid ) -add_subdirectory( digi ) -add_subdirectory( reco ) -add_subdirectory( fardetectors ) +add_subdirectory(interfaces) +add_subdirectory(calorimetry) +add_subdirectory(tracking) +add_subdirectory(pid) +add_subdirectory(digi) +add_subdirectory(reco) +add_subdirectory(fardetectors) diff --git a/src/algorithms/calorimetry/CMakeLists.txt b/src/algorithms/calorimetry/CMakeLists.txt index 830dfc2429..5b940b7af5 100644 --- a/src/algorithms/calorimetry/CMakeLists.txt +++ b/src/algorithms/calorimetry/CMakeLists.txt @@ -6,9 +6,9 @@ set(PLUGIN_NAME "algorithms_calorimetry") # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME} WITH_SHARED_LIBRARY WITHOUT_PLUGIN) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/algorithms/digi/CMakeLists.txt b/src/algorithms/digi/CMakeLists.txt index b73100c7bc..a780dc232f 100644 --- a/src/algorithms/digi/CMakeLists.txt +++ b/src/algorithms/digi/CMakeLists.txt @@ -6,9 +6,9 @@ set(PLUGIN_NAME "algorithms_digi") # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME} WITH_SHARED_LIBRARY WITHOUT_PLUGIN) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -16,10 +16,9 @@ plugin_add_dd4hep(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# Add include directories -# (same as target_include_directories but for both plugin and library) -#plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) +# Add include directories (same as target_include_directories but for both +# plugin and library) plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC +# ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -#plugin_link_libraries(${PLUGIN_NAME} ... ) +# Add libraries (same as target_include_directories but for both plugin and +# library) plugin_link_libraries(${PLUGIN_NAME} ... ) diff --git a/src/algorithms/fardetectors/CMakeLists.txt b/src/algorithms/fardetectors/CMakeLists.txt index 4dc7e7cb19..1596a83572 100644 --- a/src/algorithms/fardetectors/CMakeLists.txt +++ b/src/algorithms/fardetectors/CMakeLists.txt @@ -4,9 +4,9 @@ set(PLUGIN_NAME "algorithms_fardetectors") # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME} WITH_SHARED_LIBRARY WITHOUT_PLUGIN) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/algorithms/pid/CMakeLists.txt b/src/algorithms/pid/CMakeLists.txt index df5abf4a14..733cc6f7f2 100644 --- a/src/algorithms/pid/CMakeLists.txt +++ b/src/algorithms/pid/CMakeLists.txt @@ -6,9 +6,9 @@ set(PLUGIN_NAME "algorithms_pid") # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME} WITH_SHARED_LIBRARY WITHOUT_PLUGIN) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/algorithms/reco/CMakeLists.txt b/src/algorithms/reco/CMakeLists.txt index a30b0a3ed0..6819f2575e 100644 --- a/src/algorithms/reco/CMakeLists.txt +++ b/src/algorithms/reco/CMakeLists.txt @@ -6,9 +6,9 @@ set(PLUGIN_NAME "algorithms_reco") # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME} WITH_SHARED_LIBRARY WITHOUT_PLUGIN) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -17,14 +17,15 @@ plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) plugin_add_fastjet(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library algorithms_tracking_library) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library + algorithms_tracking_library) diff --git a/src/algorithms/tracking/CMakeLists.txt b/src/algorithms/tracking/CMakeLists.txt index c7d9252fad..c8388343f4 100644 --- a/src/algorithms/tracking/CMakeLists.txt +++ b/src/algorithms/tracking/CMakeLists.txt @@ -6,9 +6,9 @@ set(PLUGIN_NAME "algorithms_tracking") # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME} WITH_SHARED_LIBRARY WITHOUT_PLUGIN) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -18,13 +18,14 @@ plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_eigen3(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) -plugin_include_directories(${PLUGIN_NAME} PUBLIC $) +plugin_include_directories(${PLUGIN_NAME} PUBLIC + $) -# Add libraries -# (same as target_include_directories but for both plugin and library) +# Add libraries (same as target_include_directories but for both plugin and +# library) plugin_link_libraries(${PLUGIN_NAME} Eigen3::Eigen) diff --git a/src/benchmarks/detectors/EcalBarrelScFiCheck/CMakeLists.txt b/src/benchmarks/detectors/EcalBarrelScFiCheck/CMakeLists.txt index cdbc0485c5..025ea05142 100644 --- a/src/benchmarks/detectors/EcalBarrelScFiCheck/CMakeLists.txt +++ b/src/benchmarks/detectors/EcalBarrelScFiCheck/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/benchmarks/reconstruction/TRACKINGcheck/CMakeLists.txt b/src/benchmarks/reconstruction/TRACKINGcheck/CMakeLists.txt index 866a99fedd..53bf42a9ef 100644 --- a/src/benchmarks/reconstruction/TRACKINGcheck/CMakeLists.txt +++ b/src/benchmarks/reconstruction/TRACKINGcheck/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/benchmarks/reconstruction/femc_studies/CMakeLists.txt b/src/benchmarks/reconstruction/femc_studies/CMakeLists.txt index db9ba37bfb..784be6c6a1 100644 --- a/src/benchmarks/reconstruction/femc_studies/CMakeLists.txt +++ b/src/benchmarks/reconstruction/femc_studies/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,17 +13,16 @@ plugin_add_event_model(${PLUGIN_NAME}) plugin_add_dd4hep(${PLUGIN_NAME}) plugin_add_acts(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) -# Add include directories -# (same as target_include_directories but for both plugin and library) -plugin_include_directories(${PLUGIN_NAME} - SYSTEM PUBLIC - ${ROOT_INCLUDE_DIRS}) +# Add include directories (same as target_include_directories but for both +# plugin and library) +plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ${ROOT_INCLUDE_DIRS}) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} ${ROOT_LIBRARIES} ActsCore EDM4EIC::edm4eic) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} ${ROOT_LIBRARIES} ActsCore + EDM4EIC::edm4eic) diff --git a/src/benchmarks/reconstruction/lfhcal_studies/CMakeLists.txt b/src/benchmarks/reconstruction/lfhcal_studies/CMakeLists.txt index db9ba37bfb..784be6c6a1 100644 --- a/src/benchmarks/reconstruction/lfhcal_studies/CMakeLists.txt +++ b/src/benchmarks/reconstruction/lfhcal_studies/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,17 +13,16 @@ plugin_add_event_model(${PLUGIN_NAME}) plugin_add_dd4hep(${PLUGIN_NAME}) plugin_add_acts(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) -# Add include directories -# (same as target_include_directories but for both plugin and library) -plugin_include_directories(${PLUGIN_NAME} - SYSTEM PUBLIC - ${ROOT_INCLUDE_DIRS}) +# Add include directories (same as target_include_directories but for both +# plugin and library) +plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ${ROOT_INCLUDE_DIRS}) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} ${ROOT_LIBRARIES} ActsCore EDM4EIC::edm4eic) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} ${ROOT_LIBRARIES} ActsCore + EDM4EIC::edm4eic) diff --git a/src/benchmarks/reconstruction/tof_efficiency/CMakeLists.txt b/src/benchmarks/reconstruction/tof_efficiency/CMakeLists.txt index 99378d2271..23c4c38305 100644 --- a/src/benchmarks/reconstruction/tof_efficiency/CMakeLists.txt +++ b/src/benchmarks/reconstruction/tof_efficiency/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,19 +13,19 @@ find_package(ROOT REQUIRED COMPONENTS Core Tree Hist RIO EG) plugin_add_acts(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} - ROOT::Core - ROOT::Tree - ROOT::Hist - ROOT::RIO - ROOT::EG - ActsCore - EDM4EIC::edm4eic -) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries( + ${PLUGIN_NAME} + ROOT::Core + ROOT::Tree + ROOT::Hist + ROOT::RIO + ROOT::EG + ActsCore + EDM4EIC::edm4eic) diff --git a/src/benchmarks/reconstruction/tracking_efficiency/CMakeLists.txt b/src/benchmarks/reconstruction/tracking_efficiency/CMakeLists.txt index 99378d2271..23c4c38305 100644 --- a/src/benchmarks/reconstruction/tracking_efficiency/CMakeLists.txt +++ b/src/benchmarks/reconstruction/tracking_efficiency/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,19 +13,19 @@ find_package(ROOT REQUIRED COMPONENTS Core Tree Hist RIO EG) plugin_add_acts(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} - ROOT::Core - ROOT::Tree - ROOT::Hist - ROOT::RIO - ROOT::EG - ActsCore - EDM4EIC::edm4eic -) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries( + ${PLUGIN_NAME} + ROOT::Core + ROOT::Tree + ROOT::Hist + ROOT::RIO + ROOT::EG + ActsCore + EDM4EIC::edm4eic) diff --git a/src/benchmarks/reconstruction/tracking_occupancy/CMakeLists.txt b/src/benchmarks/reconstruction/tracking_occupancy/CMakeLists.txt index db9ba37bfb..784be6c6a1 100644 --- a/src/benchmarks/reconstruction/tracking_occupancy/CMakeLists.txt +++ b/src/benchmarks/reconstruction/tracking_occupancy/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,17 +13,16 @@ plugin_add_event_model(${PLUGIN_NAME}) plugin_add_dd4hep(${PLUGIN_NAME}) plugin_add_acts(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) -# Add include directories -# (same as target_include_directories but for both plugin and library) -plugin_include_directories(${PLUGIN_NAME} - SYSTEM PUBLIC - ${ROOT_INCLUDE_DIRS}) +# Add include directories (same as target_include_directories but for both +# plugin and library) +plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ${ROOT_INCLUDE_DIRS}) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} ${ROOT_LIBRARIES} ActsCore EDM4EIC::edm4eic) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} ${ROOT_LIBRARIES} ActsCore + EDM4EIC::edm4eic) diff --git a/src/detectors/B0ECAL/CMakeLists.txt b/src/detectors/B0ECAL/CMakeLists.txt index 9cb6aea037..05ba018886 100644 --- a/src/detectors/B0ECAL/CMakeLists.txt +++ b/src/detectors/B0ECAL/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/detectors/B0TRK/CMakeLists.txt b/src/detectors/B0TRK/CMakeLists.txt index c6cff033bb..7114db8d43 100644 --- a/src/detectors/B0TRK/CMakeLists.txt +++ b/src/detectors/B0TRK/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,14 +13,15 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library algorithms_tracking_library) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library + algorithms_tracking_library) diff --git a/src/detectors/BEMC/CMakeLists.txt b/src/detectors/BEMC/CMakeLists.txt index b8a790f854..8cc2fdd44e 100644 --- a/src/detectors/BEMC/CMakeLists.txt +++ b/src/detectors/BEMC/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) plugin_add_dd4hep(${PLUGIN_NAME}) diff --git a/src/detectors/BHCAL/CMakeLists.txt b/src/detectors/BHCAL/CMakeLists.txt index 63a4a52cf2..112e39bc6f 100644 --- a/src/detectors/BHCAL/CMakeLists.txt +++ b/src/detectors/BHCAL/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/detectors/BTOF/CMakeLists.txt b/src/detectors/BTOF/CMakeLists.txt index f56f6902dd..be6bea84ce 100644 --- a/src/detectors/BTOF/CMakeLists.txt +++ b/src/detectors/BTOF/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -17,10 +18,9 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# Add include directories -# (same as target_include_directories but for both plugin and library) -#plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) +# Add include directories (same as target_include_directories but for both +# plugin and library) plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC +# ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -#plugin_link_libraries(${PLUGIN_NAME} ... ) +# Add libraries (same as target_include_directories but for both plugin and +# library) plugin_link_libraries(${PLUGIN_NAME} ... ) diff --git a/src/detectors/BTRK/CMakeLists.txt b/src/detectors/BTRK/CMakeLists.txt index 0016f98536..5e5efc600e 100644 --- a/src/detectors/BTRK/CMakeLists.txt +++ b/src/detectors/BTRK/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,14 +13,12 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} - algorithms_digi_library - algorithms_tracking_library - ) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library + algorithms_tracking_library) diff --git a/src/detectors/BVTX/CMakeLists.txt b/src/detectors/BVTX/CMakeLists.txt index caede6f30f..7cc588a9fd 100644 --- a/src/detectors/BVTX/CMakeLists.txt +++ b/src/detectors/BVTX/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -17,10 +18,11 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# Add include directories -# (same as target_include_directories but for both plugin and library) -#plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) +# Add include directories (same as target_include_directories but for both +# plugin and library) plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC +# ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library algorithms_tracking_library) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library + algorithms_tracking_library) diff --git a/src/detectors/DIRC/CMakeLists.txt b/src/detectors/DIRC/CMakeLists.txt index ab0246f494..dc05000d4b 100644 --- a/src/detectors/DIRC/CMakeLists.txt +++ b/src/detectors/DIRC/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/detectors/DRICH/CMakeLists.txt b/src/detectors/DRICH/CMakeLists.txt index 340964ce0d..561c2111dc 100644 --- a/src/detectors/DRICH/CMakeLists.txt +++ b/src/detectors/DRICH/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/detectors/ECTOF/CMakeLists.txt b/src/detectors/ECTOF/CMakeLists.txt index f56f6902dd..be6bea84ce 100644 --- a/src/detectors/ECTOF/CMakeLists.txt +++ b/src/detectors/ECTOF/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -17,10 +18,9 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# Add include directories -# (same as target_include_directories but for both plugin and library) -#plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) +# Add include directories (same as target_include_directories but for both +# plugin and library) plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC +# ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -#plugin_link_libraries(${PLUGIN_NAME} ... ) +# Add libraries (same as target_include_directories but for both plugin and +# library) plugin_link_libraries(${PLUGIN_NAME} ... ) diff --git a/src/detectors/ECTRK/CMakeLists.txt b/src/detectors/ECTRK/CMakeLists.txt index c6cff033bb..7114db8d43 100644 --- a/src/detectors/ECTRK/CMakeLists.txt +++ b/src/detectors/ECTRK/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,14 +13,15 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library algorithms_tracking_library) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library + algorithms_tracking_library) diff --git a/src/detectors/EEMC/CMakeLists.txt b/src/detectors/EEMC/CMakeLists.txt index 59693ef882..90d48a9b0b 100644 --- a/src/detectors/EEMC/CMakeLists.txt +++ b/src/detectors/EEMC/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/detectors/EHCAL/CMakeLists.txt b/src/detectors/EHCAL/CMakeLists.txt index 63a4a52cf2..112e39bc6f 100644 --- a/src/detectors/EHCAL/CMakeLists.txt +++ b/src/detectors/EHCAL/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/detectors/FEMC/CMakeLists.txt b/src/detectors/FEMC/CMakeLists.txt index 59693ef882..90d48a9b0b 100644 --- a/src/detectors/FEMC/CMakeLists.txt +++ b/src/detectors/FEMC/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/detectors/FHCAL/CMakeLists.txt b/src/detectors/FHCAL/CMakeLists.txt index 63a4a52cf2..112e39bc6f 100644 --- a/src/detectors/FHCAL/CMakeLists.txt +++ b/src/detectors/FHCAL/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/detectors/FOFFMTRK/CMakeLists.txt b/src/detectors/FOFFMTRK/CMakeLists.txt index 5c1911ed2e..681f4c9448 100644 --- a/src/detectors/FOFFMTRK/CMakeLists.txt +++ b/src/detectors/FOFFMTRK/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,11 +13,11 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) -# Add libraries -# (same as target_include_directories but for both plugin and library) +# Add libraries (same as target_include_directories but for both plugin and +# library) plugin_link_libraries(${PLUGIN_NAME} algorithms_fardetectors_library) diff --git a/src/detectors/LOWQ2/CMakeLists.txt b/src/detectors/LOWQ2/CMakeLists.txt index dc959cacfa..e85e6f2771 100644 --- a/src/detectors/LOWQ2/CMakeLists.txt +++ b/src/detectors/LOWQ2/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -16,4 +17,5 @@ plugin_add_dd4hep(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) -plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ${podio_INCLUDE_DIR} ${EDM4EIC_INCLUDE_DIR}) +plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ${podio_INCLUDE_DIR} + ${EDM4EIC_INCLUDE_DIR}) diff --git a/src/detectors/LUMISPECCAL/CMakeLists.txt b/src/detectors/LUMISPECCAL/CMakeLists.txt index 59693ef882..90d48a9b0b 100644 --- a/src/detectors/LUMISPECCAL/CMakeLists.txt +++ b/src/detectors/LUMISPECCAL/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/detectors/MPGD/CMakeLists.txt b/src/detectors/MPGD/CMakeLists.txt index c6cff033bb..7114db8d43 100644 --- a/src/detectors/MPGD/CMakeLists.txt +++ b/src/detectors/MPGD/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,14 +13,15 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library algorithms_tracking_library) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library + algorithms_tracking_library) diff --git a/src/detectors/RPOTS/CMakeLists.txt b/src/detectors/RPOTS/CMakeLists.txt index 857fd09bfc..02f4e4c556 100644 --- a/src/detectors/RPOTS/CMakeLists.txt +++ b/src/detectors/RPOTS/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -16,7 +17,8 @@ plugin_add_dd4hep(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) -#plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ${podio_INCLUDE_DIR} ${EDM4EIC_INCLUDE_DIR}) +# plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ${podio_INCLUDE_DIR} +# ${EDM4EIC_INCLUDE_DIR}) # Add libraries (works same as target_include_directories) plugin_link_libraries(${PLUGIN_NAME} algorithms_fardetectors_library) diff --git a/src/detectors/ZDC/CMakeLists.txt b/src/detectors/ZDC/CMakeLists.txt index 1dbf96a845..5820494cf5 100644 --- a/src/detectors/ZDC/CMakeLists.txt +++ b/src/detectors/ZDC/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/examples/track_matching/CMakeLists.txt b/src/examples/track_matching/CMakeLists.txt index 4fa57bf960..0956d68a23 100644 --- a/src/examples/track_matching/CMakeLists.txt +++ b/src/examples/track_matching/CMakeLists.txt @@ -4,19 +4,22 @@ project(combined_benchmarks VERSION 0.0.0) # Make C++17 a default if(NOT "${CMAKE_CXX_STANDARD}") - set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD 17) endif() # Enable -fPIC for all targets set(CMAKE_POSITION_INDEPENDENT_CODE ON) # Install to the top directory by default -if( ${CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT} ) - set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR} CACHE PATH "Install in top directory by default" FORCE) +if(${CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT}) + set(CMAKE_INSTALL_PREFIX + ${CMAKE_SOURCE_DIR} + CACHE PATH "Install in top directory by default" FORCE) endif() # Add CMake additional functionality: -list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # Find Find.cmake +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # Find + # Find.cmake # include logging by default find_package(spdlog REQUIRED) @@ -30,21 +33,27 @@ find_package(DD4hep REQUIRED) find_package(ROOT REQUIRED) set(COMMON_TARGET_INCLUDES - SYSTEM PUBLIC - ${podio_INCLUDE_DIR} - ${EDM4HEP_INCLUDE_DIR} - ${EDM4EIC_INCLUDE_DIR} - ${ROOT_INCLUDE_DIRS} - PUBLIC - ${CMAKE_SOURCE_DIR}/executables - ${CMAKE_SOURCE_DIR}/common_bench/include - ) - -set(COMMON_TARGET_LIBRARIES spdlog::spdlog fmt::fmt EDM4HEP::edm4hep DD4hep::DDCore EDM4EIC::edm4eic ROOT::Core ${ROOT_LIBRARIES}) - -add_executable(reco_particles_track_matching - reco_particles_track_matching.cc - ) -target_include_directories(reco_particles_track_matching ${COMMON_TARGET_INCLUDES}) + SYSTEM + PUBLIC + ${podio_INCLUDE_DIR} + ${EDM4HEP_INCLUDE_DIR} + ${EDM4EIC_INCLUDE_DIR} + ${ROOT_INCLUDE_DIRS} + PUBLIC + ${CMAKE_SOURCE_DIR}/executables + ${CMAKE_SOURCE_DIR}/common_bench/include) + +set(COMMON_TARGET_LIBRARIES + spdlog::spdlog + fmt::fmt + EDM4HEP::edm4hep + DD4hep::DDCore + EDM4EIC::edm4eic + ROOT::Core + ${ROOT_LIBRARIES}) + +add_executable(reco_particles_track_matching reco_particles_track_matching.cc) +target_include_directories(reco_particles_track_matching + ${COMMON_TARGET_INCLUDES}) target_link_libraries(reco_particles_track_matching ${COMMON_TARGET_LIBRARIES}) install(TARGETS reco_particles_track_matching) diff --git a/src/global/CMakeLists.txt b/src/global/CMakeLists.txt index 09f3310f80..165c5e0d49 100644 --- a/src/global/CMakeLists.txt +++ b/src/global/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -add_subdirectory( tracking ) -add_subdirectory( reco ) -add_subdirectory( pid ) -add_subdirectory( beam ) +add_subdirectory(tracking) +add_subdirectory(reco) +add_subdirectory(pid) +add_subdirectory(beam) diff --git a/src/global/beam/CMakeLists.txt b/src/global/beam/CMakeLists.txt index 08f7e617bd..f1f73abaa4 100644 --- a/src/global/beam/CMakeLists.txt +++ b/src/global/beam/CMakeLists.txt @@ -1,14 +1,15 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/global/pid/CMakeLists.txt b/src/global/pid/CMakeLists.txt index 5917668e79..47b0b125d4 100644 --- a/src/global/pid/CMakeLists.txt +++ b/src/global/pid/CMakeLists.txt @@ -1,16 +1,17 @@ cmake_minimum_required(VERSION 3.16) -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -20,6 +21,7 @@ plugin_add_irt(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} algorithms_tracking_library algorithms_pid_library) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} algorithms_tracking_library + algorithms_pid_library) diff --git a/src/global/reco/CMakeLists.txt b/src/global/reco/CMakeLists.txt index 33183c6315..5049d1ac7a 100644 --- a/src/global/reco/CMakeLists.txt +++ b/src/global/reco/CMakeLists.txt @@ -6,9 +6,9 @@ get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME} WITH_SHARED_LIBRARY PLUGIN_USE_CC_ONLY) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -16,14 +16,15 @@ plugin_add_dd4hep(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library algorithms_tracking_library algorithms_reco_library) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library + algorithms_tracking_library algorithms_reco_library) diff --git a/src/global/tracking/CMakeLists.txt b/src/global/tracking/CMakeLists.txt index 301956ec2c..e0259c4825 100644 --- a/src/global/tracking/CMakeLists.txt +++ b/src/global/tracking/CMakeLists.txt @@ -6,9 +6,9 @@ get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME} PLUGIN_USE_CC_ONLY) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -20,31 +20,19 @@ plugin_add_event_model(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library algorithms_tracking_library) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} algorithms_digi_library + algorithms_tracking_library) # +# plugin_add_acts(${PLUGIN_NAME}) # -#plugin_add_acts(${PLUGIN_NAME}) -# -## Add include directories (works same as target_include_directories) -#plugin_include_directories(${PLUGIN_NAME} -# PUBLIC -# ${CMAKE_CURRENT_LIST_DIR} -# SYSTEM PUBLIC -# ${podio_INCLUDE_DIR} -# ${EDM4HEP_INCLUDE_DIR} -# ${DD4hep_INCLUDE_DIRS} -# ${ROOT_INCLUDE_DIRS} -# ${EDM4EIC_INCLUDE_DIRS}) -# +# Add include directories (works same as target_include_directories) +# plugin_include_directories(${PLUGIN_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR} +# SYSTEM PUBLIC ${podio_INCLUDE_DIR} ${EDM4HEP_INCLUDE_DIR} +# ${DD4hep_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${EDM4EIC_INCLUDE_DIRS}) # -## Add libraries (works same as target_include_directories) -#plugin_link_libraries(${PLUGIN_NAME} -# ${ROOT_LIBRARIES} -# algorithms_tracking_library -# EDM4HEP::edm4hep -# EDM4EIC::edm4eic -# spdlog::spdlog -# Boost::boost -# ${ROOT_EG_LIBRARY}) +# Add libraries (works same as target_include_directories) +# plugin_link_libraries(${PLUGIN_NAME} ${ROOT_LIBRARIES} +# algorithms_tracking_library EDM4HEP::edm4hep EDM4EIC::edm4eic spdlog::spdlog +# Boost::boost ${ROOT_EG_LIBRARY}) diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 64b26bdc7b..066393220c 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -3,14 +3,14 @@ find_package(podio) find_package(IRT) if(DEFINED ENV{DETECTOR_PATH}) - set(DETECTOR_PATH $ENV{DETECTOR_PATH}) + set(DETECTOR_PATH $ENV{DETECTOR_PATH}) endif() if(DEFINED ENV{BEAMLINE_PATH}) - set(BEAMLINE_PATH $ENV{BEAMLINE_PATH}) + set(BEAMLINE_PATH $ENV{BEAMLINE_PATH}) endif() -configure_file(eicrecon-this.sh.in eicrecon-this.sh @ONLY) +configure_file(eicrecon-this.sh.in eicrecon-this.sh @ONLY) -install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/eicrecon-this.sh DESTINATION bin) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/eicrecon-this.sh DESTINATION bin) -install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/eicmkplugin.py DESTINATION bin) +install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/eicmkplugin.py DESTINATION bin) diff --git a/src/services/algorithms_init/CMakeLists.txt b/src/services/algorithms_init/CMakeLists.txt index c4860e8584..4b3665f433 100644 --- a/src/services/algorithms_init/CMakeLists.txt +++ b/src/services/algorithms_init/CMakeLists.txt @@ -1,16 +1,17 @@ cmake_minimum_required(VERSION 3.16) -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/services/geometry/acts/CMakeLists.txt b/src/services/geometry/acts/CMakeLists.txt index f2a93cbcc4..cf9d3a87f9 100644 --- a/src/services/geometry/acts/CMakeLists.txt +++ b/src/services/geometry/acts/CMakeLists.txt @@ -1,16 +1,17 @@ cmake_minimum_required(VERSION 3.16) -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies @@ -18,51 +19,43 @@ plugin_add_dd4hep(${PLUGIN_NAME}) plugin_add_acts(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -plugin_link_libraries(${PLUGIN_NAME} podio::podio podio::podioRootIO algorithms_digi_library algorithms_tracking_library) +# Add libraries (same as target_include_directories but for both plugin and +# library) +plugin_link_libraries(${PLUGIN_NAME} podio::podio podio::podioRootIO + algorithms_digi_library algorithms_tracking_library) # -## Add include directories (works same as target_include_directories) -#plugin_include_directories(${PLUGIN_NAME} -# PUBLIC -# ${CMAKE_CURRENT_LIST_DIR} -# SYSTEM PUBLIC -# ${podio_INCLUDE_DIR} -# ${EDM4HEP_INCLUDE_DIR} -# ${DD4hep_INCLUDE_DIRS} -# ${ROOT_INCLUDE_DIRS} -# ${EDM4EIC_INCLUDE_DIRS}) -# -# -## Add libraries (works same as target_include_directories) -#plugin_link_libraries(${PLUGIN_NAME} EDM4HEP::edm4hep EDM4EIC::edm4eic ActsCore ActsPluginDD4hep ActsPluginJson ActsPluginTGeo spdlog::spdlog algorithms_tracking_library) -# -#target_link_libraries(${PLUGIN_NAME}_plugin EDM4HEP::edm4hep EDM4EIC::edm4eic ActsCore ActsPluginDD4hep ActsPluginJson ActsPluginTGeo spdlog::spdlog algorithms_tracking_library) -# -#get_target_property(ACTSPLUGINLIBS ${PLUGIN_NAME}_plugin LINK_LIBRARIES) -#message(STATUS "LINK_LIBRARIES = ${ACTSPLUGINLIBS}") -# -# -##LINK_LIBRARIES = JANA::jana2;spdlog::spdlog;EDM4HEP::edm4hep;;EDM4EIC::edm4eic;ActsCore;ActsPluginDD4hep;ActsPluginJson;ActsPluginTGeo;spdlog::spdlog;algorithms_tracking_library -##LINK_LIBRARIES = JANA::jana2;spdlog::spdlog;EDM4HEP::edm4hep;;EDM4EIC::edm4eic;ActsCore;ActsPluginDD4hep;ActsPluginJson;ActsPluginTGeo;spdlog::spdlog;algorithms_tracking_library; -## EDM4HEP::edm4hep;;EDM4EIC::edm4eic;ActsCore;ActsPluginDD4hep;ActsPluginJson;ActsPluginTGeo;spdlog::spdlog;algorithms_tracking_library -#target_link_libraries(${PLUGIN_NAME}_plugin -# Eigen3::Eigen -# EDM4HEP::edm4hep -# -# EDM4EIC::edm4eic -# ActsCore -# ActsPluginDD4hep -# ActsPluginJson -# ActsPluginTGeo -# spdlog::spdlog -# algorithms_tracking_library) +# Add include directories (works same as target_include_directories) +# plugin_include_directories(${PLUGIN_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR} +# SYSTEM PUBLIC ${podio_INCLUDE_DIR} ${EDM4HEP_INCLUDE_DIR} +# ${DD4hep_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${EDM4EIC_INCLUDE_DIRS}) +# +# Add libraries (works same as target_include_directories) +# plugin_link_libraries(${PLUGIN_NAME} EDM4HEP::edm4hep EDM4EIC::edm4eic +# ActsCore ActsPluginDD4hep ActsPluginJson ActsPluginTGeo spdlog::spdlog +# algorithms_tracking_library) +# +# target_link_libraries(${PLUGIN_NAME}_plugin EDM4HEP::edm4hep EDM4EIC::edm4eic +# ActsCore ActsPluginDD4hep ActsPluginJson ActsPluginTGeo spdlog::spdlog +# algorithms_tracking_library) +# +# get_target_property(ACTSPLUGINLIBS ${PLUGIN_NAME}_plugin LINK_LIBRARIES) +# message(STATUS "LINK_LIBRARIES = ${ACTSPLUGINLIBS}") +# +# LINK_LIBRARIES = +# JANA::jana2;spdlog::spdlog;EDM4HEP::edm4hep;;EDM4EIC::edm4eic;ActsCore;ActsPluginDD4hep;ActsPluginJson;ActsPluginTGeo;spdlog::spdlog;algorithms_tracking_library +# LINK_LIBRARIES = +# JANA::jana2;spdlog::spdlog;EDM4HEP::edm4hep;;EDM4EIC::edm4eic;ActsCore;ActsPluginDD4hep;ActsPluginJson;ActsPluginTGeo;spdlog::spdlog;algorithms_tracking_library; +# EDM4HEP::edm4hep;;EDM4EIC::edm4eic;ActsCore;ActsPluginDD4hep;ActsPluginJson;ActsPluginTGeo;spdlog::spdlog;algorithms_tracking_library +# target_link_libraries(${PLUGIN_NAME}_plugin Eigen3::Eigen EDM4HEP::edm4hep +# +# EDM4EIC::edm4eic ActsCore ActsPluginDD4hep ActsPluginJson ActsPluginTGeo +# spdlog::spdlog algorithms_tracking_library) diff --git a/src/services/geometry/dd4hep/CMakeLists.txt b/src/services/geometry/dd4hep/CMakeLists.txt index 970843481a..07c1b881c4 100644 --- a/src/services/geometry/dd4hep/CMakeLists.txt +++ b/src/services/geometry/dd4hep/CMakeLists.txt @@ -1,16 +1,17 @@ cmake_minimum_required(VERSION 3.16) -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/services/geometry/richgeo/CMakeLists.txt b/src/services/geometry/richgeo/CMakeLists.txt index f5e347b8d7..7c2a047211 100644 --- a/src/services/geometry/richgeo/CMakeLists.txt +++ b/src/services/geometry/richgeo/CMakeLists.txt @@ -1,16 +1,17 @@ cmake_minimum_required(VERSION 3.16) -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Find dependencies diff --git a/src/services/io/podio/CMakeLists.txt b/src/services/io/podio/CMakeLists.txt index 725d59fcf3..81b9cc3db4 100644 --- a/src/services/io/podio/CMakeLists.txt +++ b/src/services/io/podio/CMakeLists.txt @@ -5,72 +5,81 @@ get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Get properties at configuration evaluation time. The `$ types defined. Without -# this, root will complain about not having a compiled CollectionProxy. -root_generate_dictionary(G__datamodel_vectors - ${PROJECT_BINARY_DIR}/include/${DATAMODEL_RELATIVE_PATH}/datamodel_includes.h - MODULE ${PLUGIN_NAME}_plugin - LINKDEF datamodel_LinkDef.h) +# Create a ROOT dictionary with the vector types defined. +# Without this, root will complain about not having a compiled CollectionProxy. +root_generate_dictionary( + G__datamodel_vectors + ${PROJECT_BINARY_DIR}/include/${DATAMODEL_RELATIVE_PATH}/datamodel_includes.h + MODULE ${PLUGIN_NAME}_plugin LINKDEF datamodel_LinkDef.h) # Install root dictionaries made by PODIO set(my_root_dict_files ${CMAKE_CURRENT_BINARY_DIR}/lib${PLUGIN_NAME}_plugin_rdict.pcm - ${CMAKE_CURRENT_BINARY_DIR}/lib${PLUGIN_NAME}_plugin.rootmap -) + ${CMAKE_CURRENT_BINARY_DIR}/lib${PLUGIN_NAME}_plugin.rootmap) install(FILES ${my_root_dict_files} DESTINATION ${PLUGIN_OUTPUT_DIRECTORY}) diff --git a/src/services/log/CMakeLists.txt b/src/services/log/CMakeLists.txt index 79c4e2174d..a1a0449324 100644 --- a/src/services/log/CMakeLists.txt +++ b/src/services/log/CMakeLists.txt @@ -1,14 +1,15 @@ cmake_minimum_required(VERSION 3.16) -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME} WITH_STATIC_LIBRARY) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) diff --git a/src/services/rootfile/CMakeLists.txt b/src/services/rootfile/CMakeLists.txt index 7e0b2a1028..ac12f38105 100644 --- a/src/services/rootfile/CMakeLists.txt +++ b/src/services/rootfile/CMakeLists.txt @@ -1,16 +1,17 @@ cmake_minimum_required(VERSION 3.16) -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add cern root diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index f773177f7a..73148f8662 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -1,10 +1,11 @@ # Check if catch2 exists and unit tests can be built find_package(Catch2 3) if(Catch2_FOUND) - add_subdirectory(algorithms_test) - add_subdirectory(omnifactory_test) + add_subdirectory(algorithms_test) + add_subdirectory(omnifactory_test) else() - message(STATUS "Catch2 is not found. Skipping algorithms_test, omnifactory_test...") + message( + STATUS "Catch2 is not found. Skipping algorithms_test, omnifactory_test...") endif() add_subdirectory(reco_test) diff --git a/src/tests/algorithms_test/CMakeLists.txt b/src/tests/algorithms_test/CMakeLists.txt index 8e71e67005..ec47fe331a 100644 --- a/src/tests/algorithms_test/CMakeLists.txt +++ b/src/tests/algorithms_test/CMakeLists.txt @@ -2,19 +2,20 @@ get_filename_component(TEST_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # These tests can use the Catch2-provided main -add_executable(${TEST_NAME} - algorithmsInit.cc - calorimetry_CalorimeterIslandCluster.cc - calorimetry_CalorimeterHitDigi.cc - calorimetry_HEXPLIT.cc - pid_MergeTracks.cc - pid_MergeParticleID.cc - ) +add_executable( + ${TEST_NAME} + algorithmsInit.cc calorimetry_CalorimeterIslandCluster.cc + calorimetry_CalorimeterHitDigi.cc calorimetry_HEXPLIT.cc pid_MergeTracks.cc + pid_MergeParticleID.cc) -# Explicit linking to podio::podio is needed due to https://github.com/JeffersonLab/JANA2/issues/151 -target_link_libraries(${TEST_NAME} PRIVATE Catch2::Catch2WithMain algorithms_calorimetry_library algorithms_pid_library podio::podio podio::podioRootIO) +# Explicit linking to podio::podio is needed due to +# https://github.com/JeffersonLab/JANA2/issues/151 +target_link_libraries( + ${TEST_NAME} PRIVATE Catch2::Catch2WithMain algorithms_calorimetry_library + algorithms_pid_library podio::podio podio::podioRootIO) -# As-needed fails due to absent podio symbols in libJANA.so (https://github.com/JeffersonLab/JANA2/pull/255) +# As-needed fails due to absent podio symbols in libJANA.so +# (https://github.com/JeffersonLab/JANA2/pull/255) include(CheckLinkerFlag) check_linker_flag(CXX "-Wl,--no-as-needed" CXX_LINKER_HAS_no_as_needed) if(CXX_LINKER_HAS_no_as_needed) @@ -24,4 +25,5 @@ endif() # Install executable install(TARGETS ${TEST_NAME} DESTINATION bin) -add_test(NAME t_${TEST_NAME} COMMAND env LLVM_PROFILE_FILE=${TEST_NAME}.profraw $) +add_test(NAME t_${TEST_NAME} COMMAND env LLVM_PROFILE_FILE=${TEST_NAME}.profraw + $) diff --git a/src/tests/geometry_navigation_test/CMakeLists.txt b/src/tests/geometry_navigation_test/CMakeLists.txt index bf4f178223..e478607bc7 100644 --- a/src/tests/geometry_navigation_test/CMakeLists.txt +++ b/src/tests/geometry_navigation_test/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,14 +13,13 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -# plugin_link_libraries(${PLUGIN_NAME} ...) +# Add libraries (same as target_include_directories but for both plugin and +# library) plugin_link_libraries(${PLUGIN_NAME} ...) diff --git a/src/tests/omnifactory_test/CMakeLists.txt b/src/tests/omnifactory_test/CMakeLists.txt index 6c5f609a25..5310813444 100644 --- a/src/tests/omnifactory_test/CMakeLists.txt +++ b/src/tests/omnifactory_test/CMakeLists.txt @@ -2,37 +2,32 @@ get_filename_component(TEST_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # These tests can use the Catch2-provided main -add_executable(${TEST_NAME} - JOmniFactoryTests.cc - ) +add_executable(${TEST_NAME} JOmniFactoryTests.cc) find_package(spdlog REQUIRED) find_package(fmt REQUIRED) -# Explicit linking to podio::podio is needed due to https://github.com/JeffersonLab/JANA2/issues/151 -target_include_directories(${TEST_NAME} - PRIVATE - ${PROJECT_BINARY_DIR} - ${EICRECON_SOURCE_DIR}/src - ${PROJECT_SOURCE_DIR} - ${JANA_INCLUDE_DIR} - ${ROOT_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR}/include -) -target_link_libraries(${TEST_NAME} PRIVATE - log_plugin - EDM4EIC::edm4eic - EDM4HEP::edm4hep - ${JANA_LIB} - podio::podio - podio::podioRootIO - ${ROOT_LIBRARIES} - Catch2::Catch2WithMain - ${CMAKE_DL_LIBS} - ) - +# Explicit linking to podio::podio is needed due to +# https://github.com/JeffersonLab/JANA2/issues/151 +target_include_directories( + ${TEST_NAME} + PRIVATE ${PROJECT_BINARY_DIR} ${EICRECON_SOURCE_DIR}/src + ${PROJECT_SOURCE_DIR} ${JANA_INCLUDE_DIR} ${ROOT_INCLUDE_DIRS} + ${PROJECT_BINARY_DIR}/include) +target_link_libraries( + ${TEST_NAME} + PRIVATE log_plugin + EDM4EIC::edm4eic + EDM4HEP::edm4hep + ${JANA_LIB} + podio::podio + podio::podioRootIO + ${ROOT_LIBRARIES} + Catch2::Catch2WithMain + ${CMAKE_DL_LIBS}) # Install executable install(TARGETS ${TEST_NAME} DESTINATION bin) -add_test(NAME t_${TEST_NAME} COMMAND env LLVM_PROFILE_FILE=${TEST_NAME}.profraw $) +add_test(NAME t_${TEST_NAME} COMMAND env LLVM_PROFILE_FILE=${TEST_NAME}.profraw + $) diff --git a/src/tests/reco_test/CMakeLists.txt b/src/tests/reco_test/CMakeLists.txt index bf4f178223..e478607bc7 100644 --- a/src/tests/reco_test/CMakeLists.txt +++ b/src/tests/reco_test/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,14 +13,13 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -# plugin_link_libraries(${PLUGIN_NAME} ...) +# Add libraries (same as target_include_directories but for both plugin and +# library) plugin_link_libraries(${PLUGIN_NAME} ...) diff --git a/src/tests/track_propagation_test/CMakeLists.txt b/src/tests/track_propagation_test/CMakeLists.txt index bf4f178223..e478607bc7 100644 --- a/src/tests/track_propagation_test/CMakeLists.txt +++ b/src/tests/track_propagation_test/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,14 +13,13 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -# plugin_link_libraries(${PLUGIN_NAME} ...) +# Add libraries (same as target_include_directories but for both plugin and +# library) plugin_link_libraries(${PLUGIN_NAME} ...) diff --git a/src/tests/tracking_test/CMakeLists.txt b/src/tests/tracking_test/CMakeLists.txt index bf4f178223..e478607bc7 100644 --- a/src/tests/tracking_test/CMakeLists.txt +++ b/src/tests/tracking_test/CMakeLists.txt @@ -1,5 +1,6 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets @@ -12,14 +13,13 @@ plugin_add_acts(${PLUGIN_NAME}) plugin_add_cern_root(${PLUGIN_NAME}) plugin_add_event_model(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) # Add include directories (works same as target_include_directories) # plugin_include_directories(${PLUGIN_NAME} SYSTEM PUBLIC ... ) -# Add libraries -# (same as target_include_directories but for both plugin and library) -# plugin_link_libraries(${PLUGIN_NAME} ...) +# Add libraries (same as target_include_directories but for both plugin and +# library) plugin_link_libraries(${PLUGIN_NAME} ...) diff --git a/src/utilities/dump_flags/CMakeLists.txt b/src/utilities/dump_flags/CMakeLists.txt index 76064df969..413cc447a1 100644 --- a/src/utilities/dump_flags/CMakeLists.txt +++ b/src/utilities/dump_flags/CMakeLists.txt @@ -1,12 +1,13 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME}) diff --git a/src/utilities/eicrecon/CMakeLists.txt b/src/utilities/eicrecon/CMakeLists.txt index eca4533e9d..83b6c07caf 100644 --- a/src/utilities/eicrecon/CMakeLists.txt +++ b/src/utilities/eicrecon/CMakeLists.txt @@ -3,21 +3,32 @@ cmake_minimum_required(VERSION 3.16) project(eicrecon_project) # Find dependencies -find_package(JANA REQUIRED) +find_package(JANA REQUIRED) find_package(Threads REQUIRED) -find_package(fmt REQUIRED) +find_package(fmt REQUIRED) # Compile all sources into executable -file(GLOB SOURCES *.cpp *.cc *.c *.hpp *.hh *.h) +file( + GLOB + SOURCES + *.cpp + *.cc + *.c + *.hpp + *.hh + *.h) -set( INCLUDE_DIRS ${PROJECT_BINARY_DIR} ${EICRECON_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR} ${JANA_INCLUDE_DIR} ${ROOT_INCLUDE_DIRS}) -set( LINK_LIBRARIES ${JANA_LIB} ${ROOT_LIBRARIES} ${CMAKE_DL_LIBS} Threads::Threads podio::podio podio::podioRootIO) +set(INCLUDE_DIRS ${PROJECT_BINARY_DIR} ${EICRECON_SOURCE_DIR}/src + ${PROJECT_SOURCE_DIR} ${JANA_INCLUDE_DIR} ${ROOT_INCLUDE_DIRS}) +set(LINK_LIBRARIES ${JANA_LIB} ${ROOT_LIBRARIES} ${CMAKE_DL_LIBS} + Threads::Threads podio::podio podio::podioRootIO) # Define executable -add_executable( eicrecon ${SOURCES} ) -target_include_directories( eicrecon PUBLIC ${INCLUDE_DIRS}) -target_link_libraries(eicrecon ${LINK_LIBRARIES} ) -target_compile_definitions(eicrecon PRIVATE EICRECON_APP_VERSION=${CMAKE_PROJECT_VERSION}) +add_executable(eicrecon ${SOURCES}) +target_include_directories(eicrecon PUBLIC ${INCLUDE_DIRS}) +target_link_libraries(eicrecon ${LINK_LIBRARIES}) +target_compile_definitions( + eicrecon PRIVATE EICRECON_APP_VERSION=${CMAKE_PROJECT_VERSION}) # Install executable install(TARGETS eicrecon DESTINATION bin) diff --git a/src/utilities/janatop/CMakeLists.txt b/src/utilities/janatop/CMakeLists.txt index b7c44efef6..0408e5f1b4 100644 --- a/src/utilities/janatop/CMakeLists.txt +++ b/src/utilities/janatop/CMakeLists.txt @@ -1,12 +1,13 @@ -# Automatically set plugin name the same as the directory name -# Don't forget string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in its name +# Automatically set plugin name the same as the directory name Don't forget +# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in +# its name get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) # Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets # Setting default includes, libraries and installation paths plugin_add(${PLUGIN_NAME}) -# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp -# Then correctly sets sources for ${_name}_plugin and ${_name}_library targets -# Adds headers to the correct installation directory +# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then +# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds +# headers to the correct installation directory plugin_glob_all(${PLUGIN_NAME} PLUGIN_USE_CC_ONLY)