diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2020-04-30 16:43:50 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2020-05-01 19:44:12 +0000 |
commit | 3a32757313e85368e88fdd9dbb82f839514569f5 (patch) | |
tree | e2cb7f2e8a9767f2a54bc7f11de6b87d5b203d60 /cmake | |
parent | 6b4c158f003fe32900085ce5ec303467bcd99733 (diff) |
CMake: Fix FindGLIB2 for saner output
Apparently FindPackageHandleStandardArgs uses if(DEFINED ...) to test
VERSION_VAR, for somewhat obscure reasons. If we didn't find a suitable
GLib package we must not define GLIB2_VERSION, otherwise the status
output is confused and just generally wrong.
Change-Id: Iad4012e69a7c641c50d1e399bbfdb51583cb3b40
Reviewed-on: https://code.wireshark.org/review/36990
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindGLIB2.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cmake/modules/FindGLIB2.cmake b/cmake/modules/FindGLIB2.cmake index 46bede9ec5..1882cfe411 100644 --- a/cmake/modules/FindGLIB2.cmake +++ b/cmake/modules/FindGLIB2.cmake @@ -99,7 +99,9 @@ elseif(GLIB2_INTERNAL_INCLUDE_DIR) string(REGEX MATCH "[0-9]+" GLIB_MICRO_VERSION ${GLIB_MICRO_VERSION}) set(GLIB2_VERSION ${GLIB_MAJOR_VERSION}.${GLIB_MINOR_VERSION}.${GLIB_MICRO_VERSION}) else() - set(GLIB2_VERSION "") + # When using VERSION_VAR it must be set to a valid value or undefined to + # mean "not found". It's not enough to use the empty string or any other CMake false boolean. + unset(GLIB2_VERSION) endif() include( FindPackageHandleStandardArgs ) |