[CMake] Bug#553151: CMake 2.8.0 RC 4 ready for testing!

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Oct 29 15:00:32 EDT 2009


On Thu, Oct 29, 2009 at 7:51 PM, Alexander Neundorf
<a.neundorf-work at gmx.net> wrote:
> On Thursday 29 October 2009, Mathieu Malaterre wrote:
>> On Thu, Oct 29, 2009 at 7:16 PM, Alexander Neundorf
>>
>> <a.neundorf-work at gmx.net> wrote:
>> > On Thursday 29 October 2009, Mathieu Malaterre wrote:
>> > ...
>> >
>> >> Done:
>> >> http://cmake.org/Bug/view.php?id=9793
>> >>
>> >> Bug report include the test I used. Unfortunately find_package caches
>> >> results, so one need to manually remove cmakecache.txt file before
>> >> re-running this.
>> >
>> > You can also use cmake-gui to delete the respective variables (or do it
>> > manually in CMakeCache.txt), no need to start completely from scratch.
>>
>> I wanted to do that in a for loop, but could not find a way to do it
>> programmatically. This would greatly ease the writing of regression
>> testing. Or else I am missing something to clear anything that has
>> been cached by find_package.
>
> Did you try cmake -U ?
>
> From the help:
> Options
>  -C <initial-cache>          = Pre-load a script to populate the cache.
>  -D <var>:<type>=<value>     = Create a cmake cache entry.
>  -U <globbing_expr>          = Remove matching entries from CMake cache.

Of course that was easy... When you know the actual implementation you
can just remove the specific cached value:

+
+  # when you know the implementation:
+  unset(JAVA_INCLUDE_PATH CACHE)
+  unset(JAVA_INCLUDE_PATH2 CACHE)
+  unset(JAVA_AWT_INCLUDE_PATH CACHE)

At least I can run my loop now, but this will break next time internal
implementation is changed.

Thx
-- 
Mathieu


More information about the CMake mailing list