summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2017-04-24 23:20:39 +0200
committerPeter Wu <peter@lekensteyn.nl>2017-04-25 15:15:33 +0000
commit451731f0c6d3991008df9f173782fc26f28629ba (patch)
tree865d4bacd74adb5146c0b6017f328394e43a38e8 /CMakeLists.txt
parentbfd1461ec81311f31e9fc0f3f298ae779911c7f4 (diff)
downloadwireshark-451731f0c6d3991008df9f173782fc26f28629ba.tar.gz
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>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a59883ad0a..586e6e12af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)