CMake: Work correctly without Sparkle.

Set or clear SPARKLE_LIBRARIES and SPARKLE_INCLUDE_DIRS in
FindSparkle.cmake, similar to what we do in other modules. Use them
instead of SPARKLE_LIBRARY and SPARKLE_INCLUDE_DIR.

Change-Id: I023c711edd6a44421aadf85413da3207d9b08e64
Reviewed-on: https://code.wireshark.org/review/35097
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2019-11-15 13:30:19 -08:00
parent e624545b95
commit 7cc5f4c45f
3 changed files with 15 additions and 6 deletions

View File

@ -2271,7 +2271,7 @@ if(BUILD_wireshark AND QT_FOUND)
${APPLE_APPKIT_LIBRARY} ${APPLE_APPKIT_LIBRARY}
${APPLE_CORE_FOUNDATION_LIBRARY} ${APPLE_CORE_FOUNDATION_LIBRARY}
${APPLE_SYSTEM_CONFIGURATION_LIBRARY} ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
${SPARKLE_LIBRARY} ${SPARKLE_LIBRARIES}
${WIN_WS2_32_LIBRARY} ${WIN_WS2_32_LIBRARY}
${WIN_VERSION_LIBRARY} ${WIN_VERSION_LIBRARY}
${WINSPARKLE_LIBRARIES} ${WINSPARKLE_LIBRARIES}
@ -2318,7 +2318,7 @@ if(BUILD_wireshark AND QT_FOUND)
endif() endif()
target_link_libraries(wireshark ${wireshark_LIBS}) target_link_libraries(wireshark ${wireshark_LIBS})
target_include_directories(wireshark SYSTEM PRIVATE ${SPARKLE_INCLUDE_DIR}) target_include_directories(wireshark SYSTEM PRIVATE ${SPARKLE_INCLUDE_DIRS})
install( install(
TARGETS wireshark TARGETS wireshark

View File

@ -2,9 +2,9 @@
# Find the Sparkle framework # Find the Sparkle framework
# #
# This defines the following: # This defines the following:
# SPARKLE_FOUND - True if we found Sparkle # SPARKLE_FOUND - True if we found Sparkle
# SPARKLE_INCLUDE_DIR - Path to Sparkle.h # SPARKLE_INCLUDE_DIRS - Path to Sparkle.h, empty if not found
# SPARKLE_LIBRARY - Path to Sparkle.framework # SPARKLE_LIBRARIES - Path to Sparkle.framework, empty if not found
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
@ -19,4 +19,13 @@ find_library(SPARKLE_LIBRARY NAMES Sparkle
) )
find_package_handle_standard_args(Sparkle DEFAULT_MSG SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY) find_package_handle_standard_args(Sparkle DEFAULT_MSG SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY)
if(SPARKLE_FOUND)
set(SPARKLE_LIBRARIES ${SPARKLE_LIBRARY} )
set(SPARKLE_INCLUDE_DIRS ${SPARKLE_INCLUDE_DIR} )
else(SPARKLE_FOUND)
set(SPARKLE_LIBRARIES )
set(SPARKLE_INCLUDE_DIRS )
endif(SPARKLE_FOUND)
mark_as_advanced(SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY) mark_as_advanced(SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY)

View File

@ -114,7 +114,7 @@ if [ ! -d "$qt_frameworks_dir" ] ; then
exit 1 exit 1
fi fi
sparkle_frameworks_dir="@SPARKLE_LIBRARY@" sparkle_frameworks_dir="@SPARKLE_LIBRARIES@"
# #
# Leave the Qt frameworks out of the special processing. # Leave the Qt frameworks out of the special processing.