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

Michael Hertling mhertling at online.de
Tue Oct 12 09:34:44 EDT 2010


On 10/12/2010 03:26 PM, Jed Brown wrote:
> I realize this may look silly, but after
> 
>   list (REMOVE_ITEM CMAKE_C_SOURCE_FILE_EXTENSIONS c)
>   list (APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS c)
> 
> source files matching *.c are still compiled with the C compiler (not C++).
>  Is there a way to get *.c compiled with the C++ compiler?
> 
> (cmake-2.8.2)

You could set the source file property LANGUAGE to CXX.

Regards,

Michael


More information about the CMake mailing list