CMake and Make need to be run twice in order to build code successfully
问题 I am using CMake 3.8.2, GNU make 4.2.1 and GCC 6.4.0 for my C++14 project and I noticed a strange behavior when building. I am using CMake for an out-of-source build in a sub-folder called "build" where I run cmake .. followed by make . CMake runs fine without any errors and make will build all source files like I expect until it is done compiling and starts linking them. It will then fail with an error [ 83%] ... [100%] Linking CXX executable myproject /usr/bin/ld: some-source-file.cc.o: