[CMake] Re: compiling foo.c as a c++ file for visual studio projects

Brandon Van Every bvanevery at gmail.com
Fri Jun 15 16:22:38 EDT 2007


On 6/15/07, Jon W <knowdat at gmail.com> wrote:
> >
> > Was the COMPILE_LANGUAGE property ever incorporated into cmake?
> >   http://www.mail-archive.com/cmake@cmake.org/msg01326.html

It got called the LANGUAGE property, as per Bill's e-mail 5 days ago.

hoffman at Discworld ~/My Builds/CMake/Tests
$ less SetLang/CMakeLists.txt
# test forcing a source file language to c++ from c
project(SetLang)
# force this to be verbose so I can debug a dashboard entry
SET(CMAKE_VERBOSE_MAKEFILE 1)
add_library(foo foo.c)
add_executable(SetLang bar.c)
set_source_files_properties(foo.c bar.c PROPERTIES LANGUAGE CXX)
target_link_libraries(SetLang foo)
set_target_properties(SetLang PROPERTIES LINKER_LANGUAGE CXX)

> add_library( foo STATIC ${foo_srcs} )
> set_target_properties ( foo PROPERTIES LINKER_LANGUAGE CXX )
> ------------------------------------------------
>
> Note that the order of the add_library and set_target_properties is
> critical, otherwise you will get an error.


Cheers,
Brandon Van Every


More information about the CMake mailing list