Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Export CMAKEMOD dir #1560

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
################################################################################
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################
################################################################################
# Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################

install(DIRECTORY
modules
scripts
DESTINATION ${PROJECT_INSTALL_DATADIR}/cmake
)
set(PROJECT_CMAKE_MODULES_DIR ${PROJECT_INSTALL_DATADIR}/cmake/modules PARENT_SCOPE)
30 changes: 18 additions & 12 deletions cmake/modules/FindFairRoot.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
################################################################################
# Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################
# Find FairRoot installation
################################################################################
# Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################
# Find FairRoot installation
# Check the environment variable "FAIRROOTPATH"

include(FindPackageHandleStandardArgs)
Expand Down Expand Up @@ -49,10 +49,16 @@ FIND_PATH(FAIRROOT_LIBRARY_DIR NAMES libBase.so libBase.dylib PATHS
${FAIRROOTPATH}/lib64
)

FIND_PATH(FAIRROOT_CMAKEMOD_DIR
NAMES modules/FindFairRoot.cmake modules/ROOTMacros.cmake
PATHS ${FAIRROOTPATH}/share/fairbase/cmake
)
if(FairRoot_CMAKE_MODULES_DIR)
set(FAIRROOT_CMAKEMOD_DIR "${FairRoot_CMAKE_MODULES_DIR}"
CACHE PATH "FairRoot CMake Modules Directory"
)
else()
FIND_PATH(FAIRROOT_CMAKEMOD_DIR
NAMES modules/FindFairRoot.cmake modules/ROOTMacros.cmake
PATHS ${FAIRROOTPATH}/share/fairbase/cmake
)
endif()

find_package_handle_standard_args(FairRoot CONFIG_MODE
REQUIRED_VARS FAIRROOT_INCLUDE_DIR
Expand Down
3 changes: 2 additions & 1 deletion cmake/private/FairRootConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# Copyright (C) 2021-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# Copyright (C) 2021-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
Expand All @@ -10,6 +10,7 @@

set_and_check(@PROJECT_NAME@_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
set(@PROJECT_NAME@_BINDIR "@PACKAGE_CMAKE_INSTALL_FULL_BINDIR@")
set(@PROJECT_NAME@_CMAKE_MODULES_DIR "@PACKAGE_PROJECT_CMAKE_MODULES_DIR@")
set(@PROJECT_NAME@_GIT_VERSION "@PROJECT_GIT_VERSION@")
set(@PROJECT_NAME@_CXX_STANDARD "@CMAKE_CXX_STANDARD@")

Expand Down
5 changes: 3 additions & 2 deletions cmake/private/FairRootPackage.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# Copyright (C) 2021-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# Copyright (C) 2021-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
Expand Down Expand Up @@ -32,7 +32,8 @@ function(install_cmake_package)
PATH_VARS
CMAKE_INSTALL_PREFIX
CMAKE_INSTALL_FULL_BINDIR
PACKAGE_INSTALL_DESTINATION)
PACKAGE_INSTALL_DESTINATION
PROJECT_CMAKE_MODULES_DIR)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
VERSION "${PROJECT_VERSION}"
Expand Down
Loading