[CMake] Visual Studio and Pure C application

Totte Karlsson totte at dunescientific.com
Tue Feb 26 18:16:20 EST 2013


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:
set(target threads_1)

add_executable( ${target}
main.c
)

target_link_libraries (${target}
rr_c_api
)

Anyone have suggestion for a fix?
-totte


More information about the CMake mailing list