Skip to content

Astro is a dependency

Adriaan de Groot requested to merge work/adridg/cmake-3-24 into master

With CMake 3.24, the dependency Astro is checked-for when reading MarbleTargets. Since MarbleConfig did not look for it, doing find_package(Marble) with a CMake-3.24-built Marble will fail.

Look for the dependency, first. Without it,

CMake Error at CMakeLists.txt:61 (find_package):
  Found package configuration file:

    /usr/local/lib/cmake/Marble/MarbleConfig.cmake

  but it set Marble_FOUND to FALSE so package "Marble" is considered to be
  NOT FOUND.  Reason given by package:

  The following imported targets are referenced, but are missing: Astro

Here is part of the diff between MarbleTargets.cmake generated with CMake 3.23 (-) and 3.24 (+):

-# This file does not depend on other imported targets which have
-# been exported from the same project but in a separate export set.
+# Make sure the targets which have been exported in some other
+# export set exist.
+unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)
+foreach(_target "Astro" )
+  if(NOT TARGET "${_target}" )
+    set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets "${${CMAKE_FIND_PAC
KAGE_NAME}_NOT_FOUND_MESSAGE_targets} ${_target}")
+  endif()
+endforeach()

I don't know why this was done at the CMake end.

Merge request reports