Skip to content

Commit

Permalink
qt: Fix relocation of Config.cmake files
Browse files Browse the repository at this point in the history
Using the absolute LIBDIR_FULL breaks the use of the cmake files
when cross compiling for a system in a different sysroot.

The ${PACKAGE_PREFIX_DIR} was already used for /include,
reusing it for libs resolves this issue.
  • Loading branch information
Johnnynator authored and ximion committed Mar 17, 2024
1 parent c663ce3 commit f07208d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qt/cmake/AppStreamQt5Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ add_library(AppStreamQt SHARED IMPORTED)
set_target_properties(AppStreamQt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/include/"
INTERFACE_LINK_LIBRARIES "Qt5::Core"
IMPORTED_LOCATION "@LIBDIR_FULL@/libAppStreamQt5.so.${AppStreamQt5_VERSION}"
IMPORTED_LOCATION "${PACKAGE_PREFIX_DIR}/@LIBDIR@/libAppStreamQt5.so.${AppStreamQt5_VERSION}"
IMPORTED_SONAME "libAppStreamQt5.${AppStreamQt5_VERSION_MAJOR}"
)

Expand Down
2 changes: 1 addition & 1 deletion qt/cmake/AppStreamQtConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ add_library(AppStreamQt SHARED IMPORTED)
set_target_properties(AppStreamQt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/include/"
INTERFACE_LINK_LIBRARIES "Qt::Core"
IMPORTED_LOCATION "@LIBDIR_FULL@/libAppStreamQt.so.${AppStreamQt_VERSION}"
IMPORTED_LOCATION "${PACKAGE_PREFIX_DIR}/@LIBDIR@/libAppStreamQt.so.${AppStreamQt_VERSION}"
IMPORTED_SONAME "libAppStreamQt.${AppStreamQt_VERSION_MAJOR}"
)

Expand Down
1 change: 1 addition & 0 deletions qt/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ install_headers(asqt_pub_headers, subdir: f'@asqt_library_name@')

cmake_data = configuration_data()
cmake_data.set('LIBDIR_FULL', join_paths(get_option('prefix'), get_option('libdir')))
cmake_data.set('LIBDIR', get_option('libdir'))
cmake_data.set('PREFIX', get_option('prefix'))
cmake_data.set('VERSION', as_version)

Expand Down

0 comments on commit f07208d

Please sign in to comment.