aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Dubois <dexcelstraun7@gmail.com>2019-03-05 10:57:56 -0800
committerPhil Christensen <philc@microsoft.com>2019-03-05 10:57:56 -0800
commita50fbaa756be5821004b3e26dca4cfa41dd878b4 (patch)
tree220a1b7cdf5afa66d1e838e8c4fb10e898d1bdd1
parentfd2330af7af3c8b523bec5e3de8fdbaf7ed75f5e (diff)
downloadvcpkg-a50fbaa756be5821004b3e26dca4cfa41dd878b4.tar.gz
vcpkg-a50fbaa756be5821004b3e26dca4cfa41dd878b4.zip
[glslang] Export CMake package files (#5513)
* Add patch file to make glslang known to pkg-config * Proper patch file * Fix paths in the patch file * Add missing space so patch file can apply * Remove debug/share directory * Export everything to the glslangConfig * Export the SPIRV target as well * Remove not-working patch for main CMake file * [glslang] Remove call to windows CRT changing function * [glslang] Remove unnecessary calls to install inside patch * [glslang] Check cmake imports correctly
-rw-r--r--ports/glslang/CMakeLists-targets.patch133
-rw-r--r--ports/glslang/portfile.cmake7
2 files changed, 139 insertions, 1 deletions
diff --git a/ports/glslang/CMakeLists-targets.patch b/ports/glslang/CMakeLists-targets.patch
new file mode 100644
index 000000000..73661fa35
--- /dev/null
+++ b/ports/glslang/CMakeLists-targets.patch
@@ -0,0 +1,133 @@
+diff --git a/ChooseMSVCCRT.cmake b/ChooseMSVCCRT.cmake
+index 2097881..f0cddd7 100644
+--- a/ChooseMSVCCRT.cmake
++++ b/ChooseMSVCCRT.cmake
+@@ -102,4 +102,4 @@ set(MSVC_CRT
+ MT
+ MTd)
+
+-choose_msvc_crt(MSVC_CRT)
++# choose_msvc_crt(MSVC_CRT)
+diff --git a/OGLCompilersDLL/CMakeLists.txt b/OGLCompilersDLL/CMakeLists.txt
+index 5bb3f0e..e7be6e6 100644
+--- a/OGLCompilersDLL/CMakeLists.txt
++++ b/OGLCompilersDLL/CMakeLists.txt
+@@ -9,6 +9,12 @@ if(WIN32)
+ endif(WIN32)
+
+ if(ENABLE_GLSLANG_INSTALL)
+- install(TARGETS OGLCompiler
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ install(TARGETS OGLCompiler EXPORT glslangConfig
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ )
++ export(TARGETS OGLCompiler
++ NAMESPACE glslang::
++ FILE "${CMAKE_CURRENT_BINARY_DIR}/OGLCompiler-config.cmake"
++ )
+ endif(ENABLE_GLSLANG_INSTALL)
+diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt
+index b682419..3a10f1a 100755
+--- a/SPIRV/CMakeLists.txt
++++ b/SPIRV/CMakeLists.txt
+@@ -64,8 +64,14 @@ if(WIN32)
+ endif(WIN32)
+
+ if(ENABLE_GLSLANG_INSTALL)
+- install(TARGETS SPIRV SPVRemapper
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ install(TARGETS SPIRV EXPORT glslangConfig
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ )
++ export(TARGETS SPIRV
++ NAMESPACE glslang::
++ FILE "${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake"
++ )
+
+ install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/)
+ endif(ENABLE_GLSLANG_INSTALL)
+diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt
+index 7a50ab6..b70345e 100644
+--- a/glslang/CMakeLists.txt
++++ b/glslang/CMakeLists.txt
+@@ -97,8 +97,19 @@ if(WIN32)
+ endif(WIN32)
+
+ if(ENABLE_GLSLANG_INSTALL)
+- install(TARGETS glslang
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ install(TARGETS glslang EXPORT glslangConfig
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ )
++ export(TARGETS glslang
++ NAMESPACE glslang::
++ FILE "${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake"
++ )
++ install(
++ EXPORT glslangConfig
++ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/glslang"
++ NAMESPACE glslang::
++ )
+ endif(ENABLE_GLSLANG_INSTALL)
+
+ if(ENABLE_GLSLANG_INSTALL)
+diff --git a/glslang/OSDependent/Unix/CMakeLists.txt b/glslang/OSDependent/Unix/CMakeLists.txt
+index 1bf49e1..edd733c 100644
+--- a/glslang/OSDependent/Unix/CMakeLists.txt
++++ b/glslang/OSDependent/Unix/CMakeLists.txt
+@@ -3,6 +3,12 @@ set_property(TARGET OSDependent PROPERTY FOLDER glslang)
+ set_property(TARGET OSDependent PROPERTY POSITION_INDEPENDENT_CODE ON)
+
+ if(ENABLE_GLSLANG_INSTALL)
+- install(TARGETS OSDependent
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ install(TARGETS OSDependent EXPORT glslangConfig
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ )
++ export(TARGETS OSDependent
++ NAMESPACE glslang::
++ FILE "${CMAKE_CURRENT_BINARY_DIR}/OSDependent-config.cmake"
++ )
+ endif(ENABLE_GLSLANG_INSTALL)
+diff --git a/glslang/OSDependent/Windows/CMakeLists.txt b/glslang/OSDependent/Windows/CMakeLists.txt
+index f257418..cadd70d 100644
+--- a/glslang/OSDependent/Windows/CMakeLists.txt
++++ b/glslang/OSDependent/Windows/CMakeLists.txt
+@@ -15,6 +15,12 @@ if(WIN32)
+ endif(WIN32)
+
+ if(ENABLE_GLSLANG_INSTALL)
+- install(TARGETS OSDependent
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ install(TARGETS OSDependent EXPORT glslangConfig
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ )
++ export(TARGETS OSDependent
++ NAMESPACE glslang::
++ FILE "${CMAKE_CURRENT_BINARY_DIR}/OSDependent-config.cmake"
++ )
+ endif(ENABLE_GLSLANG_INSTALL)
+diff --git a/hlsl/CMakeLists.txt b/hlsl/CMakeLists.txt
+index 98dfad7..94d96a0 100755
+--- a/hlsl/CMakeLists.txt
++++ b/hlsl/CMakeLists.txt
+@@ -26,6 +26,12 @@ if(WIN32)
+ endif(WIN32)
+
+ if(ENABLE_GLSLANG_INSTALL)
+- install(TARGETS HLSL
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ install(TARGETS HLSL EXPORT glslangConfig
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ )
++ export(TARGETS HLSL
++ NAMESPACE glslang::
++ FILE "${CMAKE_CURRENT_BINARY_DIR}/HLSL-config.cmake"
++ )
+ endif(ENABLE_GLSLANG_INSTALL)
diff --git a/ports/glslang/portfile.cmake b/ports/glslang/portfile.cmake
index b7cbdb98e..f2ec0e3cd 100644
--- a/ports/glslang/portfile.cmake
+++ b/ports/glslang/portfile.cmake
@@ -8,12 +8,14 @@ vcpkg_from_github(
REF b5b5f918c6b72d7cf2ee73641cc6c6ddb211ca70
SHA512 ec0f7a23fa60457a481c7b3acf4c127c3bf898d23655d346aeafb304f74e798d632c83d676873f2c764d241de6dc4392cff8d6ce0ee509a4b74ee2233b01c008
HEAD_REF master
+ PATCHES
+ CMakeLists-targets.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
- OPTIONS -DCMAKE_DEBUG_POSTFIX=d
+ OPTIONS -DCMAKE_DEBUG_POSTFIX=d -DSKIP_GLSLANG_INSTALL=OFF
)
vcpkg_install_cmake()
@@ -21,6 +23,9 @@ vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(RENAME "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/tools")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# Handle copyright
file(COPY ${CMAKE_CURRENT_LIST_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/glslang)
+
+vcpkg_test_cmake(PACKAGE_NAME glslang)