<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hello,<br><br></div>I'm very new to CMake.<br></div>I'm
 trying to set up an out-of-source C++ build on Windows with CMake so I can use version
 control with eclipse (mingw make). My setup should look like this:<br>

<br></div>Root<br></div><div>---> build<br></div>---> src<br></div>---> test<br><br></div>src/ contains my program code and test/ the unit tests. There is a main method in src/ and in test/. <br>I
 now want the possibility to build all the source files in src/ with 
Debug or Release configuration, and a seperate build target for unit 
tests that creates another executable with only the unit tests, but 
should link the source files from src/ as well.<br>

<br></div>So far, I've read the articles on the Eclipse CDT4 generator (<a href="http://www.vtk.org/Wiki/Eclipse_CDT4_Generator" target="_blank">http://www.vtk.org/Wiki/Eclipse_CDT4_Generator</a>) and various others I have found elsewhere.<br>



<br></div>I can get the build for src/ to work if I run cmake from the 
build folder: "cmake ../src". Now I tried to get the second build target
 (test/) to work, but I can't get it.<br><br></div>I tried to add a 
CMakeLists.txt in the Root folder which just defines the project and add
 the two directories, but then CMake generates the error that "The build
 directory is a subdirectory of the source directory.", which is not 
really true, since all the source is in src/ and build/ is a sibling...<br>

<br></div>I honestly don't know what to do. Can anyone help me?<br><br>Thank you,<br>Azzu</div>