From 37790e90f52b4c08d2a5dd8c4ff0e0cab4913880 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 10 Jan 2017 14:03:55 +0100 Subject: cmake: fix empty data (Global Configuration) directory Color filters were somehow not loaded. It turns out that the BUILD_TIME_DATAFILE_DIR macro (for filesystem.c) was empty because DATAFILE_DIR was defined after adding the wsutil directory. Fix it by defining the variable before wsutil (but after epan). Change-Id: I0d002b79499c80a90d8fcc14b06ced26c30b0453 Fixes: v2.3.0rc0-1830-gd5fdbef7f4 ("cmake,wslua,wsutil: load files from run/ instead of source tree") Reviewed-on: https://code.wireshark.org/review/19600 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu --- CMakeLists.txt | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 5aaedbf7de..7038e7acbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1153,6 +1153,22 @@ add_subdirectory( tools/lemon ) add_subdirectory( ui ) add_subdirectory( wiretap ) add_subdirectory( writecap ) + +# Location of our data files. This should be set to a value that allows +# running from the build directory on Windows, on OS X when building an +# application bundle, and on UNIX if WIRESHARK_RUN_FROM_BUILD_DIRECTORY +# is set. +if(ENABLE_APPLICATION_BUNDLE) + set(_datafile_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/share/wireshark") +else() + get_target_property(_libwireshark_location epan LOCATION) + get_filename_component(_datafile_dir "${_libwireshark_location}" PATH) +endif() + +set(DATAFILE_DIR ${_datafile_dir} CACHE INTERNAL "Build time data file location.") + +# wsutil must be added after DATAFILE_DIR is set such that filesystem.c can +# learn about the directory location. add_subdirectory( wsutil ) if(NOT WIN32) @@ -1171,19 +1187,6 @@ if(BUILD_wireshark AND QT_FOUND) add_subdirectory( ui/qt ) endif() -# Location of our data files. This should be set to a value that allows -# running from the build directory on Windows, on OS X when building an -# application bundle, and on UNIX if WIRESHARK_RUN_FROM_BUILD_DIRECTORY -# is set. -if(ENABLE_APPLICATION_BUNDLE) - set(_datafile_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/share/wireshark") -else() - get_target_property(_libwireshark_location epan LOCATION) - get_filename_component(_datafile_dir "${_libwireshark_location}" PATH) -endif() - -set(DATAFILE_DIR ${_datafile_dir} CACHE INTERNAL "Build time data file location.") - if(ENABLE_EXTCAP) # Target platform locations # UNIX, Linux, non-bundled OS X: $DESTDIR/lib/wireshark/extcap -- cgit v1.2.1