diff options
author | Juan Ramos <juan@lunarg.com> | 2023-10-07 13:45:18 -0600 |
---|---|---|
committer | Juan Ramos <114601453+juan-lunarg@users.noreply.github.com> | 2023-10-09 10:08:33 -0600 |
commit | 520eaa5a525adce0cdbdc7b8c7f7d8f0375340a6 (patch) | |
tree | c3b61cd77e21066c3f1f6280061abbe959fe5c91 | |
parent | 6d4f07c995975f12d0d8d7a8483cdcbf6c455108 (diff) | |
download | Vulkan-Loader-520eaa5a525adce0cdbdc7b8c7f7d8f0375340a6.tar.gz Vulkan-Loader-520eaa5a525adce0cdbdc7b8c7f7d8f0375340a6.tar.bz2 Vulkan-Loader-520eaa5a525adce0cdbdc7b8c7f7d8f0375340a6.zip |
cmake: Fix vulkan.pc regressions
closes #1318, #1319
-rw-r--r-- | loader/CMakeLists.txt | 4 | ||||
-rw-r--r-- | loader/vulkan.pc.in | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 4cb11472..c6366eef 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -448,10 +448,14 @@ if (PKG_CONFIG_FOUND) # BUG: The following code will NOT work well with `cmake --install ... --prefix <dir>` # due to this code relying on CMAKE_INSTALL_PREFIX being defined at configure time. + # + # NOTE: vulkan.pc essentially cover both Vulkan-Loader and Vulkan-Headers for legacy reasons. if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "") set(CMAKE_INSTALL_LIBDIR_PC ${CMAKE_INSTALL_FULL_LIBDIR}) + set(CMAKE_INSTALL_INCLUDEDIR_PC ${CMAKE_INSTALL_FULL_INCLUDEDIR}) else() file(RELATIVE_PATH CMAKE_INSTALL_LIBDIR_PC ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_LIBDIR}) + file(RELATIVE_PATH CMAKE_INSTALL_INCLUDEDIR_PC ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_INCLUDEDIR}) endif() configure_file("vulkan.pc.in" "vulkan.pc" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vulkan.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") diff --git a/loader/vulkan.pc.in b/loader/vulkan.pc.in index 16b0ded7..6a285f26 100644 --- a/loader/vulkan.pc.in +++ b/loader/vulkan.pc.in @@ -1,4 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR_PC@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR_PC@ + Name: Vulkan-Loader Description: Vulkan Loader Version: @VULKAN_LOADER_VERSION@ -Libs: -L@CMAKE_INSTALL_LIBDIR_PC@ -lvulkan@VULKAN_LIB_SUFFIX@ +Libs: -L${libdir} -lvulkan@VULKAN_LIB_SUFFIX@ +Cflags: -I${includedir} |