我在创建的子目录中使用以下命令在Raspbian上编译了OpenCV库(版本4):
cmake -D CMAKE_INSTALL_PREFIX=./ -D CMAKE_BUILD_TYPE=Debug ../
make -j4
make install
我正在使用pkg-config文件opencv.pc
用Makefile
编译项目。
我必须将库文件夹移动到另一个目录,以便文件opencv.pc
指向错误的路径。但是动态库应该仍然有效(不是吗?)。
那么如何在不重新编译Raspbian上的所有库的情况下重新生成opencv.pc
文件呢?
编辑1
尝试重新运行cmake -D CMAKE_INSTALL_PREFIX=./ -D CMAKE_BUILD_TYPE=Debug ../
会导致以下错误:
CMake Error: The current CMakeCache.txt directory /home/pi/opencv-2.4.13/build/CMakeCache.txt is different than the directory /home/pi/OldDirectory/opencv-2.4.13/build/ where CmakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure reedit CMakeCache.txt
CMake Error The source "NewSourcePath" does not match the source "NewSourcePath" used to generate cache. Re-run cmake with a different source directory.