[CMake] INCLUDE_DIRECTORIES in sub-directories doesn't work?

Sean Soria sean.soria at gmail.com
Wed Nov 26 15:20:51 EST 2008


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
foo/bar.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)
>
>
> -Bill
>
>


More information about the CMake mailing list