Build products created outside build directory
Platform: Windows 10
CMake Version: 3.13.1
Compiler: Visual Studio Community 2017
Issue: Build products are being created outside the build directory.
Reproduce by:
- create project directory
- place attached CMakeLists.txt file into project directory.
- generate via:
md build\compile
cd build\compile
cmake -G"Visual Studio 15 2017 Win64" ..\..
- Open solution build\compile\cm.sln in Visual Studio 2017
- Right click on "INSTALL" target and select "Build"
- note that
build/cm.dir
andbuild/x64
directories are created
This is troublesome since the more common practice is to create a single directory "build" for the generated build system and doing the actual compilation. This puts build products in the source tree where they become subject to revision control and configuration management practices.
Note that this does NOT manifest when the build is invoked as:
cmake --build . --config Release --target INSTALL
This seems to be a result of some un-prefixed references to $(IntDir) in the Studio database.