Hello,

I'm writing a C++11 project. To enable C++11 it requires some switches,
such as -std=c++11.

So for the moment, I have in my CMakeLists.txt:

set(CMAKE_CXX_FLAGS "-std=c++11")

So with that, I'm sure that any build configuration will add this.
However, with clang++, you need to pass an additional flag (for FreeBSD
especially): -stdlib=libc++.

So I would like to be able to do at command line:

cmake .. -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++"

But with that, it just ignore my setting and take the one from the
CMakeLists.txt

What is the correct way to:

* Set CXX flags globally, for any type of configuration
* Let them be overriden?

Regards,

David.
--

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

Reply via email to