OpenCV compliation on linux: how to feed to it spe

2019-09-16 13:59发布

问题:

I want to compile OpenCV with same zlib as I use for compilation of Boost Iostreams (not system default one). I want to compile OpenCV as static lib, having zlib compiled as static lib. Currently I use something like :

 ../$CMAKE_PATH -DCMAKE_INSTALL_PREFIX=./$OPENCV_INSTALL_SUBDIR -DBUILD_WITH_STATIC_CRT=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_PYTHON_SUPPORT=OFF -DOPENCV_EXTRA_C_FLAGS=-fPIC -DOPENCV_BUILD_3RDPARTY_LIBS=TRUE
make
make install
echo Done! 

I wonder: having some $ZLIB_HEADERS and $ZLIB_LIB_FILES_FOLDER path strings how to feed them into cmake to get OpenCV compiled with built by me zlib?

回答1:

Please try cmake-gui or ccmake. Make sure to toggle advanced mode On (press t in ccmake). You will find ZLIB_LIBRARY and ZLIB_INCLUDE_DIR.