Hello, I'm very new to CMake. 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:
Root ---> build ---> src ---> test src/ contains my program code and test/ the unit tests. There is a main method in src/ and in test/. 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. So far, I've read the articles on the Eclipse CDT4 generator ( http://www.vtk.org/Wiki/Eclipse_CDT4_Generator) and various others I have found elsewhere. 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. 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... I honestly don't know what to do. Can anyone help me? Thank you, Azzu
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake