extcap: set EXTCAP_DIR in the root cmake file and propagate it.
authorDario Lombardo <lomato@gmail.com>
Thu, 24 May 2018 13:08:48 +0000 (15:08 +0200)
committerAnders Broman <a.broman58@gmail.com>
Thu, 24 May 2018 13:58:13 +0000 (13:58 +0000)
The EXTCAP_DIR must be known in the root file to be set in config.h
and it's still needed in extcap/ to install the binaries, hence we
need caching it as well.

Bug: 14724

Change-Id: I58bac7de7a00e06c23fe8c8f1a7e3d299de6a560
Reviewed-on: https://code.wireshark.org/review/27776
Reviewed-by: Mikael Kanstrup <mikael.kanstrup@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
CMakeLists.txt
extcap/CMakeLists.txt

index a95ff3302c79b6fb56f1b0b01f0b1bc4a0d87bf6..99ff435818f76771cadd0eaf02022534749b16d9 100644 (file)
@@ -1247,6 +1247,17 @@ set_target_properties(checkAPI
 
 include( UseCheckAPI )
 
+# Target platform locations
+# UN*X in general, including macOS if not building an app bundle:
+# $DESTDIR/lib/wireshark/extcap
+# Windows: $DESTDIR/extcap
+# macOS app bundle: Wireshark.app/Contents/Resources/share/wireshark/extcap
+if (WIN32)
+       set(EXTCAP_DIR "extcap" CACHE INTERNAL "The extcap dir")
+else ()
+       set(EXTCAP_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap" CACHE INTERNAL "The extcap dir")
+endif()
+
 add_subdirectory( capchild )
 add_subdirectory( caputils )
 add_subdirectory( codecs )
index f79a27d2ff184ecbf19858f66bcf11e8288bf7d1..242f66d434ee101c71e8f77f1b6b42f11f923262 100644 (file)
@@ -11,17 +11,6 @@ if(EXTCAP_ANDROIDDUMP_LIBPCAP)
        set(ANDROIDDUMP_USE_LIBPCAP 1)
 endif()
 
-# Target platform locations
-# UN*X in general, including macOS if not building an app bundle:
-# $DESTDIR/lib/wireshark/extcap
-# Windows: $DESTDIR/extcap
-# macOS app bundle: Wireshark.app/Contents/Resources/share/wireshark/extcap
-if (WIN32)
-       set(EXTCAP_DIR "extcap")
-else ()
-       set(EXTCAP_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap")
-endif()
-
 if(LIBSSH_FOUND)
        SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LIBSSH_LIBRARIES})
        CHECK_FUNCTION_EXISTS(ssh_userauth_agent LIBSSH_USERAUTH_AGENT_FOUND)