[CMake] Mixing up project language settings?

Nicholas Braden nicholas11braden at gmail.com
Thu Mar 31 15:42:46 EDT 2016


If the new C++ components are built optionally, I would use
enable_language(CXX):
https://cmake.org/cmake/help/latest/command/enable_language.html

Otherwise, if the project will always need C++ support from now on,
amend the project() statement. In this case it doesn't matter whether
you add CXX or remove C, it is up to you aesthetically.

On Thu, Mar 31, 2016 at 2:38 PM, Fedja Jeleskovic <mrawd2 at gmail.com> wrote:
> Hi there!
>
> I am adding few components to the existing cmake driven C project, but new
> components need C++ compiler instead. Top level CMakeLists.text starts with:
> project (appName C)
>
> The question is whether I need to change to top level settings and just
> include CXX (or just remove C part since they are both defaulted anyway)
> where my new components are, or the top level needs to be changed as well to
> reflects what will be used below.
>
> Thanks!
>
> --
>
> 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://public.kitware.com/mailman/listinfo/cmake


More information about the CMake mailing list