[CMake] Visual Studio and Pure C application

Rolf Eike Beer eike at sf-mail.de
Wed Feb 27 03:50:55 EST 2013


Am 27.02.2013 00:16, schrieb Totte Karlsson:
> Hi,
> I have a simple application that is 'pure C', no C++. The problem I
> have is that the solution/project file  that CMake generates creates 
> a
> target that is not C, but C++. In other words, __cplusplus is defined
> and in some headers there are #defines ifdef(__cplusplus) and having
> that defined in a C application causes compilation errors, obviously.
>
> The cmake file is simple:

project(simple C)

> set(target threads_1)
>
> add_executable( ${target}
> main.c
> )
>
> target_link_libraries (${target}
> rr_c_api
> )
>
> Anyone have suggestion for a fix?

Eike


More information about the CMake mailing list