When building a target called echo, a generated Xcode project is invalid.
Given the following project:
CMakeLists.txt: ```cmake project(echo_test C)
add_executable(echo echo.c) echo.c: ``` #include <stdio.h>
int main() { printf("This is the echo target, not the system echo.\n"); return 1; }
When using the Xcode generator, the project will resolve 'echo' in scripts to the built target:
=== BUILD AGGREGATE TARGET ALL_BUILD OF PROJECT echo_test WITH THE DEFAULT CONFIGURATION (Debug) ===
Check dependencies
Write auxiliary files write-file /Users/alex/Raptor/EchoCmake/build/echo_test.build/Debug/ALL_BUILD.build/Script-AE1C7A348C1F4592B65C68B5.sh chmod 0755 /Users/alex/Raptor/EchoCmake/build/echo_test.build/Debug/ALL_BUILD.build/Script-AE1C7A348C1F4592B65C68B5.sh
PhaseScriptExecution CMake\ Rules build/echo_test.build/Debug/ALL_BUILD.build/Script-AE1C7A348C1F4592B65C68B5.sh cd /Users/alex/Raptor/EchoCmake /bin/sh -c /Users/alex/Raptor/EchoCmake/build/echo_test.build/Debug/ALL_BUILD.build/Script-AE1C7A348C1F4592B65C68B5.sh echo ""
/Users/alex/Raptor/EchoCmake/build/Debug/echo Build\ all\ projects This is the echo target, not the system echo. make: *** [/Users/alex/Raptor/EchoCmake/build/CMakeFiles/ALL_BUILD] Error 1 Command /bin/sh failed with exit code 2
** BUILD FAILED **
The following build commands failed: PhaseScriptExecution CMake\ Rules build/echo_test.build/Debug/ALL_BUILD.build/Script-AE1C7A348C1F4592B65C68B5.sh (1 failure)
Version information:
Mac Version: 10.13 Beta (17A360a)
Kenneths-MacBook-Pro:build alex$ xcodebuild -version Xcode 9.0 Build version 9M214v Kenneths-MacBook-Pro:build alex$ cmake --version cmake version 3.9.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).