Use CMAKE_INSTALL_FULL_LIBDIR in compat cmake files

According to
https://cmake.org/cmake/help/v3.25/module/GNUInstallDirs.html,
CMAKE_INSTALL_LIBDIR can be an absolute path. For instance, Nixpkgs
[defined it to an absolute path in /nix/store](3d17b4c305/pkgs/development/tools/build-managers/cmake/setup-hook.sh (L101)).
The output in this case is:

	# result-glslang/lib/cmake/glslangTargets.cmake:5
	include("${CMAKE_CURRENT_LIST_DIR}/../..//nix/store/3mif2zibig0cilk5dbz334278n0vlq9s-glslang-1.3.231.0/lib/glslang/glslang-targets.cmake")

Signed-off-by: Chuang Zhu <git@chuang.cz>
This commit is contained in:
Chuang Zhu
2022-11-19 12:03:20 +08:00
committed by arcady-lunarg
parent 9c7fd1a33e
commit dfc97740ff
8 changed files with 11 additions and 11 deletions

View File

@@ -125,7 +125,7 @@ if(ENABLE_GLSLANG_INSTALL)
message(WARNING \"Using `SPVRemapperTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::SPVRemapper)
include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(SPVRemapper ALIAS glslang::SPVRemapper)
@@ -137,7 +137,7 @@ if(ENABLE_GLSLANG_INSTALL)
message(WARNING \"Using `SPIRVTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::SPIRV)
include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(SPIRV ALIAS glslang::SPIRV)