[CMake] absolute to relative paths

Soeren Freudiger muffmolch at gmx.de
Sat Dec 4 06:02:34 EST 2010


Hello
I know that the usage of relatives path out of the sources seems to be not an easy one.
But maybe you can give me a workaround.

We use following directory structure

- dev 
   |--project1: CMakeLists.txt
   |            main.cpp
   |            stdafx.h
   |            project1.vcproj
   |            ...               
    --project2: CMakeLists.txt
   |            main.cpp
   |            stdafx.h
   |            project2.vcproj
   |            ...               
    --folder3
   |      |------- project3: CMakeLists.txt
   |                         main.cpp
   |                         stdafx.h
   |                         project3.vcproj
   |                         ...               
   |--sharedSrc 
          |
          |-- folder1: *.cxx; *.h
          |
          |-- folder2: *.cxx; *.h
          |
          |-- folder4: *.cxx; *.h


Ok. As you can see, we are building the vcproj inside the project folders. source and binary path are identical. The problem is that all file paths to files in shared are absolute. Yes, I read the FAQ, yes, I see that's the philosophy of CMake. But our vcproj is also in the hg-repository for nightly builds and the dev dir is located in another directory and drive. The 3rd party dependencies are the same. So it doesn't work without reconfigure.

Second point is: sometimes the dev will be cloned again or the dev dir will be renamed. In worst case we change the source code in dev even by opening the vcproj in dev2, because the files point to dev!!! using relative paths to dev would avoid that.

Do you have an idea how the problem can be avoided without reconfiguring. Especially the renaming stuff happens quite often inside the developement. Maybe the source root can be redirected to dev somehow while using the CMakeList.txt of an specific subfolder?

Best regards,
SirAnn








-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101204/5a193ae1/attachment.htm>


More information about the CMake mailing list