[CMake] disable global package caching mechanims?

Michael Wild themiwi at gmail.com
Thu Oct 6 00:52:01 EDT 2011


On Wed 05 Oct 2011 05:48:12 PM CEST, Thomas Wolf wrote:
>>
>> CMake only caches this kind of information in the CMakeCache.txt file
>> in the build tree. You might want to take a look at the -C option of
>> CMake. Alternatively, you can also try to play around with the
>> CMAKE_SYSTEM_PREFIX and CMAKE_SYSTEM_*_PATH variables as documented the
>> man-page.
>>
>> Michael
>
> Hi,
>
> So, what about step 5 in the findpackage docs..
> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package
>
> --->
> 5. Search project build trees recently configured in a CMake GUI. This
> can be skipped if NO_CMAKE_BUILDS_PATH is passed. It is intended for
> the case when a user is building multiple dependent projects one after
> another.
> <---
>
> Can i disable this alltogether? On some of my subprojects that do a
> find_package i have no incluence. And given the fact that some of the
> provided find_package scripts are suboptimal, i really don't want to
> find any stuff lying around.
>
> Again: Can this be disabled?
>
> (like passing DNO_CMAKE_BUILDS_PATH to cmake?)
>
> Reason: if I configured something wrong, like ${package}_DIR or the
> HINT, I want the build to fail, and not to silently continue with some
> other binaries.
>
> There are several builds running, doing similar stuff. It can happen
> that one build creates a library, that by accident may be found in
> another build task.
>
> Regards,
> Thomas
>

Ahh, now I understand. Sorry for that. No, I don't think you can do 
that (might be worthwhile to file a bug report on this). There are two 
ways:

- After each build, remove the caches. On *NIX machines I think this 
would be ~/.cmake/packages and ~/.config/Kitware/CMakeSetup.conf. On 
Windows that stuff is stored in the registry: 
HKEY_CURRENT_USER\Software\Kitware\CMake\Packages, 
HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages and 
HKEY_CURRENT_USER\Software\Kitware\CMakeSetup\Settings\StartPath;WhereBuild.

- After each build (re)move the build tree.

Michael


More information about the CMake mailing list