[CMake] How to define an 'include_directories' different for each library

Will Dicharry wdicharry at stellarscience.com
Wed Nov 4 11:01:56 EST 2009


On 11/04/2009 08:39 AM, Olivier Pierard wrote:
> Hi,
>
> A quite basic question...
>
> In a given project, I build several libraries and an executable.  How
> can I get a different 'include_directories' for each library and not the
> same list for all of them (typically, I don't want to have access to the
> includes related to the last library when compiling the first one).
>    

As far as I know, the only way to do this is to encapsulate each library 
in a subdirectory and make the include_directories call from the 
CMakeLists that is local to that directory.  In that case, the call will 
not affect the sibling directories.  Will this work for you?  Perhaps 
someone else on the list that is more knowledgeable than I can offer an 
alternative solution.

-- Will

> Thank you,
>
> Olivier
>
>
> _______________________________________________
> 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
>    


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3344 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091104/fb02a452/attachment.bin>


More information about the CMake mailing list