[CMake] Compile project as C++ if MSVC

J Decker d3ck0r at gmail.com
Fri Dec 23 17:09:09 EST 2011


2011/12/23 Mateusz Łoskot <mateusz at loskot.net>:
> On 23 December 2011 15:07, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>> Back to the original question, just to be clear.
>>
>> The right way to do this is with the set_source_files_properties command:
>>
>> set_source_files_properties(<SRC> PROPERTIES LANGUAGE CXX)

This works well; when I implemented it I ended up wanting to compile
as C and C++ the same code, so I used cmake copy_if_different
functionality to copy all the .c files and directory structure to the
build directory, and rename to .cpp during the copy

>
> Thanks Bill.
>
> It is always good to learn new things about favourite build toolset :)
>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
> --
>
> 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


More information about the CMake mailing list