Closed rhabacker closed 1 year ago
I am open to this improvement but do not have the resources to address it in the near future. If someone wishes to create such a change, please leave a comment to avoid duplicate effort.
I'm preparing such a change and will open an mr when I'm sure, that is works a expected.
when do that, please, can change this?
diff --git a/OGLCompilersDLL/CMakeLists.txt b/OGLCompilersDLL/CMakeLists.txt
index 0b007d45c..74c287b3d 100644
--- a/OGLCompilersDLL/CMakeLists.txt
+++ b/OGLCompilersDLL/CMakeLists.txt
@@ -44,5 +44,5 @@ endif()
if(ENABLE_GLSLANG_INSTALL)
install(TARGETS OGLCompiler EXPORT OGLCompilerTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(EXPORT OGLCompilerTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ install(EXPORT OGLCompilerTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
endif(ENABLE_GLSLANG_INSTALL)
diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt
index 39d69940c..a96455c92 100644
--- a/SPIRV/CMakeLists.txt
+++ b/SPIRV/CMakeLists.txt
@@ -132,12 +132,12 @@ if(ENABLE_GLSLANG_INSTALL)
endif()
if (ENABLE_SPVREMAPPER)
- install(EXPORT SPVRemapperTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ install(EXPORT SPVRemapperTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/spirv.pc.in ${CMAKE_CURRENT_BINARY_DIR}/spirv.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/spirv.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
- install(EXPORT SPIRVTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ install(EXPORT SPIRVTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/SPIRV/)
endif()
diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt
index bff9ab617..67cd1d339 100644
@@ -90,12 +90,12 @@ endif()
if(ENABLE_GLSLANG_INSTALL)
install(TARGETS glslangValidator EXPORT glslangValidatorTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- install(EXPORT glslangValidatorTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ install(EXPORT glslangValidatorTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
if(ENABLE_SPVREMAPPER)
install(TARGETS spirv-remap EXPORT spirv-remapTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- install(EXPORT spirv-remapTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ install(EXPORT spirv-remapTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
endif()
if(BUILD_SHARED_LIBS)
@@ -107,5 +107,5 @@ if(ENABLE_GLSLANG_INSTALL)
install(TARGETS glslang-default-resource-limits EXPORT glslang-default-resource-limitsTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
- install(EXPORT glslang-default-resource-limitsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ install(EXPORT glslang-default-resource-limitsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
endif()
diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt
index 57d70d45f..f4ed06937 100644
--- a/glslang/CMakeLists.txt
+++ b/glslang/CMakeLists.txt
@@ -212,7 +212,7 @@ if(ENABLE_GLSLANG_INSTALL)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
- install(EXPORT glslangTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ install(EXPORT glslangTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/glslang.pc.in ${CMAKE_CURRENT_BINARY_DIR}/glslang.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glslang.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
diff --git a/glslang/OSDependent/Unix/CMakeLists.txt b/glslang/OSDependent/Unix/CMakeLists.txt
index 354a3e977..6763649aa 100644
--- a/glslang/OSDependent/Unix/CMakeLists.txt
+++ b/glslang/OSDependent/Unix/CMakeLists.txt
@@ -55,5 +55,5 @@ endif()
if(ENABLE_GLSLANG_INSTALL)
install(TARGETS OSDependent EXPORT OSDependentTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(EXPORT OSDependentTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ install(EXPORT OSDependentTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
endif()
diff --git a/glslang/OSDependent/Windows/CMakeLists.txt b/glslang/OSDependent/Windows/CMakeLists.txt
index 9cf1b7fba..c32e0b8e1 100644
--- a/glslang/OSDependent/Windows/CMakeLists.txt
+++ b/glslang/OSDependent/Windows/CMakeLists.txt
@@ -50,5 +50,5 @@ endif()
if(ENABLE_GLSLANG_INSTALL)
install(TARGETS OSDependent EXPORT OSDependentTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(EXPORT OSDependentTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ install(EXPORT OSDependentTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
endif()
diff --git a/hlsl/CMakeLists.txt b/hlsl/CMakeLists.txt
index 62faa1957..3d9765d1b 100644
--- a/hlsl/CMakeLists.txt
+++ b/hlsl/CMakeLists.txt
@@ -55,5 +55,5 @@ if(ENABLE_GLSLANG_INSTALL)
install(TARGETS HLSL EXPORT HLSLTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
- install(EXPORT HLSLTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ install(EXPORT HLSLTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
endif()
is for install the cmake files into subtirectory insteaf off plain /usr/libfoo/cmake
, like do a tons of other projects
is a cmake valid path, so not broke things
greetings
is for install the cmake files into subtirectory
This is covered by pr #2778
Thanks
@rhabacker Is this still an issue? find_package(glslang)
seems to work for me as expected on linux (testing with cmake 3.26.4).
The mentioned pr #2989 fixed this issue.
According to https://cmake.org/cmake/help/latest/guide/using-dependencies/index.html#libraries-providing-config-file-packages, libraries that want to support cmake find_package() in configuration mode must install a set of files as shown for the VulkanSceneGraph package.
Once these files are installed, the vsg library can be added as a dependency to a package with cmake support by using
to a CMakeLists.txt file.
A look into the installed files of the glslang package (see for example at openSUSE
shows that there are no
*Config.cmake
and *Version.cmake` files.For example, trying to use the
glslang
package withwill not find this package. Similar happens with the other provided packages
SPIRV
,HLSL
, etc.This problem has been currently documented on https://github.com/vsg-dev/VulkanSceneGraph/issues/322#issuecomment-915160228.