[CMake] Relative (source files) vs Absolute (include files) path

Ryan Pavlik rpavlik at iastate.edu
Wed Feb 3 12:17:36 EST 2010


On 2/2/10 5:23 PM, Brian Davis wrote:
> Why I care:
>
> Lets say that I someone wants to check the Visual Studio project goop 
> produced by CMake in trunk and check out in a diffrent directory in 
> their branch on another machine.  With absolute paths sprinkled all 
> over effectively makes this impossible.
>
This may be an actual bug/behavior you're found, but I thought I should 
mention this:

There's lots of explanations about this elsewhere, so I'll let you 
google for them, but basically, copying a build tree to another location 
(are you doing out-of-source builds? you should...) is not supported and 
probably won't be without a provided patch. Installing CMake is not a 
very high burden, and systems are different enough that relying on a 
generated project file is a poor idea.

Also, using glob or glob_recurse is the wrong way to make a list of 
source files: that way, cmake has no idea about when it needs to 
re-generate the visual studio projects/makefiles/etc. because of an 
added or removed file.  Set that variable manually, and just update it 
when you add new files.  Having each file listed once in a 
cmakelists.txt is not too bad, and it can save headaches.

Hope this helps!

Ryan

-- 
Ryan Pavlik
Human-Computer Interaction Graduate Student
Virtual Reality Applications Center
Iowa State University

rpavlik at iastate.edu
http://academic.cleardefinition.com/



More information about the CMake mailing list