[KPhotoAlbum] Marble versioning

Harald Barth haba+kphotoalbum at kth.se
Mon Jul 26 14:18:38 BST 2021


>     ...
>     set(Marble_MIN_VERSION "0.28.0")
>     ...
>     find_package(Marble ${Marble_MIN_VERSION} REQUIRED)
>     ...
> 
> which caused the following error:
> 
>     CMake Error at CMakeLists.txt:43 (find_package):
>     Could not find a configuration file for package "Marble" that is
>         compatible with requested version "0.28.0".


If you want MIN 0.28.0 and it is then not happy with 21.4.0 which by
all measures I can think of is bigger than 0.28.0 then I think the
error must be with the find_package.

Hmmm.

After reading up on find_package I read that find_package does
consider major version changes to be incompatible even if the version
is bigger.

https://cmake.org/cmake/help/latest/command/find_package.html

Cmake since 3.19 has the feature that you could write:

find_package(Marble 0.28.0...99.0.0 REQUIRED)

which would cover major version up to and including 99.

With older Cmake, I am afraid you loose unless one can do something
like this. First seek for any 0.x.y version bigger than 0.28.0 and
if that fails search for any version 21.x.y:

find_package(Marble 0.28.0)
if(NOT (${Maple_VERSION} MATCHES "0\..*") )
    find_package(Marble 21.0.0 REQUIRED)
endif()

My Cmake is rusty though.

Harald.



More information about the Kphotoalbum mailing list