[CMake] include_directories per target

Olivier Delannoy olivier.delannoy at gmail.com
Wed May 13 09:30:45 EDT 2009


I have probably wrongly explained my issue. I have my source code
located in several folders based on the component / library they are
part of. But I don't want to have recursive make so I don't want to
have my project relying on add_subdirectory(). Thus all my target are
located in the main directory and refers to file located in different
folders relative to the current hierarchy. I don't think there is
anything wrong with that and I know how to do it. However, I would
like to be able to ensure that only the library/component that use a
library have access to the header file of that library.



On Wed, May 13, 2009 at 2:03 PM, John Drescher <drescherjm at gmail.com> wrote:
> On Wed, May 13, 2009 at 8:50 AM,  <David.Karr at l-3com.com> wrote:
>> Olivier Delannoy <olivier.delannoy at gmail.com> wrote:
>>> I would like to set include_directories on a per target basis. I
>>> understand that the INCLUDE_DIRECTORIES property is currently on a per
>>> folder basis. It is a bit of a problem as I would like to flatten my
>>> build and have all my targets generated in a single destination
>>> folder. Is there any way to achieve this currently?
>>
>> The "per folder" basis refers to the source directories or folders.  You
>> don't need to flatten the entire source of your project in order to put
>> the built libraries and executables in one directory.  Instead, direct
>> the output of each target to the common directory.
>
>  That would be my suggestion as I have spent a lot of time taking flat
> src structures and making folders so I can organize my code..
>
> John
> _______________________________________________
> 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
>



-- 
Olivier Delannoy
Website: http://olivier.delannoy.dalfy.org/


More information about the CMake mailing list