Clear Internal CMake Cache

I am sure there is a simple command for this.

I installed opencv 2.4.3 manually in / usr / local.

Then I uninstalled it and installed OpenCV 2.4.5 from the archive community (I use Arch linux), which installs in / usr

Now when I try to use OpenCV in a cmake project, cmake returns the old paths from / usr / local.

I stumbled a bit and found that if I remove "CACHE" from the line: get_filename_component (OpenCV_CONFIG_PATH = "$ {CMAKE_CURRENT_LIST_FILE}" PATCH CACHE) in /usr/share/opencv/OpenCVConfig.cmake I get the correct path.

This points to my question. How to clear CMake cache? I'm talking about cmake’s internal cache, not the application’s cache, which can be removed by deleting CMakeCache.txt. Have a team? Or where is the cmake cache directory / file? I am sure there is a simple answer for this. I know how to set / disable the CACHE variable, but I don't know how to clear the full cache.

+4
source share
2 answers

The problem was with pkg-config settings. I did not delete the old .pc file and configured PKG_CONFIG_PATH. pkg-config used the opencv.pc file present in / usr / local / lib / pkgconfig, not the one present in / usr / lib / pkgconfig. I think there is no cache that uses cmake internally.

+1
source

Recompiling the dependency library solved my problem.

I have a project that depends on Opencv. When I still use Xcode 7.2beta, the path to the MacOSX SDK is "/ Applications / xcode7.2beta.app /Content/Developer/Platforms/MacOSX.platform/Developer/SDKs/ MacOSX10.11.sdk ". So, cmake generated and compiled opencv libraries with MacOSX10.11.sdk in the "/Applications/xcode7.2beta.app/" section.

A few days ago, I updated my xcode to 8.0, the new path to xcode and its SDK is "/ Applications / xcode.app /Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ MacOSX10.12.sdk ". But anyway, when cmake generates my project, the link to opencv always points to the old xcode.

Later I realized that opencv was generated using the old Xcode, so I recompiled opencv with the new Xcode and my project was compiled correctly.

0
source

Source: https://habr.com/ru/post/1489454/


All Articles