aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-12-04 11:12:45 -0800
committerMichael Mann <mmann78@netscape.net>2015-12-18 17:05:12 +0000
commit6dfcbedde9b8d9394900afe016fcde08a32de4ca (patch)
tree38f1cf11883fce4493dc6bfad27cdc1a64cf28c0 /CMakeLists.txt
parent05c47d755a82891fd73b2dfad7e128cd3c966ded (diff)
CMake: Make "install ... DESTINATION" paths relative.
Make sure we use relative destination paths in each install command. Apparently many CPack generators don't support absolute paths, particularly on Windows. This fixes the following error when running `cpack -G WIX` here: ---- CPack: Create package using WIX CPack: Install projects CPack: - Install project: Wireshark CMake Error at C:/Development/wireshark/cmbuild/cmake_install.cmake:206 (message): ABSOLUTE path INSTALL DESTINATION forbidden (by caller): C:/Program Files/Wireshark/lib/wireshark/extcap/androiddump.exe CPack Error: Error when generating package: wireshark ---- Change-Id: Ifdcd40814df8163ea722a65ef55acc1a511b2f75 Reviewed-on: https://code.wireshark.org/review/12657 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
1 files changed, 20 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cd4ab8ff86..42216774db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -757,7 +757,9 @@ if(ENABLE_ZLIB)
if (WIN32)
# On Windows we build our own version of zlib, so add the paths
set(ZLIB_SRC_DIR "${_PROJECT_LIB_DIR}/zlib-1.2.8-ws")
+ set(SKIP_INSTALL_ALL True) # We copy the DLL ourselves.
add_subdirectory("${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib")
+ unset(SKIP_INSTALL_ALL)
set(ZLIB_INCLUDE_DIR "${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib")
set(ZLIB_LIBRARY zlib)
set(ZLIB_DLL "zlib1.dll")
@@ -1040,15 +1042,17 @@ endif()
set(DATAFILE_DIR ${_datafile_dir} CACHE INTERNAL "Build time data file location.")
-if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
- set(ABSOLUTE_CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
-else()
- set(ABSOLUTE_CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
-endif()
-
if(ENABLE_EXTCAP)
+ # Target platform locations
+ # UNIX, Linux, non-bundled OS X: $DESTDIR/lib/wireshark/extcap
+ # Windows: $DESTDIR/extcap
+ # OS X app bundle: Wireshark.app/Contents/Resources/share/wireshark/extcap
set(HAVE_EXTCAP 1)
- set(EXTCAP_DIR "${ABSOLUTE_CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap/")
+ if (WIN32)
+ set(EXTCAP_DIR "extcap")
+ else ()
+ set(EXTCAP_DIR "${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap")
+ endif()
endif()
if(LIBSSH_FOUND)
@@ -1062,10 +1066,18 @@ endif()
# Location of our plugins. PLUGIN_DIRECTORY should allow running
# from the build directory similar to DATAFILE_DIR above.
if(ENABLE_PLUGINS)
+ # Target platform locations
+ # UNIX, Linux, non-bundled OS X: $DESTDIR/lib/wireshark/plugins/$VERSION
+ # Windows: $DESTDIR/wireshark/plubins/$VERSION
+ # OS X app bundle: Wireshark.app/Contents/PlugIns/wireshark
set(HAVE_PLUGINS 1)
add_custom_target(plugins)
set_target_properties(plugins PROPERTIES FOLDER "Plugins")
- set(PLUGIN_INSTALL_DIR "${ABSOLUTE_CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}")
+ if (WIN32)
+ set(PLUGIN_INSTALL_DIR "plugins/${CPACK_PACKAGE_VERSION}")
+ else ()
+ set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}")
+ endif()
set(PLUGIN_SRC_DIRS
plugins/docsis
plugins/ethercat