Trying to get find_path
to do what I want.
find_path(temmp include/help.h)
message("temmp= ${temmp}")
help.h is found. The output is temmp= /usr/local/toolA
find_path(temmp include/foo.shoe)
message("temmp= ${temmp}")
foo.shoe does not exist (not found). The output is temmp= /usr/local/toolA
The cache variable exists, so the variable (temmp) is untouched.
I try and clear the cache var with this:
set (temmp "" CACHE INTERNAL "")
find_path(temmp include/help.h)
message("temmp= ${temmp}")
No change. The variable is cleared, but still exists. The output is temmp=
(find_path
does not run.)
How can I delete the temmp
variable from the cache? (I want to force the find_path
to run again.)
You can also disable browser caching with meta HTML tags just put html tags in the head section to avoid the web page to be cached while you are coding/testing and when you are done you can remove the meta tags. Refresh your page after pasting this in the head and should refresh the new javascript code too.
To force a variable reference of the form ${VAR} to return an empty string, use set(<variable> "") , which clears the normal variable but leaves it defined. If PARENT_SCOPE is present then the variable is removed from the scope above the current scope. See the same option in the set() command for further details.
The CMake cache may be thought of as a configuration file. The first time CMake is run on a project, it produces a CMakeCache. txt file in the top directory of the build tree. CMake uses this file to store a set of global cache variables, whose values persist across multiple runs within a project build tree.
You can use unset
:
unset(temmp CACHE)
As an aside, the find_path
calls should be more like:
find_path(temmp help.h include)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With