# Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin # SPDX-License-Identifier: BSD-3-Clause # # -------------------------------------------------------------------------- # $Maintainer: Timo Sachsenberg $ # $Authors: Timo Sachsenberg $ # -------------------------------------------------------------------------- #------------------------------------------------------------------------------ # The OpenMS core: an installation (or the SDK) of exactly the version of this add-on, # with the TOPP tool framework (component CLI: OpenMS::OpenMS_CLI, TOPPBase, ToolHandler). # Found through CMAKE_PREFIX_PATH or OpenMS_DIR. #------------------------------------------------------------------------------ find_package(OpenMS ${OPENMS_PACKAGE_VERSION} EXACT CONFIG REQUIRED COMPONENTS CLI) ## A core that still contains MetaProSIP registers it in its own registry: installed next ## to that, MetaProSIP.tsv would register the name twice, which ToolHandler rejects for ## every tool. (The registries of other add-ons in the same prefix are fine.) file(GLOB _openms_core_registries "${OPENMS_DATA_DIR}/TOOLS/*.tsv") list(FILTER _openms_core_registries EXCLUDE REGEX "/MetaProSIP\\.tsv$") foreach(_registry IN LISTS _openms_core_registries) file(STRINGS "${_registry}" _metaprosip_in_core REGEX "^MetaProSIP\t") if(_metaprosip_in_core) message(FATAL_ERROR "The tool registry of the OpenMS installation, ${_registry}, already lists " "MetaProSIP: that OpenMS still contains the tool. Build OpenMS-MetaProSIP against an OpenMS " "from after MetaProSIP moved to this repository.") endif() endforeach() unset(_openms_core_registries) unset(_metaprosip_in_core) message(STATUS "Building against OpenMS ${OpenMS_VERSION} in ${OpenMS_DIR}") message(STATUS " shared data of that installation: ${OPENMS_DATA_DIR}") message(STATUS " executables of that installation: ${OPENMS_BIN_DIR}") #------------------------------------------------------------------------------ # Boost: private to the OpenMS library (no installed OpenMS header includes it), so # MetaProSIP, which uses Boost.Math, finds the headers itself. #------------------------------------------------------------------------------ ## CONFIG: BoostConfig.cmake, as OpenMS does (the FindBoost module is deprecated, CMP0167); ## the minimum version is that of OpenMS (cmake/build_system_macros.cmake there). find_package(Boost 1.81.0 REQUIRED CONFIG) #------------------------------------------------------------------------------ # Version strings of the packages #------------------------------------------------------------------------------ set(OPENMS_CORE_VERSION_FULLSTRING "" CACHE STRING "Full version string of the OpenMS core installation (e.g. 3.7.0-pre-nightly-2026-11-06). Empty: take it from the core's CMake package, or derive it from git.") include(GetGitRevisionDescription) option(GIT_TRACKING "Embed git information (branch, revision) into the version strings of the packages." ON) if(GIT_TRACKING) git_archival_info("${PROJECT_SOURCE_DIR}/.git_archival.txt" _mps_archival_describe OPENMS_GIT_SHORT_SHA1 OPENMS_GIT_LC_DATE OPENMS_GIT_ARCHIVAL_FOUND) if(OPENMS_GIT_ARCHIVAL_FOUND) if(_mps_archival_describe STREQUAL "v${OPENMS_PACKAGE_VERSION}") set(OPENMS_GIT_SHORT_REFSPEC "${_mps_archival_describe}") else() set(OPENMS_GIT_SHORT_REFSPEC "exported") endif() set(OPENMS_GIT_INFO_FOUND TRUE) else() git_short_info(OPENMS_GIT_SHORT_REFSPEC OPENMS_GIT_SHORT_SHA1 OPENMS_GIT_LC_DATE OPENMS_GIT_INFO_FOUND) if(OPENMS_GIT_INFO_FOUND AND OPENMS_GIT_SHORT_REFSPEC STREQUAL "HEAD") git_get_exact_tag(_mps_release_tag --tags --match "v${OPENMS_PACKAGE_VERSION}") if(_mps_release_tag STREQUAL "v${OPENMS_PACKAGE_VERSION}") set(OPENMS_GIT_SHORT_REFSPEC "${_mps_release_tag}") endif() endif() endif() endif() if(NOT GIT_TRACKING OR NOT OPENMS_GIT_INFO_FOUND) if(NOT DEFINED OPENMS_GIT_SHORT_SHA1) set(OPENMS_GIT_SHORT_SHA1 "exported") endif() if(NOT DEFINED OPENMS_GIT_SHORT_REFSPEC OR OPENMS_GIT_SHORT_REFSPEC STREQUAL "") set(OPENMS_GIT_SHORT_REFSPEC "exported") endif() if(NOT DEFINED OPENMS_GIT_LC_DATE) set(OPENMS_GIT_LC_DATE "1970-01-01") endif() endif() if(OPENMS_CORE_VERSION_FULLSTRING) set(OPENMS_PACKAGE_VERSION_FULLSTRING "${OPENMS_CORE_VERSION_FULLSTRING}") set(_mps_fullstring_source "OPENMS_CORE_VERSION_FULLSTRING") elseif(DEFINED OpenMS_VERSION_FULLSTRING AND NOT OpenMS_VERSION_FULLSTRING STREQUAL "") set(OPENMS_PACKAGE_VERSION_FULLSTRING "${OpenMS_VERSION_FULLSTRING}") set(_mps_fullstring_source "the OpenMS CMake package") else() ## derived from this repository's git state, exactly as the core does it if(OPENMS_GIT_SHORT_REFSPEC MATCHES "disabled" OR OPENMS_GIT_SHORT_REFSPEC MATCHES "exported") string(TIMESTAMP _mps_date "%Y%m%d") set(OPENMS_PACKAGE_VERSION_FULLSTRING "${OPENMS_PACKAGE_VERSION}-pre-${OPENMS_GIT_SHORT_REFSPEC}-${_mps_date}") elseif(OPENMS_GIT_SHORT_REFSPEC MATCHES "release*" OR OPENMS_GIT_SHORT_REFSPEC MATCHES "master" OR OPENMS_GIT_SHORT_REFSPEC STREQUAL "v${OPENMS_PACKAGE_VERSION}") set(OPENMS_PACKAGE_VERSION_FULLSTRING "${OPENMS_PACKAGE_VERSION}") else() string(REGEX REPLACE "[/_]" "-" _mps_refspec "${OPENMS_GIT_SHORT_REFSPEC}") string(REGEX REPLACE " .*$" "" _mps_lc_date "${OPENMS_GIT_LC_DATE}") set(OPENMS_PACKAGE_VERSION_FULLSTRING "${OPENMS_PACKAGE_VERSION}-pre-${_mps_refspec}-${_mps_lc_date}") endif() set(_mps_fullstring_source "the git state of this repository") if(NOT "${PACKAGE_TYPE}" STREQUAL "none") message(WARNING "The full version string of the OpenMS core is unknown (its CMake package does not " "export it), so the package takes '${OPENMS_PACKAGE_VERSION_FULLSTRING}' from ${_mps_fullstring_source}. " "The packages are installed on top of the core package, whose version carries the " "core's string: pass -DOPENMS_CORE_VERSION_FULLSTRING=.") endif() endif() ## the part after "-pre-" (empty for a release) string(REGEX REPLACE "^${OPENMS_PACKAGE_VERSION}(-pre-)?" "" OPENMS_PACKAGE_VERSION_PRERELEASE_IDENTIFIER "${OPENMS_PACKAGE_VERSION_FULLSTRING}") message(STATUS " full version string ${OPENMS_PACKAGE_VERSION_FULLSTRING} (from ${_mps_fullstring_source})") #------------------------------------------------------------------------------ # Where the core's TOPP tools are (FuzzyDiff and the tools the TOPPAS pipelines run). # The OpenMS SDK carries no executables; the tests that need them are then left out. #------------------------------------------------------------------------------ # The TOPP tools of the core, which the tests use (FuzzyDiff). The SDK has none: the # tests that need them are then left out (src/tests/CMakeLists.txt). #------------------------------------------------------------------------------ set(OPENMS_TOPP_BIN_DIR "${OPENMS_BIN_DIR}" CACHE PATH "Directory with the TOPP tools of the OpenMS core (FuzzyDiff, FileInfo, ...), used by the tests.")