mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 13:11:36 +00:00
- Add the bundled GoogleTest with FetchContent and OVERRIDE_FIND_PACKAGE, so it uses the compiler and flags of the FairMQ build - Build it in a block() without gmock, install and static analysis - Replace build_bundled() with fairmq_init_submodule(), which runs git submodule update only if the submodule folder is empty, and stops with a clear error if it stays empty - Install the bundled FairCMakeModules into the build directory with its tests off, as before - Use the bundled PicoSHA2 headers directly from the source tree - With USE_EXTERNAL_GTEST, GTest is a private dependency and no longer in FairMQ_PACKAGE_DEPENDENCIES Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
42 lines
1.5 KiB
CMake
42 lines
1.5 KiB
CMake
################################################################################
|
|
# Copyright (C) 2018-2026 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" #
|
|
################################################################################
|
|
|
|
include_guard(GLOBAL)
|
|
|
|
find_package(Git QUIET)
|
|
|
|
# fairmq_init_submodule(<path>)
|
|
#
|
|
# Checks out the Git submodule <path> (relative to PROJECT_SOURCE_DIR) if its
|
|
# folder is empty. Stops with an error if the folder stays empty.
|
|
function(fairmq_init_submodule path)
|
|
set(dir "${PROJECT_SOURCE_DIR}/${path}")
|
|
file(GLOB content "${dir}/*")
|
|
if(content)
|
|
return()
|
|
endif()
|
|
|
|
if(GIT_EXECUTABLE AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
|
message(STATUS "Checking out submodule ${path}")
|
|
execute_process(
|
|
COMMAND ${GIT_EXECUTABLE} submodule update --init -- ${path}
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
OUTPUT_VARIABLE log
|
|
ERROR_VARIABLE log
|
|
RESULT_VARIABLE res
|
|
)
|
|
file(GLOB content "${dir}/*")
|
|
endif()
|
|
|
|
if(NOT content)
|
|
message(FATAL_ERROR "The bundled package in ${path} is missing. "
|
|
"Run `git submodule update --init` in ${PROJECT_SOURCE_DIR}, "
|
|
"or install the package. ${log}")
|
|
endif()
|
|
endfunction()
|