On Tue, Mar 31, 2009 at 5:53 PM, Alexandre Feblot
<[email protected]> wrote:
> Well, I indeed found this to work, but my project has about 20000 c files.
Nice ! It this project called GNU/Linux ? ;)
> Alin, forcing CC to a C++ compiler is not an option either, as I also have a
> couple of libs which must be compiled with a C-ansi compiler.
>
>
> I found that I could get the correct behaviour by modifying the value of
> CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS in the generated files
> <build_dir>/CMakeFiles/Cmake{CC,CXX}Compiler.cmake
This is bad habit to manually trick internal cmake cache variable...
> BUT:
> These files are read when calling 'project()'. They set the initial value for
> CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS, which then seem to be used once for all
> by cmake. Any later attempt to change them has no effect.
>
> So, should these CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS variables be
> considerered as read-only?
> Is this a bug?
No, it's a feature.
Simply pass the output of file(glob_recurse ... ) to
SET_SOURCE_FILES_PROPERTIES( file1.c file2.c file3.c PROPERTIES
LANGUAGE CXX ). Or do it recursively if there is some limit to the
number of filename you can specify...
$ cmake --help-command FILE
2cts
--
Mathieu
_______________________________________________
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