[CMake] bug or feature with SET_SOURCE_FILES_PROPERTIES?

Brad King brad.king at kitware.com
Tue Nov 22 11:55:52 EST 2005


Prakash Punnoor wrote:
> Brad King schrieb:
> 
>>Prakash Punnoor wrote:
>>
>>
>>>     SET(TEST_SRC test/test${TEST}.c)
>>>     SET_SOURCE_FILES_PROPERTIES(${TEST_SRC} PROPERTIES COMPILE_FLAGS
>>>"-Wno-unused")
>>
>>[snip]
>>
>>
>>>   SET_SOURCE_FILES_PROPERTIES(test/testcpp.cc PROPERTIES COMPILE_FLAGS
>>>"-Wno-unused")
>>
>>
>>One version has a .c and the other has a .cc suffix on the file.
> 
> 
> Sorry I don't understand the problem. Will above only work for c++
> sources and not for c sources, or what do you want to tell me?

I thought it was a typo in your code and that the wrong extension was 
being used inside the FOREACH.  It is perfectly valid to set source file 
properties for sources that are never actually included in targets 
(because the command doesn't know if the source is used in a target that 
is added after the command), so no error is given for a typo like this.

If it is not a typo please try unrolling the loop for a couple of the .c 
tests and make sure it works outside the FOREACH.

-Brad


More information about the CMake mailing list