diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2018-08-21 22:23:46 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2018-08-23 08:33:56 +0000 |
commit | f0b41190eb965ac7c9b0084806f5797dc5ef7c8f (patch) | |
tree | 4ad2bebfde95145b7a783d925fb277ea15ee0b7a | |
parent | 0c0973196fb02e340732f0c4722ed50325a7fbf9 (diff) |
CMake: Clean up and homogenize plugin dir configuration
Change-Id: If43c7b124afdf6471164675f8a0c55a76e998ea1
Reviewed-on: https://code.wireshark.org/review/29254
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
-rw-r--r-- | CMakeLists.txt | 23 | ||||
-rw-r--r-- | cmake/modules/WiresharkConfig.cmake.in | 3 | ||||
-rw-r--r-- | cmake/modules/WiresharkPlugin.cmake | 6 | ||||
-rw-r--r-- | cmakeconfig.h.in | 3 | ||||
-rw-r--r-- | extcap/CMakeLists.txt | 14 | ||||
-rw-r--r-- | wsutil/CMakeLists.txt | 5 |
6 files changed, 25 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5afb3a54b4..e620c35dd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1278,11 +1278,20 @@ include( UseCheckAPI ) # Windows: $DESTDIR/extcap # macOS app bundle: Wireshark.app/Contents/Resources/share/wireshark/extcap if (WIN32) - set(EXTCAP_DIR "extcap" CACHE INTERNAL "The extcap dir") + set(EXTCAP_INSTALL_LIBDIR "extcap" CACHE INTERNAL "The extcap dir") else () - set(EXTCAP_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap" CACHE INTERNAL "The extcap dir") + set(EXTCAP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap" CACHE INTERNAL "The extcap dir") endif() +# Directory where plugins and Lua dissectors can be found. +if(WIN32) + set(PLUGIN_INSTALL_LIBDIR "plugins" CACHE INTERNAL "The plugin dir") +else() + set(PLUGIN_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_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}") + add_subdirectory( capchild ) add_subdirectory( caputils ) add_subdirectory( codecs ) @@ -1329,16 +1338,6 @@ if(BUILD_wireshark AND QT_FOUND) add_subdirectory( ui/qt ) endif() -# Directory where plugins and Lua dissectors can be found. -set(PLUGIN_VERSION_DIR "plugins/${PROJECT_RELEASE_VERSION}") -set(PLUGIN_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/${PLUGIN_VERSION_DIR}") -# Used by the WiresharkConfig.cmake.in module -if (WIN32) - set(PLUGIN_INSTALL_DIR "${PLUGIN_VERSION_DIR}") -else () - set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_LIBDIR}") -endif() - # Location of our plugins. PLUGIN_DIR should allow running # from the build directory similar to DATAFILE_DIR above. if(ENABLE_PLUGINS) diff --git a/cmake/modules/WiresharkConfig.cmake.in b/cmake/modules/WiresharkConfig.cmake.in index c3f4edfb6d..17e8212b98 100644 --- a/cmake/modules/WiresharkConfig.cmake.in +++ b/cmake/modules/WiresharkConfig.cmake.in @@ -5,7 +5,8 @@ set(Wireshark_VERSION @PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_P set(Wireshark_VERSION_STRING "@PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_PATCH_VERSION@") set(Wireshark_INSTALL_DIR "@CMAKE_INSTALL_PREFIX@") -set(Wireshark_PLUGIN_INSTALL_DIR "@PLUGIN_INSTALL_DIR@") +set(Wireshark_PLUGIN_INSTALL_DIR "@CMAKE_INSTALL_PREFIX@/@PLUGIN_INSTALL_VERSION_LIBDIR@") +set(Wireshark_EXTCAP_INSTALL_DIR "@CMAKE_INSTALL_PREFIX@/@EXTCAP_INSTALL_LIBDIR@") set(Wireshark_LIB_DIR "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@") set(Wireshark_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/wireshark") diff --git a/cmake/modules/WiresharkPlugin.cmake b/cmake/modules/WiresharkPlugin.cmake index 38eb5d5a25..a406e4ef67 100644 --- a/cmake/modules/WiresharkPlugin.cmake +++ b/cmake/modules/WiresharkPlugin.cmake @@ -49,8 +49,8 @@ endmacro() macro(INSTALL_PLUGIN _plugin _subfolder) install(TARGETS ${_plugin} - LIBRARY DESTINATION ${PLUGIN_INSTALL_LIBDIR}/${_subfolder} NAMELINK_SKIP - RUNTIME DESTINATION ${PLUGIN_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${PLUGIN_INSTALL_LIBDIR} + LIBRARY DESTINATION ${PLUGIN_INSTALL_VERSION_LIBDIR}/${_subfolder} NAMELINK_SKIP + RUNTIME DESTINATION ${PLUGIN_INSTALL_VERSION_LIBDIR} + ARCHIVE DESTINATION ${PLUGIN_INSTALL_VERSION_LIBDIR} ) endmacro() diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 65716b69c1..4a32408945 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -26,9 +26,6 @@ /* Build wsutil with SIMD optimization */ #cmakedefine HAVE_SSE4_2 1 -/* Directory where extcap hooks reside */ -#define EXTCAP_DIR "${EXTCAP_DIR}" - /* Define to 1 if we want to enable plugins */ #cmakedefine HAVE_PLUGINS 1 diff --git a/extcap/CMakeLists.txt b/extcap/CMakeLists.txt index 0e8c95d69e..5ed2f7fcd3 100644 --- a/extcap/CMakeLists.txt +++ b/extcap/CMakeLists.txt @@ -99,7 +99,7 @@ if(BUILD_androiddump) # XXX Shouldn't we add wsutil to androiddump_LIBS instead? set_extcap_executable_properties(androiddump) target_link_libraries(androiddump ${androiddump_LIBS}) - install(TARGETS androiddump RUNTIME DESTINATION ${EXTCAP_DIR}) + install(TARGETS androiddump RUNTIME DESTINATION ${EXTCAP_INSTALL_LIBDIR}) add_dependencies(extcaps androiddump) endif() @@ -120,7 +120,7 @@ if(BUILD_sshdump AND LIBSSH_FOUND) set_extcap_executable_properties(sshdump) target_link_libraries(sshdump ${sshdump_LIBS}) target_include_directories(sshdump PUBLIC ${LIBSSH_INCLUDE_DIR}) - install(TARGETS sshdump RUNTIME DESTINATION ${EXTCAP_DIR}) + install(TARGETS sshdump RUNTIME DESTINATION ${EXTCAP_INSTALL_LIBDIR}) add_dependencies(extcaps sshdump) elseif (BUILD_sshdump) #message( WARNING "Cannot find libssh, cannot build sshdump" ) @@ -144,7 +144,7 @@ if(BUILD_ciscodump AND LIBSSH_FOUND) set_extcap_executable_properties(ciscodump) target_link_libraries(ciscodump ${ciscodump_LIBS}) target_include_directories(ciscodump PUBLIC ${LIBSSH_INCLUDE_DIR}) - install(TARGETS ciscodump RUNTIME DESTINATION ${EXTCAP_DIR}) + install(TARGETS ciscodump RUNTIME DESTINATION ${EXTCAP_INSTALL_LIBDIR}) add_dependencies(extcaps ciscodump) elseif (BUILD_ciscodump) #message( WARNING "Cannot find libssh, cannot build ciscodump" ) @@ -167,7 +167,7 @@ if(BUILD_dpauxmon AND HAVE_LIBNL3) set_extcap_executable_properties(dpauxmon) target_link_libraries(dpauxmon ${dpauxmon_LIBS}) target_include_directories(dpauxmon PUBLIC ${NL_INCLUDE_DIR}) - install(TARGETS dpauxmon RUNTIME DESTINATION ${EXTCAP_DIR}) + install(TARGETS dpauxmon RUNTIME DESTINATION ${EXTCAP_INSTALL_LIBDIR}) add_dependencies(extcaps dpauxmon) elseif (BUILD_dpauxmon) #message( WARNING "Cannot find libnl3, cannot build dpauxmon" ) @@ -188,7 +188,7 @@ if(BUILD_udpdump) add_executable(udpdump WIN32 ${udpdump_FILES}) set_extcap_executable_properties(udpdump) target_link_libraries(udpdump ${udpdump_LIBS}) - install(TARGETS udpdump RUNTIME DESTINATION ${EXTCAP_DIR}) + install(TARGETS udpdump RUNTIME DESTINATION ${EXTCAP_INSTALL_LIBDIR}) add_dependencies(extcaps udpdump) endif() @@ -210,7 +210,7 @@ if(BUILD_randpktdump) # XXX Shouldn't we add wsutil to randpktdump_LIBS instead? set_extcap_executable_properties(randpktdump) target_link_libraries(randpktdump ${randpktdump_LIBS}) - install(TARGETS randpktdump RUNTIME DESTINATION ${EXTCAP_DIR}) + install(TARGETS randpktdump RUNTIME DESTINATION ${EXTCAP_INSTALL_LIBDIR}) add_dependencies(extcaps randpktdump) endif() @@ -219,4 +219,4 @@ set(CLEAN_C_FILES ${androiddump_FILES} ${sshdump_FILES} ${ciscodump_FILES} -)
\ No newline at end of file +) diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 2d0478f6a6..ebfd2242e0 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -9,9 +9,8 @@ include(UseABICheck) -if(NOT WIN32) - add_definitions(-DPLUGIN_DIR=\"${CMAKE_INSTALL_FULL_LIBDIR}/wireshark/plugins\") -endif() +add_definitions(-DPLUGIN_DIR=\"${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_LIBDIR}\") +add_definitions(-DEXTCAP_DIR=\"${CMAKE_INSTALL_PREFIX}/${EXTCAP_INSTALL_LIBDIR}\") set(WSUTIL_PUBLIC_HEADERS adler32.h |