Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear CMake's internal cache

I am sure there is a simple command for this.

I had installed opencv 2.4.3 manually in /usr/local.

Then I removed it and installed OpenCV 2.4.5 from the arch community(I am using Arch linux) which gets installed in /usr

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

I did some digging around and found that if 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 do I clear the cmake cache?I am talking about cmake's internal cache not the application's cache which can be deleted by removing CMakeCache.txt. Is there a command? Or where is the cmake cache directory/file located? I am sure there's a simple answer for this. I know how to set/unset a CACHE variable, but don't know how to clear the complete cache.

like image 460
Richard Macwan Avatar asked Nov 13 '22 02:11

Richard Macwan


1 Answers

The problem was with pkg-config settings. I hadn't removed the old .pc file and adjusted the PKG_CONFIG_PATH. pkg-config was using the opencv.pc file present in /usr/local/lib/pkgconfig rather than the one present in /usr/lib/pkgconfig. There isn't any cache that cmake uses internally, i think.

like image 117
Richard Macwan Avatar answered Nov 15 '22 07:11

Richard Macwan