Ask Your Question
1

Setting CFLAGS and CXXFLAGS for OpenCV 2.4.3

asked 2012-12-05 15:56:40 -0500

Will gravatar image

I have been able to, in the past, set the compiler options via the command-line like this:

CXXFLAGS="-O2 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp" CFLAGS="-O2 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp" cmake -DCMAKE_TOOLCHAIN_FILE=~/src/arm-toolchain.cmake ..

However, as of OpenCV 2.4.3 the CMake scripts seem to be actively ignoring/resetting the user specified CFLAGS. Is there a way around this I'm not seeing, or should I file a bug report?

Thanks for the help!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-02-05 04:03:18 -0500

Angeloc gravatar image

Opencv is based on CMake, so if you want to change compiler flags, you should edit the CMakeLists.txt file, setting the EXTRA_C_FLAGS property this way:

set(EXTRA_C_FLAGS "-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp")
edit flag offensive delete link more

Comments

Hello, thanks for your answer. By the way, do I need to set CXX_FLAGS like this: set(EXTRA_CXX_FLAGS "-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp")

regards

EstaWang gravatar imageEstaWang ( 2013-04-12 22:28:46 -0500 )edit
0

answered 2015-07-25 17:47:50 -0500

JVorwald gravatar image

In CMake, add two new boolean variables and leave them unchecked (off).
HAVE_CXX_WERROR_NON_VIRTUAL_DTOR HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-12-05 15:56:40 -0500

Seen: 3,816 times

Last updated: Feb 05 '13