summaryrefslogtreecommitdiffstats
path: root/Modules/FindwxWidgets.cmake
diff options
context:
space:
mode:
authorAndrea Ranieri <ranieri@ge.issia.cnr.it>2018-04-10 13:34:52 (GMT)
committerBrad King <brad.king@kitware.com>2018-04-11 14:41:10 (GMT)
commit9174786008c12a2eaf6180d536f9be4c13d94cb8 (patch)
treece37c909b6e767c0eafb356d22da3e5abcfd5b22 /Modules/FindwxWidgets.cmake
parentaad0967e7d367ed3d51a396397a4bcf332c34753 (diff)
downloadCMake-9174786008c12a2eaf6180d536f9be4c13d94cb8.zip
CMake-9174786008c12a2eaf6180d536f9be4c13d94cb8.tar.gz
CMake-9174786008c12a2eaf6180d536f9be4c13d94cb8.tar.bz2
FindwxWidgets: Use more private name for local variable
Avoid using a `_filename` variable that may be set by project code. Also unset the variable name that we do use to avoid conflict.
Diffstat (limited to 'Modules/FindwxWidgets.cmake')
-rw-r--r--Modules/FindwxWidgets.cmake10
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index af997ea..f2d6285 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -925,14 +925,16 @@ unset(_wx_lib_missing)
# Check if a specific version was requested by find_package().
if(wxWidgets_FOUND)
- find_file(_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH)
- dbg_msg("_filename: ${_filename}")
+ unset(_wx_filename)
+ find_file(_wx_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH)
+ dbg_msg("_wx_filename: ${_wx_filename}")
- if(NOT _filename)
+ if(NOT _wx_filename)
message(FATAL_ERROR "wxWidgets wx/version.h file not found in ${wxWidgets_INCLUDE_DIRS}.")
endif()
- file(READ ${_filename} _wx_version_h)
+ file(READ "${_wx_filename}" _wx_version_h)
+ unset(_wx_filename CACHE)
string(REGEX REPLACE "^(.*\n)?#define +wxMAJOR_VERSION +([0-9]+).*"
"\\2" wxWidgets_VERSION_MAJOR "${_wx_version_h}" )