From 3992259996aee72a65b99a0731584b2d69fcf32e Mon Sep 17 00:00:00 2001 From: friendlyanon Date: Tue, 2 Jul 2024 19:55:24 +0200 Subject: [PATCH] Fix `glslangValidator` installation This caused the glslang[tools] vcpkg feature to not install properly, because the glslangValidator executable didn't exist for tool installation. --- StandAlone/CMakeLists.txt | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt index e0fdb487..9ecdcd23 100644 --- a/StandAlone/CMakeLists.txt +++ b/StandAlone/CMakeLists.txt @@ -90,21 +90,28 @@ endif() # Create a symbolic link to glslang named glslangValidator for backwards compatibility set(legacy_glslang_name "glslangValidator${CMAKE_EXECUTABLE_SUFFIX}") set(link_method create_symlink) -if (WIN32 OR MINGW) -set(link_method copy_if_different) +if(WIN32 OR MINGW) + set(link_method copy_if_different) endif() -add_custom_command(TARGET glslang-standalone - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E ${link_method} $ ${legacy_glslang_name} - WORKING_DIRECTORY $) + +add_custom_command( + TARGET glslang-standalone POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E "${link_method}" "\$" "${legacy_glslang_name}" + WORKING_DIRECTORY "\$" + VERBATIM +) if(GLSLANG_ENABLE_INSTALL) install(TARGETS glslang-standalone EXPORT glslang-targets) # Create the same symlink at install time - install(CODE "execute_process( \ - COMMAND ${CMAKE_COMMAND} -E ${link_method} $ ${legacy_glslang_name} \ - WORKING_DIRECTORY \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})") + install(CODE "\ + message(STATUS \"Installing (${link_method}): \$ -> \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}\") + execute_process( + COMMAND \"\${CMAKE_COMMAND}\" -E ${link_method} [=[\$]=] [=[${legacy_glslang_name}]=] + WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}\" + ) + ") if(ENABLE_SPVREMAPPER) install(TARGETS spirv-remap EXPORT glslang-targets) -- 2.29.1.windows.1