[Cmake] Ad: Strange behavior of FIND_PROGRAM

David Svoboda xsvobod2 at informatics.muni.cz
Tue, 2 Mar 2004 14:59:39 +0100


To explain the problem better:

If you set some cache variable, say MY_PROGRAM to the value
C:\bin\beep.exe, by hand in GUI and then you use SET(MY_PROGRAM "NOTFOUND"
CACHE FILEPATH "" FORCE), be sure, that this value is stored in
CMakeCache.txt and somewhere else!!?

Now, if you run CMake command

FIND_PROGRAM(MY_PROGRAM	NAMES myprog)

without advising any paths, the Windows CMake finds the previous value,
i.e C:\bin\beep.exe. You can set some paths in FIND_PROGRAM command, but
it does not matter - CMake does not take care about it - the previous
value, that is stored somewhere in the memory, is prime.


The only solution I found is to exit CMake (memory is flushed) and run it
again :-(


- David