Skip to content

Build instructions for opencv 4.9.0 fails - Error: "in-source builds are not allowed" #3366

Answered by helarsen
helarsen asked this question in Questions
Discussion options

You must be logged in to vote

Ok figured something out. cmake is apparently itchy about where the build/ and source/ files are relative to each other.
Here is an explicit way of defining where the source/ -S and build/ -B folders are. I did put build/ next to opencv/ folder - to ensure that cmake cannot reasonably complain about "in-source build not allowed!"

sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-ugly gstreamer1.0-rtsp python3-dev python3-numpy
git clone --depth=1 -b 4.9.0 https://github.com/opencv/opencv
mkdir build
cmake -S opencv -B build -D CMAKE_INSTALL_PREFIX=/usr -D WITH_GSTREAMER=ON
cd build
make -j$(nproc)
sudo make install

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by helarsen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant