OpenCV3/iOS: Custom built - howto change configuration parameters

293 views Asked by At

How can I change the configuration when compiling an iOS framework using the build_framework.py script which ships with the OpenCV package? In detail, I want to disable "libpng" support and altered the cmakeargs part as follows:

cmakeargs = ("-GXcode " +
            "-DCMAKE_BUILD_TYPE=Release -DBUILD_PNG=OFF" +
            "-DCMAKE_TOOLCHAIN_FILE=%s/platforms/ios/cmake/Toolchains/Toolchain-%s_Xcode.cmake " +
            "-DCMAKE_C_FLAGS=\"-Wno-implicit-function-declaration\" " +
            "-DCMAKE_INSTALL_PREFIX=install") % (srcroot, target)

But the option -DBUILD_PNG=OFFis ignored and libpng is included. How can I change the configuration in the script?

2

There are 2 answers

0
Hyndrix On

The actual correct parameter is:

-DWITH_PNG=NO
1
usr1234567 On

You can disable the PNG configure check with -DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE

This is possible with CMake 2.8.6 and newer.