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?
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.
Related
I was going through this old post Compile ImageMagick from source with PNG support on OSX.
I did mostly all of what it says with minor changes. Libpng and Zlib are in the following paths
/usr/local/libpng
/usr/local/zlib
When trying to configure ImageMagick 7.0.5-7 I do it like
./configure --prefix=/usr/local/imagemagick
CPPFLAGS='-I/usr/local/libpng/include -I/usr/local/zlib/include'
LDFLAGS='-L/usr/local/libpng/lib -L/usr/local/zlib/lib'
--enable-shared --enable-delegate-build
But still png and zlib are marked as
ZLIB --with-zlib=yes no
PNG --with-png=yes no
In some other website I read that I should add to the system variable PKG_CONFIG_PATH the path to the .pc files. So before running configure I tried also
export PKG_CONFIG_PATH=/usr/local/libpng/lib/pkgconfig:/usr/local/zlib/share/pkgconfig/
but still the libraries are not recognized.
Anyone around that knows how to tell the configure script where to look for the libraries?
I got it working !
After exploring the configure file I figured out that what was missing was pkg-config tool.
I just download it from this site installed it.
Run the command above and it works fine now.
How should ./configure args look like in order to make install to build graphicsmagick with support of JPG conversion?
This is what I've been doing so far (which not working out):
./configure LDFLAGS="-L/Users/my_user/Downloads/libpng-1.6.10" LIBS="-libpng"
You need to install all the external libraries that you want to support before running the configure command.
At the moment, you've got only PNG support. If you want to support JPEGs, you need to install libjpeg. There are different ways to do so depending on your operating system (Mac or Linux?), or you can grab the sources and compile it yourself with the same commands (./configure, make, sudo make install).
Of course, if you want to support JPEG 2000, TIFF, etc you need to install the corresponding libraries too. See README.txt for more info and link on what libraries are needed to read what format.
I don't think you need to pass the LIBS="-libpng" to configure, GraphicsMagick should add it by default as long as it's being built with PNG support. You still need the LDFLAGS though as libpng is not "installed" and in a standard path. GraphicsMagick looks into /usr/local/lib by default so if you install the library it should be picked up without you having to do anything.
You can have a look at the text files at the root of GraphicsMagick's archive, there is a README.TXT and INSTALL-unix.txt, they might prove handy.
I want to build vlc for iOS.
My environment is MacOS 10.8.3, Xcode4.6.2 with iOS6.1 SDK.
I cloned the vlc lib form https://github.com/videolan/vlc.git, cd into the /extras/package/ios, and run the build.sh in terminal, everything goes okay except when I start making the chromaprint, I got this error:
FFTW3 lib not found. Set FFTW3_DIR to find it.
CMake Error at CMakeLists.txt:114 (message):
Neither FFmpeg with avfft.h nor FFTW3 found
This is because chromaprint needs the fft library, it will find FFMPEG and also FFTW3.
I want to use the FFMPEG for an fft calculation, so I have download a copy of ffmpeg source code and complied it,the libs and headers are in the directories: /Users/king/ffmpeg/complied/include and /Users/king/ffmpeg/complied/lib,
then I set the FFMPEG_ROOT as /Users/king/ffmpeg/complied in the cmake/modules/FindFFmpeg.cmake, just before the FIND_PATH() function.
something like : set(${FFMPEG_ROOT} /Users/king/ffmpeg/complied)
,I hope the FIND_PATH() can find the releated libs and headers, this doesn't work.
So my question is, How do i set the FFMPEG path or FFTW3_DIR for chromaprint?
Thanks in advance, I am really run out of my head!
I have same problem on VLC Windows cross build.
After I upgrade cmake to 3.22.0, this problem is fixed.
I download latest cmake source code and build.
I also download fftw3 package and extracted under /home/[username]/fftw3.
Set FFTW3_DIR to ~/fftw3 by
export FFTW3_DIR=/home/[username]/fftw3
I am working on a harr detecttion project. I want to generate the exe files using the .cpp files that come with Opencv. I am using CMake for it. When I try to do that I am getting an error like this. Don`t know how to solve it.
CMake Error at CMakeLists.txt:7 (ocv_check_dependencies):
Unknown CMake command "ocv_check_dependencies".
Configuring incomplete, errors occurred!
Source link: C:/opencv/apps/haartraining
Destination link: D:/build
Please help me.
I was working on some image processing that involves Haar detection. And i was having a hard time trying to configure with Cmake at first but i finally found manual configuration tutorial with out using Cmake or else. It has helped me a lot and you can get it here. I hope it will work perfect as it worked for me too. Click here -> http://www.anlak.com/using-opencv-2-3-1-with-visual-studio-2010-tutorial/. The tutorial uses open CV 2.3.1 but it will work perfect for recent versions too with the need for Cmake ore else.If you more questions, hit me up and i will explain.Good luck!
It looks like You need to compile the whole library with build examples option enabled (if You are using windows then I bet You use graphic cmake interface, so it shouldn't be a problem), and then You will find the .exe in bin directory,
or You would need to include OpenCVModule.cmake file found in cmake catalogue to CMake file You are trying to use for the build.
I didn't test the second option myself, but it looks like CMake file You are trying to use does not load all macros needed for it to run, but macros are loaded when the root library CMake file is used.
I am compiling a dependency for a project on Ubuntu 10.10, and instead of having it install to /usr/local by default, I am instead installing it to /tmp/stage/usr/local. How do I go about informing CMake of the location of this custom installed dependency when I call it to generate the build files for said project.
I am running CMake 2.8.1, and I have tried to set CMAKE_PREFIX_PATH on the cmake command line, like so
cmake -D CMAKE_PREFIX_PATH=/tmp/stage/usr/local
but this doesn't seem to make a difference - the project doesn't seem to detect the dependency.
Also, if it matters, the project in question is OpenCV 2.2, and the dependency in question is FFMPEG...
I figured out how to fix my problem, and trying to point CMake at the appropriate install location isn't the issue.
Apparently, CMake is unable to find the pkg-config files for FFMPEG (i.e. libavcodec.pc, libavdevice.pc, etc.) that tell it where the FFMPEG headers and libraries are located. In a typical install scenario, these files would be located at /usr/lib/pkgconfig. However because of the custom install location, they are instead located at /tmp/stage/usr/local/lib/pkgconfig.
So that CMake could find these files, I had to add the following environment variable:
export PKG_CONFIG_PATH=/tmp/stage/usr/local/lib/pkgconfig
After which point, OpenCV built against FFMPEG as expected.