[cmake-developers] C++11 only for a specified subdirectory

Attila Krasznahorkay attila.krasznahorkay at gmail.com
Tue Mar 8 10:24:07 EST 2016


Hi Roman,

If you only set

set( CMAKE_CXX_STANDARD 11 )

in that subdirectory, then this should happen automatically. (Since the variable will not be visible as soon as you go out of the scope of this "subdirectory".)

Otherwise you could just set the CXX_STANDARD property on the targets that should be built in C++11 mode.

https://cmake.org/cmake/help/v3.1/prop_tgt/CXX_STANDARD.html

Cheers,
            Attila

> On 04 Mar 2016, at 14:20, Roman Wüger <roman.wueger at gmx.at> wrote:
> 
> Hi,
> 
> is it possible to activate C++11 only for a subdirectory?
> 
> Regards
> Roman
> -- 
> 
> 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-developers



More information about the cmake-developers mailing list