[CMake] absolute to relative paths

Soeren Freudiger muffmolch at gmx.de
Sat Dec 4 12:06:03 EST 2010


the nightly build runs fine. but without checked in project files you cannot ensure easily if it's the same as on your local machine.

nevertheless you still have the problem at renaming or moving the root directory!!!


Am 04.12.2010 um 17:33 schrieb Rolf Eike Beer:

> Am Samstag, 4. Dezember 2010 schrieb Soeren Freudiger:
>> 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.
> 
> Well, the simple answer is: don't check in generated files. Just run CMake 
> whenever they are needed (e.g. for nightly builds). That would allow you to 
> use e.g. NMake Makefiles in nightly builds with the help of JOM, which can 
> schedule the build jobs properly on multicore machines.
> 
> YMMV, but that's how it works.
> 
> Eike
> _______________________________________________
> 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



More information about the CMake mailing list