From 8fdddf371b5938810b25f9781f82fc75f22107b8 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 26 Aug 2017 11:12:29 -0700 Subject: [PATCH] cmake: try to find the Googlemaps plugin on Linux Different flavors of Linux put this in different subdirectories. Just have cmake find the plugin for us. Signed-off-by: Dirk Hohndel --- CMakeLists.txt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd36966c0..e77481064 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -481,11 +481,18 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") install(DIRECTORY marbledata/maps DESTINATION share/subsurface/data) install(DIRECTORY marbledata/bitmaps DESTINATION share/subsurface/data) else() - add_custom_target(link_googlemaps_plugin ALL COMMAND - rm -rf ./geoservices && - mkdir -p geoservices && - ln -sf - ${CMAKE_SOURCE_DIR}/../install-root/usr/lib/qt/plugins/geoservices/libqtgeoservices_googlemaps.so ${CMAKE_BINARY_DIR}/geoservices) + # the syntax is odd, but this searches for libqtgeoservices_googlemaps.so + # in the filesystem below our install-root + # different Linux flavors put the plugin in different directories + file(GLOB_RECURSE GOOGLEMAPS ${CMAKE_SOURCE_DIR}/../install-root/libqtgeoservices_googlemaps.so) + if ("${GOOGLEMAPS}" STREQUAL "") + message(STATUS "Cannot find libqtgeoservices_googlemaps.so") + else() + add_custom_target(link_googlemaps_plugin ALL COMMAND + rm -rf ${CMAKE_BINARY_DIR}/geoservices && + mkdir -p ${CMAKE_BINARY_DIR}/geoservices && + ln -sf ${GOOGLEMAPS} ${CMAKE_BINARY_DIR}/geoservices) + endif() endif() install(FILES subsurface.debug DESTINATION bin) install(FILES subsurface.desktop DESTINATION share/applications)