[CMake] INCLUDE_DIRECTORIES in sub-directories doesn't work?
sean.soria at gmail.com
Wed Nov 26 15:25:19 EST 2008
Sorry, I got myself confused with COMPILE_DEFINITIONS. It is
INCLUDE_DIRECTORIES that I wanted. Why is this a directory property
if it can only be set for certain directories (those that contain
targets or whose subdirectories contain targets)?
On Wed, Nov 26, 2008 at 12:20 PM, Sean Soria <sean.soria at gmail.com> wrote:
> Yes, but now you've defined a new target. Can I do it without a new
> target, as in my original example with add_executable(hello main.c
> On Wed, Nov 26, 2008 at 12:16 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>> Sean Soria wrote:
>>> Yea, the example was an example. I changed it to foo/bar.c so no more
>>> multiple main files.
>>> Why is it that source file property COMPILE_FLAGS would work but not
>>> COMPILE_DEFINITIONS? What is the point of having COMPILE_DEFINITIONS
>>> for source level if it's not obeyed?
>> COMPILE_DEFINITIONS should work on a source property. It is
>> INCLUDE_DIRECTORIES that does not. Feel free to put a feature request into
>> the bug tracker...
>> This works for me:
>> add_library(foo foo.c)
>> set_source_files_properties(foo.c PROPERTIES COMPILE_DEFINITIONS worked)
More information about the CMake