Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.1.0
-
None
-
Archlinux x86_64
-
27313d12449cf9e84ca1e3ebb723c23a889edc18
Description
I got an issue when trying to generate makefile with cmake.
Qt package is installed with /usr/lib prefix, resulting in cmake configs being placed for example under /usr/lib/Qt5Widget/Qt5WidgetConfig.cmake. When trying to locate this config file, cmake follows the symlink under /lib64/ path, which is technically the same /usr/lib/
However, the assignment
get_filename_component(_qt5Widgets_install_prefix "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
will not resolve the symlink and result in / path being used. This leads to inevitable error in wherever the "_qt5Widgets_install_prefix" will be used.
That most likely happens because symlink resolve takes place after the path has been constructed. The workaround for this will most likely be the post-processing of _qt5Widget_install_prefix, like
get_filename_component(_qt5Widgets_install_prefix, "${CMAKE_CURRENT_LIST_DIR}"../../../ ABSOLUTE)
set(_qt5Widget_install_prefix ${_qt5Widget_install_prefix}../../../)
Furthermore, please notice, that in most current cmake 2.8 the semantics of ABSOLUTE keyword is changed so it doesn't cause a symlink resolve anymore. To actually perform resolve one should use REALPATH keyword instead. Source: http://www.cmake.org/cmake/help/v2.8.10/cmake.html#command:get_filename_component