cmake: fix wrong unset syntax #295 from f78d45c0

unset(VAR PARENT_SCOPE CACHE FORCE)

seemed to work on my version of cmake on gentoo, but does not work on
other versions.

Rewrite the function as a macro and use the syntax:

unset(VAR CACHE)

instead.
This commit is contained in:
Rafael Kitover 2018-08-04 13:13:37 -07:00
parent 5644339193
commit 3b44a29948
1 changed files with 7 additions and 7 deletions

View File

@ -65,13 +65,13 @@ function(normalize_wx_paths)
endif()
endfunction()
function(clear_wx_vars)
unset(wxWidgets_FOUND PARENT_SCOPE CACHE FORCE)
unset(wxWidgets_INCLUDE_DIRS PARENT_SCOPE CACHE FORCE)
unset(wxWidgets_LIBRARIES PARENT_SCOPE CACHE FORCE)
unset(wxWidgets_LIBRARY_DIRS PARENT_SCOPE CACHE FORCE)
unset(wxWidgets_CXX_FLAGS PARENT_SCOPE CACHE FORCE)
endfunction()
macro(clear_wx_vars)
unset(wxWidgets_FOUND CACHE)
unset(wxWidgets_INCLUDE_DIRS CACHE)
unset(wxWidgets_LIBRARIES CACHE)
unset(wxWidgets_LIBRARY_DIRS CACHE)
unset(wxWidgets_CXX_FLAGS CACHE)
endmacro()
if(CMAKE_PREFIX_PATH)
set(wxWidgets_CONFIG_OPTIONS "--prefix=${CMAKE_PREFIX_PATH}")