diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-12-18 16:49:24 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2016-12-20 13:16:57 +0000 |
commit | d5fdbef7f4f103f3cd57524bc68b9a1385c61363 (patch) | |
tree | c67acc4441769909c7195c085850750da1813e84 /wsutil/CMakeLists.txt | |
parent | bd0fa39c7b013486e680c701406c4f75daec0a5a (diff) | |
download | wireshark-d5fdbef7f4f103f3cd57524bc68b9a1385c61363.tar.gz |
cmake,wslua,wsutil: load files from run/ instead of source tree
Fixes Lua on macOS, tested with an out-of-tree build:
WS_BIN_PATH=$PWD/run ../wireshark/test/test.sh -s wslua
Previously programs that were ran from the build directory would load
data files (radius/, diameter/, init.lua) from the source directory.
Then in the case of Lua, files were loaded from the program directory
($BUILDDIR/run/init.lua on Linux) or source directory
(sSOURCEDIR/epan/wslua/console.lua).
On macOS, this does not work for Lua since files are installed into
$BUILDDIR/run/Wireshark.app/Contents/Resources/share/wireshark/init.lua
instead. Since CMake always copies data files (radius, console.lua,
etc.) into the build directory, make get_datafile_dir() return this
"run" directory instead.
Change-Id: If97d2f5686271caf9ad4d4e4fc58e902dc592a98
Reviewed-on: https://code.wireshark.org/review/19330
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'wsutil/CMakeLists.txt')
-rw-r--r-- | wsutil/CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 8b9cf011d8..84a3e1465e 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -249,7 +249,12 @@ if(NOT ${ENABLE_STATIC}) ) endif() -add_definitions( -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\" ) +# Export build-time datadir (note: the macro "DATAFILE_DIR" is defined in +# config.h and points to the install-time data directory, hence the different +# name). +set_property(SOURCE filesystem.c APPEND PROPERTY + COMPILE_DEFINITIONS BUILD_TIME_DATAFILE_DIR="${DATAFILE_DIR}" +) CHECKAPI( NAME |