diff options
author | Gerald Combs <gerald@wireshark.org> | 2019-02-13 11:08:19 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2019-02-13 23:55:10 +0000 |
commit | aedf6fe1c5f735aa036bec9173f7fb656ce2c95b (patch) | |
tree | 6ce88f0f2b58c5f49e5bf4912d18c2e193d7bbd3 /CMakeLists.txt | |
parent | b3c5fcb67c89e0f9bcc4e38861f23d90792a0e7e (diff) |
macOS: Fix our plugin path.
In CMake we only used PROJECT_RELEASE_VERSION to construct our plugin
path, so rename it to PLUGIN_PATH_ID. Use a dash to separate version
numbers on macOS in order to allow code signing and a period elsewhere.
In the C code we only used VERSION_RELEASE to construct our plugin path,
so rename it to PLUGIN_PATH_ID.
Change-Id: I02abc591d7857269e8d47b414b61df4b28a25f2d
Reviewed-on: https://code.wireshark.org/review/32013
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index eb2b31a8cd..61bc971eac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,23 @@ set(PROJECT_MINOR_VERSION 1) set(PROJECT_PATCH_VERSION 0) set(PROJECT_BUILD_VERSION ${GIT_REVISION}) set(PROJECT_VERSION_EXTENSION "") -set(PROJECT_RELEASE_VERSION "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}") +if(ENABLE_APPLICATION_BUNDLE) + # + # As https://developer.apple.com/library/archive/technotes/tn2206/_index.html + # says, + # + # "Note that a location where code is expected to reside cannot generally + # contain directories full of nested code, because those directories tend + # to be interpreted as bundles. So this occasional practice is not + # recommended and not officially supported. If you do do this, do not use + # periods in the directory names. The code signing machinery interprets + # directories with periods in their names as code bundles and will reject + # them if they don't conform to the expected code bundle layout." + # + set(PLUGIN_PATH_ID "${PROJECT_MAJOR_VERSION}-${PROJECT_MINOR_VERSION}") +else(ENABLE_APPLICATION_BUNDLE) + set(PLUGIN_PATH_ID "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}") +endif(ENABLE_APPLICATION_BUNDLE) if(DEFINED ENV{WIRESHARK_VERSION_EXTRA}) set(PROJECT_VERSION_EXTENSION "$ENV{WIRESHARK_VERSION_EXTRA}") @@ -1328,8 +1344,8 @@ if(WIN32) else() set(PLUGIN_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/plugins" CACHE INTERNAL "The plugin dir") endif() -set(PLUGIN_INSTALL_VERSION_LIBDIR "${PLUGIN_INSTALL_LIBDIR}/${PROJECT_RELEASE_VERSION}") -set(PLUGIN_VERSION_DIR "plugins/${PROJECT_RELEASE_VERSION}") +set(PLUGIN_INSTALL_VERSION_LIBDIR "${PLUGIN_INSTALL_LIBDIR}/${PLUGIN_PATH_ID}") +set(PLUGIN_VERSION_DIR "plugins/${PLUGIN_PATH_ID}") add_subdirectory( capchild ) add_subdirectory( caputils ) @@ -1419,25 +1435,11 @@ else() endif() if(ENABLE_APPLICATION_BUNDLE) - # - # XXX - codesign barfs if we put our plugins in a dotted version - # subdirectory, e.g. PlugIns/Wireshark/3.1/epan, so we either - # need to figure out how to make it work, or need to: - # - # remove the version component from _plugin_dir; - # - # remove the version component from the pkgplugin directory in - # packaging/macosx/osx-app.sh.in; - # - # have get_plugins_dir_with_version() in wsutil/filesystem.c - # *not* add the version component to plugin_dir_with_version - # on macOS. - # if(CMAKE_CFG_INTDIR STREQUAL ".") - set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark/${PROJECT_RELEASE_VERSION}") + set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}") else() # Xcode - set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Wireshark.app/Contents/PlugIns/wireshark/${PROJECT_RELEASE_VERSION}") + set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}") endif() elseif(WIN32 AND NOT CMAKE_CFG_INTDIR STREQUAL ".") set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/${PLUGIN_VERSION_DIR}") |