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

Sebastian Krause sebastian at realpath.org
Thu Jul 24 12:30:46 EDT 2008


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?
- 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.

Sebastian



More information about the CMake mailing list