Subtle in-source vs. out-of-source build difference
Newbie question... up until now I have only used cmake to build things. Now I'm starting to think about developing a cmake file, so started with the tutorial. One of the first things I wanted to understand is in-source vs. out-of-source builds. I made a separate binary directory to build the first tutorial. I then did commands like this
cd <tutorial-binary-dir> cmake <tutorial-source-dir>\CMakeLists.txt
To my surprise, binaries were generated in <tutorial-source-dir>
and nothing was generated in <tutorial-binary-dir>
.
Next I wiped the source dir clean of all binary files, then tried these commands:
cd <tutorial-binary-dir> cmake <tutorial-source-dir>
This time I got what I expected, binaries were generated in <tutorial-binary-dir>
and nothing was generated in <tutorial-source-dir>
.
This difference in behavior seems very subtle. Is it the intended behavior, and if so, why?