diff CMakeLists.txt @ 270:90909cf677b1

CMake: make installation of DLLs more generic
author David Demelier <markand@malikania.fr>
date Mon, 19 Sep 2016 13:42:54 +0200
parents 85a53bc2116c
children c143682678b9
line wrap: on
line diff
--- a/CMakeLists.txt	Sun Sep 18 11:16:09 2016 +0200
+++ b/CMakeLists.txt	Mon Sep 19 13:42:54 2016 +0200
@@ -65,6 +65,7 @@
 include(cmake/function/IrccdDefineMan.cmake)
 include(cmake/function/IrccdDefinePlugin.cmake)
 include(cmake/function/IrccdDefineTest.cmake)
+include(cmake/function/IrccdIndentMessage.cmake)
 
 include(cmake/check/PutTime.cmake)
 
@@ -112,22 +113,25 @@
 message("Installing plugins:")
 foreach (plugin ${IRCCD_PLUGINS})
     string(TOUPPER ${plugin} name)
-    string(LENGTH ${plugin} length)
-    set(str "    ${plugin}:")
+    irccd_indent_message("    ${plugin}: " "${WITH_PLUGIN_${name}_MSG}" 22)
+endforeach ()
+message("")
 
-    #
-    # Build a string to indent the output correctly because tabs do not work well in all windows
-    # (e.g. CMake's GUI, QtCreator...)
-    #
-    while (${length} LESS 17)
-        math(EXPR length "${length} + 1")
-        set(str "${str} ")
-    endwhile ()
+if (WIN32)
+    message("Installing these DLLs:")
+    foreach (name ${IRCCD_DLLS})
+        irccd_indent_message("    ${name}: " "${${name}}" 30)
+    endforeach ()
+    message("")
 
-    message("${str}${WITH_PLUGIN_${name}_MSG}")
-endforeach ()
-
-message("")
+    if (IRCCD_DLLS_NOT_FOUND)
+        message("The following DLLs were not found:")
+        foreach (name ${IRCCD_DLLS_NOT_FOUND})
+            message("    ${name}")
+        endforeach ()
+        message("")
+    endif ()
+endif ()
 
 include(cmake/IrccdPackage.cmake)
 include(CPack)