setting CMAKE_RUNTIME_OUTPUT_DIRECTORY on OS X w/ the makefile generator breaks linking binaries.
I have a project ( https://github.com/HumbleNet/HumbleNet ) that when I build using the XCode generator everything works fine.. However when I use the Makefile generator it incorrectly generates the link.txt files.
This is recreatable with cmake 3.6.2, 3.7.1, and 3.8.2
This is what the apibuilder/CMakeFiles/APIBuilder.dir/link.txt is when I comment out the CMAKE_RUNTIME_OUTPUT_DIRECTORY assignment in the main CmakeListst.txt (line 16)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -fno-strict-aliasing -stdlib=libc++ -fvisibility=hidden -g -arch i386 -arch x86_64 -mmacosx-version-min=10.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -stdlib=libc++ CMakeFiles/APIBuilder.dir/build_csharp.cpp.o CMakeFiles/APIBuilder.dir/build_export.cpp.o CMakeFiles/APIBuilder.dir/build_include.cpp.o CMakeFiles/APIBuilder.dir/build_loader.cpp.o CMakeFiles/APIBuilder.dir/builder.cpp.o CMakeFiles/APIBuilder.dir/utilities.cpp.o -o APIBuilder -Wl,-rpath,@executable_path/../Frameworks ../libjsonparser.a
However when I add that back in the "-o" ends up being ".".
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -fno-strict-aliasing -stdlib=libc++ -fvisibility=hidden -g -arch i386 -arch x86_64 -mmacosx-version-min=10.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -stdlib=libc++ CMakeFiles/APIBuilder.dir/build_csharp.cpp.o CMakeFiles/APIBuilder.dir/build_export.cpp.o CMakeFiles/APIBuilder.dir/build_include.cpp.o CMakeFiles/APIBuilder.dir/build_loader.cpp.o CMakeFiles/APIBuilder.dir/builder.cpp.o CMakeFiles/APIBuilder.dir/utilities.cpp.o -o . -Wl,-rpath,@executable_path/../Frameworks ../libjsonparser.a
This cmake works fine on linux using the Makefile generator.