Unable to set CFLAGS or CXXFLAGS in OpenCV 2.4.3. (Bug #2639)
Description
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. From what I recall, CMAKE_C_FLAGS and CMAKE_CXX_FLAGS have seemingly always been ignored. It seems like the OPENCV_EXTRA_*FLAGS always override whatever I specify either with CFLAGS/CXXFLAGS environment variables or CMAKE_C_FLAGS/CMAKE_CXX_FLAGS CMake variables. If support could be added back for one or both of these variables, that would be great!
Associated revisions
Merge pull request #2639 from kazuki-ma:cv_mat_foreach
History
Updated by Will Lucas about 12 years ago
Forgot to add this was on Ubuntu 12.04 using the released OpenCV 2.4.3 sources.
Updated by Andrey Kamaev about 12 years ago
Sorry, but it is not an OpenCV bug.
It is a problem of toolchain file arm-toolchain.cmake used for crosscompiling. CFLAGS/CXXFLAGS as well as CMAKE_C_FLAGS/CMAKE_CXX_FLAGS work when configuring without a toolchain.
- Target version set to 2.4.4
- Status changed from Open to Cancelled