On Thu, Sep 24, 2009 at 09:32:54AM +0200, [email protected] wrote:
> Maybe I did not get the point of CMAKE_SOURCE_DIR :-/
> What I do is creating a directory "packages\project1" here I place the
> starting CMakeLists.txt file and another subdirectory "build".
>
> The CMakeLists.txt consists of
>
> ADD_SUBDIRECTORY(../../myfirstdir)
> ADD_SUBDIRECTORY(../../myseconddir)
> ADD_SUBDIRECTORY(../../mythirddir)
>
> Within the "build" directory I start "cmake ..".
>
> What I think is happening is that the CMAKE_SOURCE_DIR is set to
> [whatever]\package\project1
>
> This is not what I want, as the source root (where all
> CMakeLists.txt-files written up until now depend on) is [whatever].
>
> So the solution would be to change _all_ ${CMAKE_SOURCE_DIR} to
> ${CMAKE_SOURCE_DIR}\..\.. or not to use ${CMAKE_SOURCE_DIR} and to
> navigate by relative paths.
Maybe you explained it upthread but why not put your top-level
CMakeLists.txt in [whatever]?
You could also set a myProjectRoot and point it to
"${CMAKE_SOURCE_DIR}/../..". If you don't like the .. in your path, use
get_filename_component to normalize that path.
tyler
_______________________________________________
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