[CMake] *.c compiled with C compiler after clearing CMAKE_C_SOURCE_FILE_EXTENSIONS

Alexander Neundorf a.neundorf-work at gmx.net
Wed Oct 13 16:21:30 EDT 2010


On Tuesday 12 October 2010, Jed Brown wrote:
> On Tue, Oct 12, 2010 at 15:33, Michael Wild <themiwi at gmail.com> wrote:
> > set(SRCS src1.c src2.c src3.c)
> > set_source_files_properties(${SRCS} PROPERTIES LANGUAGE CXX)
> > add_executable(strange_beast ${SRCS})
>
> I can do that, but what's the point of the extension-based mapping if you
> have to set properties by file?  Is the observed behavior a functional bug
> (should have worked) or a documentation bug?

CMAKE_<language>_SOURCE_FILE_EXTENSIONS is used quite early in the 
enable-language process, i.e. when the 
CMakeFiles/CMake<language>Compiler.cmake file is generated.
If the variable is changed after that happened, it doesn't have an effect 
anymore.

Alex


More information about the CMake mailing list