From 41fd122fa8ded4b7e5f659a92f39008ebbcc06b9 Mon Sep 17 00:00:00 2001
From: Rashad Kanavath <rashad.kanavath@c-s.fr>
Date: Tue, 10 Jan 2017 11:06:32 +0100
Subject: [PATCH] BUG: Monteverdi: install icons and desktop file with
 MonteverdiGui module

---
 .../MonteverdiGui/CMakeLists.txt              | 40 +++++++++++++++++
 Utilities/Data/CMakeLists.txt                 | 43 -------------------
 2 files changed, 40 insertions(+), 43 deletions(-)
 delete mode 100644 Utilities/Data/CMakeLists.txt

diff --git a/Modules/Visualization/MonteverdiGui/CMakeLists.txt b/Modules/Visualization/MonteverdiGui/CMakeLists.txt
index 73d8b00def..37f9984e1d 100644
--- a/Modules/Visualization/MonteverdiGui/CMakeLists.txt
+++ b/Modules/Visualization/MonteverdiGui/CMakeLists.txt
@@ -7,4 +7,44 @@ set( OTBMonteverdiGUI_INCLUDE_DIRS
   ${OTBMonteverdiGUI_BINARY_DIR}/src
   )
 
+
+set(OTBMonteverdiGUI_DATA_DIR "${CMAKE_SOURCE_DIR}/Utilities/Data")
+
+if (UNIX AND NOT APPLE)
+  # -------------------------
+  # Install icons
+  # following freedesktop recommandations
+  # http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
+
+  # The different icon sizes installed
+  # According to the specs, the 48x48 icon is mandatory, others are optional
+  set( icon_sizes 16 32 48 128 )
+  foreach( icon_size ${icon_sizes} )
+    install(FILES ${OTBMonteverdiGUI_DATA_DIR}/Icons/monteverdi-${icon_size}x${icon_size}.png
+      DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps
+      RENAME monteverdi.png)
+  endforeach()
+
+  # Fallback on "/usr/share/pixmaps"
+  # See http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout
+  install(FILES ${OTBMonteverdiGUI_DATA_DIR}/Icons/monteverdi-32x32.png
+    DESTINATION share/pixmaps
+    RENAME monteverdi.png)
+
+  install(FILES ${OTBMonteverdiGUI_DATA_DIR}/Icons/monteverdi-splash.png
+    DESTINATION share/pixmaps
+    RENAME monteverdi-splash.png)
+
+  install(FILES ${OTBMonteverdiGUI_DATA_DIR}/Icons/monteverdi-32x32.xpm
+    DESTINATION share/pixmaps
+    RENAME monteverdi.xpm)
+
+  # -------------------------
+  # Install freedesktop entry
+
+  install(FILES ${OTBMonteverdiGUI_DATA_DIR}/monteverdi.desktop
+    DESTINATION share/applications)
+
+endif()
+
 otb_module_impl()
diff --git a/Utilities/Data/CMakeLists.txt b/Utilities/Data/CMakeLists.txt
deleted file mode 100644
index d4060576ab..0000000000
--- a/Utilities/Data/CMakeLists.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-if (UNIX AND NOT APPLE)
-
-# -------------------------
-# Install icons
-# following freedesktop recommandations
-# http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
-
-# The different icon sizes installed
-# According to the specs, the 48x48 icon is mandatory, others are optional
-set( icon_sizes 16 32 48 128 )
-foreach( icon_size ${icon_sizes} )
-  install(FILES Icons/monteverdi-${icon_size}x${icon_size}.png
-          DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps
-          RENAME monteverdi.png
-          COMPONENT Resources)
-endforeach()
-
-# Fallback on "/usr/share/pixmaps"
-# See http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout
-install(FILES Icons/monteverdi-32x32.png
-        DESTINATION share/pixmaps
-        RENAME monteverdi.png
-        COMPONENT Resources)
-
-install(FILES Icons/monteverdi-splash.png
-        DESTINATION share/pixmaps
-        RENAME monteverdi-splash.png
-        COMPONENT Resources)
-
-
-install(FILES Icons/monteverdi-32x32.xpm
-        DESTINATION share/pixmaps
-        RENAME monteverdi.xpm
-        COMPONENT Resources)
-
-# -------------------------
-# Install freedesktop entry
-
-install(FILES monteverdi.desktop
-        DESTINATION share/applications
-        COMPONENT Resources)
-
-endif()
-- 
GitLab