Skip to content
Draft
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
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ include(${PROJECT_SOURCE_DIR}/cmake/install_macros.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/doc_macros.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/add_library_macros.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/export_macros.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/topp_tool_macros.cmake)
## The TOPP tool macros (openms_topp_tool(), openms_write_tool_registry(),
## openms_install_tool_registry()) come with the CLI layer of the OpenMS CMake package
## (cmake/find_openms.cmake).

#------------------------------------------------------------------------------
# Package type
Expand Down
14 changes: 13 additions & 1 deletion cmake/find_openms.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
#------------------------------------------------------------------------------
# The dependencies of the GUI layer:
# - the installed OpenMS core with its CLI layer (OpenMS::OpenMS, OpenMS::OpenMS_CLI),
# of exactly the version of this repository: the GUI is compiled against its headers
# of exactly the version of this repository: the GUI is compiled against its headers,
# and the TOPP tool macros of that layer (OpenMSToolMacros.cmake: openms_topp_tool(),
# openms_write_tool_registry(), openms_install_tool_registry()) register the GUI TOPP
# tools
# - Qt 6
# Point CMAKE_PREFIX_PATH (or OpenMS_DIR) at the OpenMS installation, e.g. the OpenMS SDK.
#------------------------------------------------------------------------------
Expand All @@ -18,6 +21,15 @@
## (OpenMS::OpenMS_GUI) as well; this build provides that target itself.
set(OpenMS_IGNORE_GUI_LAYER TRUE)
find_package(OpenMS ${OPENMS_PACKAGE_VERSION} EXACT CONFIG REQUIRED COMPONENTS CLI)
foreach(_command IN ITEMS openms_reset_topp_tools openms_topp_tool openms_write_tool_registry
openms_install_tool_registry)
if(NOT COMMAND ${_command})
message(FATAL_ERROR "The OpenMS CMake package in ${OpenMS_DIR} does not provide the TOPP tool macros "
"(OpenMSToolMacros.cmake, ${_command}()), which register the GUI TOPP tools with ToolHandler. "
"Build against an OpenMS that installs them with its CLI layer (OpenMS/OpenMS#11042 and later).")
endif()
endforeach()
unset(_command)

## A core from before the split may have been built with its own GUI library. Its
## imported OpenMS::OpenMS_GUI would clash with the library built here, and its installed
Expand Down
148 changes: 0 additions & 148 deletions cmake/topp_tool_macros.cmake

This file was deleted.

15 changes: 6 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@ add_subdirectory(openms_gui)

#------------------------------------------------------------------------------
# The tool registry of the GUI layer, OpenMS-GUI.tsv, generated from the
# openms_topp_tool() declarations of src/openms_gui. It is installed into
# share/OpenMS/TOOLS next to the registry of the OpenMS core (OpenMS.tsv);
# ToolHandler reads every *.tsv it finds there. That directory holds registry
# files and nothing else.
# openms_topp_tool() declarations of src/openms_gui. It is installed next to the
# registry of the OpenMS core (OpenMS.tsv), into the directory that OpenMS
# installation keeps its registries in (share/OpenMS/TOOLS by default;
# OPENMS_TOOL_REGISTRY_DESTINATION of its CMake package); ToolHandler reads every
# *.tsv it finds there. That directory holds registry files and nothing else.
#------------------------------------------------------------------------------
openms_write_tool_registry("${OPENMS_TOOL_REGISTRY_BUILD_FILE}")
install(FILES "${OPENMS_TOOL_REGISTRY_BUILD_FILE}"
DESTINATION ${INSTALL_SHARE_DIR}/TOOLS
COMPONENT ${OPENMS_GUI_APPLICATIONS_COMPONENT}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
)
openms_install_tool_registry("${OPENMS_TOOL_REGISTRY_BUILD_FILE}" COMPONENT ${OPENMS_GUI_APPLICATIONS_COMPONENT})

#------------------------------------------------------------------------------
# Desktop integration (Linux). The GUI layer installs no other shared data: the style
Expand Down
2 changes: 1 addition & 1 deletion src/tests/topp/check_tool_registry.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cmake_minimum_required(VERSION 3.24 FATAL_ERROR)

### Checks the generated TOPP tool registry.
###
### The registry is written by openms_write_tool_registry() (cmake/topp_tool_macros.cmake) from
### The registry is written by openms_write_tool_registry() (the TOPP tool macros of OpenMS) from
### the same openms_topp_tool() declarations that produce the executables, so the registry and
### the build cannot describe different sets of tools; that is the point of generating it and
### there is nothing to cross-check. What generating it does not rule out is the generator
Expand Down
Loading