cmake: fix build without libxml2

When LibXml2 is not found, the LIBXML2_LIBRARIES is set to
"LIBXML2_LIBRARIES-NOTFOUND" rather than an empty string (as other
FindXxx modules do). This results in an error because the variable is
used in target_link_libraries (via epan_LIBS).

As workaround, explicitly clear the variable to ignore the cache entry.

Change-Id: I9e164f9c175b23559ac6bc37f9aca5f41df79d1f
Reviewed-on: https://code.wireshark.org/review/21321
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Martin Kaiser 2017-04-24 23:20:39 +02:00 committed by Peter Wu
parent bfd1461ec8
commit 451731f0c6
1 changed files with 4 additions and 0 deletions

View File

@ -997,6 +997,10 @@ if(SPANDSP_FOUND)
endif()
if(LIBXML2_FOUND)
set(HAVE_LIBXML2 1)
else()
# The (official) FindLibXml2.cmake file sets this cache variable to a
# non-empty value, be sure to clear it when not found.
set(LIBXML2_LIBRARIES "")
endif()
if(EXTCAP_ANDROIDDUMP_LIBPCAP)
set(ANDROIDDUMP_USE_LIBPCAP 1)