[CMake] Include path for a single file

James Bigler bigler at cs.utah.edu
Thu Nov 1 00:25:49 EDT 2007


Daniel wrote:
> James Bigler wrote:
>> I know you can add include paths for a single directory with 
>> INCLUDE_DIRECTORIES, but is it possible to set this for a single file 
>> with SET_SOURCE_FILES_PROPERTIES or by some other means?
>>
>> Thanks,
>> James
> 
> You could try:
> 
> SET_SOURCE_FILES_PROPERTIES(source_file PROPERTIES
>     COMPILE_FLAGS -I/include/path)

I was hoping for something a bit more portable, unless CMake magically 
understands -I/include/path and translates it for different compilers.

James


More information about the CMake mailing list