From f8f494ff145d55de3cc778036bc7cff57726c86f Mon Sep 17 00:00:00 2001 From: d3x0r Date: Tue, 4 Jul 2017 05:54:57 -0700 Subject: [PATCH 1/9] Add option to skip installation As a static target, when included in other cmake projects, it is not needed to install these libraries and headers as part of this build, and just need to link to this. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d98c9fe..9bc94b01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Adhere to GNU filesystem layout conventions include(GNUInstallDirs) +option(SKIP_GLSLANG_INSTALL "Skip installation" ${SKIP_GLSLANG_INSTALL}) +if(NOT ${SKIP_GLSLANG_INSTALL}) + set(ENABLE_GLSLANG_INSTALL ON) +endif() + option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON) option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON) From 42b692619217cb154eb63ca516ae348571b96fe9 Mon Sep 17 00:00:00 2001 From: d3x0r Date: Tue, 4 Jul 2017 05:57:08 -0700 Subject: [PATCH 2/9] Update CMakeLists.txt --- glslang/CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt index 7c9476d8..c61aaa62 100644 --- a/glslang/CMakeLists.txt +++ b/glslang/CMakeLists.txt @@ -93,10 +93,14 @@ if(WIN32) source_group("MachineIndependent\\Preprocessor" REGULAR_EXPRESSION "MachineIndependent/preprocessor/*") endif(WIN32) -install(TARGETS glslang - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS glslang + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_GLSLANG_INSTALL) -foreach(file ${HEADERS}) - get_filename_component(dir ${file} DIRECTORY) - install(FILES ${file} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/${dir}) -endforeach() +if(ENABLE_GLSLANG_INSTALL) + foreach(file ${HEADERS}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${file} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/${dir}) + endforeach() +endif(ENABLE_GLSLANG_INSTALL) From 02ed9eb2a1261a25d740fd1bdd5055145fd0ed77 Mon Sep 17 00:00:00 2001 From: d3x0r Date: Tue, 4 Jul 2017 05:57:47 -0700 Subject: [PATCH 3/9] Update CMakeLists.txt --- glslang/OSDependent/Unix/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/glslang/OSDependent/Unix/CMakeLists.txt b/glslang/OSDependent/Unix/CMakeLists.txt index 99e9ce1b..bf39a1f9 100644 --- a/glslang/OSDependent/Unix/CMakeLists.txt +++ b/glslang/OSDependent/Unix/CMakeLists.txt @@ -1,5 +1,7 @@ add_library(OSDependent STATIC ossource.cpp ../osinclude.h) set_property(TARGET OSDependent PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON) -install(TARGETS OSDependent - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS OSDependent + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_GLSLANG_INSTALL) From cde46127a155009dc5a7b39ccd7b72335e6c6a63 Mon Sep 17 00:00:00 2001 From: d3x0r Date: Tue, 4 Jul 2017 05:58:07 -0700 Subject: [PATCH 4/9] Update CMakeLists.txt --- glslang/OSDependent/Windows/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/glslang/OSDependent/Windows/CMakeLists.txt b/glslang/OSDependent/Windows/CMakeLists.txt index cc65ad6a..0cd7c948 100644 --- a/glslang/OSDependent/Windows/CMakeLists.txt +++ b/glslang/OSDependent/Windows/CMakeLists.txt @@ -13,5 +13,7 @@ if(WIN32) source_group("Source" FILES ${SOURCES}) endif(WIN32) -install(TARGETS OSDependent - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS OSDependent + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_GLSLANG_INSTALL) From 57a2b22d34204a39f23756ae29725303c52a648e Mon Sep 17 00:00:00 2001 From: d3x0r Date: Tue, 4 Jul 2017 05:59:03 -0700 Subject: [PATCH 5/9] Update CMakeLists.txt --- gtests/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtests/CMakeLists.txt b/gtests/CMakeLists.txt index 2616ac06..15b73f4b 100644 --- a/gtests/CMakeLists.txt +++ b/gtests/CMakeLists.txt @@ -28,8 +28,10 @@ if(BUILD_TESTING) add_executable(glslangtests ${TEST_SOURCES}) set_property(TARGET glslangtests PROPERTY FOLDER tests) glslang_set_link_args(glslangtests) - install(TARGETS glslangtests - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + if(ENABLE_GLSLANG_INSTALL) + install(TARGETS glslangtests + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif(ENABLE_GLSLANG_INSTALL) set(GLSLANG_TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Test") # Supply a default test root directory, so that manual testing From 9c6ea324cbff3bf07b3c0080a9cb1aeb7fd31c99 Mon Sep 17 00:00:00 2001 From: d3x0r Date: Tue, 4 Jul 2017 05:59:34 -0700 Subject: [PATCH 6/9] Update CMakeLists.txt --- hlsl/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hlsl/CMakeLists.txt b/hlsl/CMakeLists.txt index 24f5c9a1..ea4942cf 100755 --- a/hlsl/CMakeLists.txt +++ b/hlsl/CMakeLists.txt @@ -24,5 +24,7 @@ if(WIN32) source_group("Source" FILES ${SOURCES} ${HEADERS}) endif(WIN32) -install(TARGETS HLSL - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS HLSL + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_GLSLANG_INSTALL) From 89de217f0150d8938777cfb0f635697b92ea27b0 Mon Sep 17 00:00:00 2001 From: d3x0r Date: Tue, 4 Jul 2017 06:00:04 -0700 Subject: [PATCH 7/9] Update CMakeLists.txt --- OGLCompilersDLL/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OGLCompilersDLL/CMakeLists.txt b/OGLCompilersDLL/CMakeLists.txt index 8edd143e..08f54550 100644 --- a/OGLCompilersDLL/CMakeLists.txt +++ b/OGLCompilersDLL/CMakeLists.txt @@ -7,5 +7,7 @@ if(WIN32) source_group("Source" FILES ${SOURCES}) endif(WIN32) -install(TARGETS OGLCompiler - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS OGLCompiler + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_GLSLANG_INSTALL) From 4e53d9052d5ddb78f3c87251e421eafb021659d3 Mon Sep 17 00:00:00 2001 From: d3x0r Date: Tue, 4 Jul 2017 06:00:35 -0700 Subject: [PATCH 8/9] Update CMakeLists.txt --- SPIRV/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt index 2ad86d67..95d2cab5 100755 --- a/SPIRV/CMakeLists.txt +++ b/SPIRV/CMakeLists.txt @@ -51,7 +51,9 @@ if(WIN32) source_group("Source" FILES ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) endif(WIN32) -install(TARGETS SPIRV SPVRemapper - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS SPIRV SPVRemapper + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/) + install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/) +endif(ENABLE_GLSLANG_INSTALL) From 459331249062d5e2c7e204b0f91429e64e48c24e Mon Sep 17 00:00:00 2001 From: d3x0r Date: Tue, 4 Jul 2017 06:01:09 -0700 Subject: [PATCH 9/9] Update CMakeLists.txt --- StandAlone/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt index c61667cc..9321c24d 100644 --- a/StandAlone/CMakeLists.txt +++ b/StandAlone/CMakeLists.txt @@ -37,8 +37,10 @@ if(WIN32) source_group("Source" FILES ${SOURCES}) endif(WIN32) -install(TARGETS glslangValidator - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS glslangValidator + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install(TARGETS spirv-remap - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(TARGETS spirv-remap + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif(ENABLE_GLSLANG_INSTALL)