[CMake] Using CMake for a library with many different buildoptions...

Brad King brad.king at kitware.com
Mon Dec 20 09:12:07 EST 2004


Hajo Kirchhoff wrote:
> Reinhold Füreder wrote:
>> As far as I know the generation of makefiles and/or Visual Studio
>> Project files re-usable on different computers does not work IN GENERAL.
>> The reason is that the generated files are dependent on your local
>> platform AND are using mostly (?) full path information.  
>>
> Thank you for your response.
> 
> The project files will work, at least after some tweaking which can be 
> automated. They only include the absolute paths to the CMake tool for 
> the ALL/INSTALL targets, but these targets are not strictly neccessary 
> for Visual Studio only environments, so I'd strip them out.
> 
> As for makefiles: what does the 'use relative paths' advanced option do? 
> I thought it might solve precisely this problem.

The option will use relative paths from the build tree to the source 
tree for most of the build.  It does not work for custom commands but 
does for basic libraries and executables.  This may help you make 
stand-alone Makefiles but they probably won't be reliable.

You should consider just requiring users to get CMake.  It is available 
in binary form for many platforms and is included in packaged form on 
Cygwin and in some Linux distributions.  We distribute many projects 
that require users to get CMake and very rarely are the reported 
problems related to this requirement.

-Brad


More information about the CMake mailing list