1

I have some OpenCV/C++ application which compiles with a CMake definitions file, in which I did not find a way to pass flags to the compiler.

I know that there are the flags C_INCLUDE_PATH CPLUS_INCLUDE_PATH, and all the rest of their friends...

But, is there an environment variable for definition of any other flags, in which I'd be able to define -std=c++11 ?

1
  • Does this question solve your issue? Commented Mar 24, 2016 at 9:49

2 Answers 2

2

If you're using CMake, equally easy and nicer solution will be to pass

-DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON 

to CMake.

Sign up to request clarification or add additional context in comments.

Comments

1

The easiest but certainly not nicest solution if you want to force it by hand would be:

add_compile_options(-std=c++11) 

However CMake should be able to pick the necessary standard for you. Have a look to this answer: How to detect c++11 support of a compiler with cmake

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.