th....@gmx.de wrote:
hm, right - this would solve my problem, but sadly writing everything in one 
CMakeLists.txt file was not a clever idea, as the projects should be build 
independently.

Another solution I had (someone posted that) is creating a subdirectory for 
every project and place the specific CMakeLists.txt file there. However, this 
would change the CMAKE_SOURCE_DIR to the projects subdirectory; what is kind of 
nasty.

Any ideas to change the root back?


You should be able to use add_subdirectory for this. It supports out of source source.

add_subdirectory can be given a full path to a source directory. So, you should be able to "share" source dirs between projects. They will get re-compiled for each project, but it should work.

-Bill
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to