"Embedded builds not allowed" in cmake

I am new to cmake and I only use it to install opencv on my ubuntu linux. Here is the command I ran:

"cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/jinha/OCV/source" 

Then it returns an error:

 "FATAL: In-source builds are not allowed. You should create separate directory for build files." 

My current directory, / home / jinha / OCV / build / opencv, contains the CMakefiles.txt file, so no problem. I tried changing the directory on my team, but they all raise the same error. I saw other answers on this issue, so every time I ran the command, I deleted the CMakeFiles folder and the CMakeCache.txt file, but none of them worked. Thanks.

+7
linux opencv cmake
source share
1 answer

He wants you to create a separate build directory (anywhere) and run cmake. For example:

 mkdir my_build_dir cd my_build_dir cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/jinha/OCV/source 

Pay attention to .. in this example telling cmake where to look for the source.

If you have not deleted CMakeCache.txt before the build again, it will still show this error. Therefore, before running cmake , be sure to delete CMakeCache.txt .

+22
source share

All Articles