Hi,

 

In my project, all sources named .c are C++ files, and should be
considered as CXX language files.

 

I tried to set this with CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS, at the
very beginning of my project, without success. How should I do it?

 

cmake_minimum_required (VERSION 2.6) 

project(MY_PROJECT)

# Can't changes the following values before calling project(), which
reset them to default values.

list(REMOVE_ITEM CMAKE_C_SOURCE_FILE_EXTENSIONS c)

list(APPEND    CMAKE_CXX_SOURCE_FILE_EXTENSIONS c)

#  value: CMAKE_C_SOURCE_FILE_EXTENSIONS: 

#  value: CMAKE_CXX_SOURCE_FILE_EXTENSIONS: C;M;c++;cc;cpp;cxx;m;mm;c

 

But later on, my .c files are still considered as C files, as shown
with:

 

get_source_file_property(lang source_file.c LANGUAGE)

#value: lang: C

 

 

 

Thanks

 

Alexandre



This email was sent to you by Thomson Reuters, the global news and information 
company.
Any views expressed in this message are those of the individual sender, except 
where the sender specifically states them to be the views of Thomson Reuters.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to