我正在尝试创建一个运行多行 cmake 命令的配置脚本。
cmake -S . -B build-mac \
-G Xcode \
-DCMAKE_CONFIGURATION_TYPES="Debug;Release" \
-DCMAKE_INSTALL_PREFIX=install/mac \
-DCMAKE_TOOLCHAIN_FILE=Modules/Darwin.cmake
但我得到了错误
" does not exist.source directory "/Users/.../scripts/
Specify --help for usage, or press the help button on the CMake GUI.
./release-mac.bash: line 2: -G: command not found
: command not found line 3: -DCMAKE_CONFIGURATION_TYPES=Debug;Release
: No such file or directory -DCMAKE_INSTALL_PREFIX=install/mac
: No such file or directory -DCMAKE_TOOLCHAIN_FILE=Modules/Darwin.cmake
因此,初始行之后的所有行都被解释为新命令。为什么我的续行不起作用?