diff options
author | Gerald Combs <gerald@zing.org> | 2015-01-18 13:27:13 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-01-20 16:12:20 +0000 |
commit | 6e6a1291d0b36fe97d0f684e1abdfe546aaeae7f (patch) | |
tree | e441c514c057d4cadd74ae21ec6cc321b63ef285 /CMakeLists.txt | |
parent | af3924a333aa8fc614ad45163751a614a9b9fc3d (diff) |
CMake: Set an output directory for plugins.
Redefine PLUGIN_DIR similar to DATAFILE_DIR and use it on all
platforms. Add WiresharkPlugin.cmake so that we can start defining common
macros for plugins/*/CMakeLists.txt. Load plugins in out-of-tree builds.
Change-Id: I8c1359ed3cf8a71788b8320ff89dfe2d3969def2
Reviewed-on: https://code.wireshark.org/review/6640
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 89 |
1 files changed, 51 insertions, 38 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a77d243321..73040b4013 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -812,44 +812,6 @@ ADD_CUSTOM_COMMAND( ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl ) -if(ENABLE_PLUGINS) - set(HAVE_PLUGINS 1) - if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) - set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}") - else() - set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}") - endif() - set(PLUGIN_SRC_DIRS - plugins/docsis - plugins/ethercat - plugins/gryphon - plugins/irda - plugins/m2m - plugins/mate - plugins/opcua - plugins/profinet - plugins/stats_tree - plugins/unistim - plugins/wimax - plugins/wimaxasncp - plugins/wimaxmacphy - ${CUSTOM_PLUGIN_SRC_DIR} - ) -# It seems this stuff doesn't build with autofoo either... -# if(YAPP_FOUND) -# set(PLUGIN_SRC_DIRS -# ${PLUGIN_SRC_DIRS} -# plugins/tpg -# ) -# endif() -else() - set(PLUGIN_SRC_DIRS ) -endif() - -foreach(PLUGIN_DIR ${PLUGIN_SRC_DIRS}) - add_subdirectory( ${PLUGIN_DIR} ) -endforeach() - add_subdirectory( asn1 EXCLUDE_FROM_ALL ) add_subdirectory( capchild ) add_subdirectory( caputils ) @@ -894,6 +856,57 @@ if(ENABLE_EXTCAP) set(EXTCAP_DIR "${DATAFILE_DIR}/extcap/") endif() +# Location of our plugins. PLUGIN_DIRECTORY should allow running +# from the build directory similar to DATAFILE_DIR above. +if(ENABLE_PLUGINS) + set(HAVE_PLUGINS 1) + if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) + set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}") + else() + set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}") + endif() + set(PLUGIN_SRC_DIRS + plugins/docsis + plugins/ethercat + plugins/gryphon + plugins/irda + plugins/m2m + plugins/mate + plugins/opcua + plugins/profinet + plugins/stats_tree + plugins/unistim + plugins/wimax + plugins/wimaxasncp + plugins/wimaxmacphy + ${CUSTOM_PLUGIN_SRC_DIR} + ) +# It seems this stuff doesn't build with autofoo either... +# if(YAPP_FOUND) +# set(PLUGIN_SRC_DIRS +# ${PLUGIN_SRC_DIRS} +# plugins/tpg +# ) +# endif() +else() + set(PLUGIN_SRC_DIRS ) +endif() + +if(ENABLE_APPLICATION_BUNDLE) + set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark") +else() + get_target_property(_libwireshark_location epan LOCATION) + get_filename_component(_plugin_dir "${_libwireshark_location}" PATH) + set(_plugin_dir "${_plugin_dir}/plugins") +endif() +# XXX The NMake environment appends the version. Should we do so here? +set (PLUGIN_DIR ${_plugin_dir} CACHE INTERNAL "Build time plugin location.") + +foreach(_plugin_src_dir ${PLUGIN_SRC_DIRS}) + add_subdirectory( ${_plugin_src_dir} ) +endforeach() + + # Basedir where to install guides set(DOC_DIR "$ENV{docdir}" CACHE FILEPATH "Installation directory for ug and dg pdfs.") message(STATUS "docdir: ${DOC_DIR}") |