[CMake] Compile C files with C++

Tom Browder tom.browder at gmail.com
Thu Dec 5 13:54:11 EST 2013


On Thu, Dec 5, 2013 at 12:38 PM, J Decker <d3ck0r at gmail.com> wrote:
> then maybe just stripping the names, and/or adding the
> CMAKE_CURRENT_SOURCE_DIR for each one as appropriate

No, I still need choice, so, e.g., I'm using these lines in each
CMakeLists.txt (modified as necessary, of course; and it works so
far):

# choose to use C++ compiler on all files
if(ENABLE_ALL_CXX_COMPILE)
  set_source_files_properties(${LIBRT_SOURCES} PROPERTIES LANGUAGE CXX)
endif()

-Tom


More information about the CMake mailing list