[CMake] The right way to link a library from multiple directories

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Thu Jul 24 12:38:48 EDT 2008


Sebastian Krause schrieb:
> Andreas Pakulat <apaku at gmx.de> wrote:
>> Thats not going to work on all platforms. There are various platforms
>> which don't allow static libs to be linked into shared libs.
>>
>> But it should be possible to gather the sources in the subdirs into a
>> variable that the parent cmake-file knows and pre-sets to empty. And
>> then also set the compile flags by using set_source_files_properties().
> 
> Yup, that's the other way I already tried. But that way had two
> problems:
> 
> - In Visual Studio all files were shown as if they would belong to
>   the same directory, the directory structure I have in the file
>   system is not represented in VS. Is there a way to manually define
>   how the file structure should be shown in IDEs?
Search http://www.cmake.org/Wiki/CMake_2.6.0_Docs for 'source_group'

> - The whole project contains about 1000 files and MinGW fails on
>   linking. I still have to find out the exact error, but I was
>   suspecting that it might be because of the maximum length of the
>   parameters.
> 
Use cmake 2.6


HTH
Christian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080724/7a932d69/attachment.pgp>


More information about the CMake mailing list