On Wed, Mar 17, 2010 at 11:36 AM, Bill Hoffman <[email protected]> wrote: > Michael Wild wrote: > >> Yes, that would be the problem. CMake assumes that .c is a C file, not >> C++. >> >> To override this: >> >> set(SRCS src1.c src2.c src3.c) >> add_executable(super ${SRCS}) >> set_source_files_properties(${SRCS} PROPERTIES >> LANGUAGE CXX) >> >> To set this globally, you can override the CMAKE_C_SOURCE_FILE_EXTENSIONS >> and CMAKE_CXX_SOURCE_FILE_EXTENSIONS variables, e.g. >> >> # never compile C (unless explicitly specified with the LANGUAGE property) >> set(CMAKE_C_SOURCE_FILE_EXTENSIONS) >> # consider .c files to be C++ >> list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS c)
Awesome, set_source_files_properties did the trick. Thanks all! David _______________________________________________ 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
