[CMake] nonstandard C++ source filename extension

Brad King brad.king at kitware.com
Wed Mar 25 11:08:57 EDT 2015


On Tue, Mar 17, 2015 at 12:10 AM, Dave Yost wrote:
> set_source_files_properties(foo.bar  PROPERTIES  LANGUAGE  CXX)
[snip]
> [100%] Building CXX object CMakeFiles/foo.dir/foo.bar.o
> c++: warning: /Users/yost/p/c++/cmake/asm/foo.bar: linker input file unused
> because linking not done
> Linking CXX executable foo
> c++: error: CMakeFiles/foo.dir/foo.bar.o: No such file or directory

The LANGUAGE property just tells CMake what the language is in
case CMake does not know an extension supported by a particular
compiler.  It does not cause the "-x c++" or similar flag to be added:

 http://www.cmake.org/Bug/view.php?id=14516

The latter is needed to convince the compiler of the language.

-Brad


More information about the CMake mailing list