[CMake] Compile C files with C++

Pau Garcia i Quiles pgquiles at elpauer.org
Thu Dec 5 10:33:26 EST 2013


Hello,

Try with add_executable / add_library before setting the source files
properties.


On Thu, Dec 5, 2013 at 3:16 PM, Tom Browder <tom.browder at gmail.com> wrote:

> I found this 2009 thread:
>
>   http://marc.info/?l=cmake&m=123851619629929&w=2
>
> discussing this issue and I tried all suggestions but still cannot get
> C files compiled with C++.
>
> The last suggestion was to glob all C source files and set a LANGUAGE
> CXX property on each.  I put this at the very top of my master
> CMakeLists.txt file:
>
>   file(GLOB_RECURSE all_c_files ${CMAKE_SOURCE_DIR}/src/*.c)
>   set_source_files_properties(${all_c_files} PROPERTIES LANGUAGE CXX)
>
> to no avail (I also tried putting double quotes around the glob
> expression).
>
> Ideas?
>
> Best regards,
>
> -Tom
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131205/4c9691b8/attachment.htm>


More information about the CMake mailing list