The absolute path in INCLUDE_INSTALL_DIR eventually made it into the exported MarbleTargets.cmake file in the INTERFACE_INCLUDE_DIRECTORIES target property.
There should be _no_ absolute paths in any outputs of install.
This bug causes the following use-case to fail:
- Make Install marble
- Move/deploy install directory to another location (e.g. deploy from Continuous Integration server)
- Link to Marble from new cmake project with find_package(Marble)
Because of this absolute path, the install directory cannot be moved after it is created.
This is the CMake error:
CMake Error in src/libs/geo/CMakeLists.txt Imported target "Marble" includes non-existent path "/absolute/path/to/include/dirs/that/doesnt/exist" in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include: * The path was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and references files it does not provide.
The following is a minimal example CMakeLists.txt file that can produce the error:
cmake_minimum_required(VERSION 3.5) project(Geo VERSION 1.0) find_package(Marble REQUIRED) add_executable(geo PRIVATE main.cpp) target_link_libraries(PUBLIC Marble)