llvm-rc: CMAKE_COMMAND is improperly quoted in command invocation
If CMake installed into a path with spaces and llvm-rc is selected as the resource compiler, the path to CMake is not properly quoted in generated makefile.
Perhaps CMAKE_RC_COMPILE_OBJECT
should use <CMAKE_COMMAND>
instead of ${CMAKE_COMMAND}
?
Tested with CMake 3.18.1.
# CMakeLists.txt
cmake_minimum_required(VERSION 3.18)
project(RcTest CXX)
add_executable(test_exe
"main.cpp"
"main.rc"
)
// main.cpp
int main() {}
// main.rc
#pragma code_page(65001)
#include <winres.h>
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
$ where cmake
C:\Users\Nick Hutchinson\scoop\shims\cmake.exe
$ cmake . -GNinja -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_RC_COMPILER_INIT=llvm-rc
$ ninja
ninja: fatal: CreateProcess: %1 is not a valid Win32 application.
# CMakeFiles/rules.ninja
rule RC_COMPILER__test_exe_Debug
depfile = $DEP_FILE
deps = gcc
command = C:/Users/Nick Hutchinson/scoop/apps/cmake/3.18.1/bin/cmake.exe -E cmake_llvm_rc $in $out.pp C:\Users\NICKHU~1\scoop\shims\clang-cl.exe $DEFINES -DRC_INVOKED $INCLUDES $FLAGS -clang:-MD -clang:-MF -clang:$DEP_FILE -E $in -- C:\Users\NICKHU~1\scoop\shims\llvm-rc.exe $DEFINES -I SOURCE_DIR $INCLUDES /fo $out $out.pp
description = Building RC object $out