Adding colors in output messages.
[staging/xdg-launcher.git] / cmake / common.cmake
index fadba0e..afc8ce0 100644 (file)
@@ -155,9 +155,9 @@ macro(remote_targets_populate)
        )
 
        if(NOT RSYNC_TARGET OR NOT RSYNC_PREFIX)
-               message (".. Warning: RSYNC_TARGET RSYNC_PREFIX not defined 'make remote-target-populate' not instanciated")
+               message ("${Yellow}.. Warning: RSYNC_TARGET RSYNC_PREFIX not defined 'make remote-target-populate' not instanciated${ColourReset}")
                add_custom_target(remote-target-populate
-                       COMMENT "*** Fatal: RSYNC_TARGET RSYNC_PREFIX required with 'make remote-target-populate'"
+                       COMMENT "${Red}*** Fatal: RSYNC_TARGET RSYNC_PREFIX environment variables required with 'make remote-target-populate'${ColourReset}"
                        COMMAND exit -1
                )
        else()
@@ -168,7 +168,7 @@ macro(remote_targets_populate)
                add_custom_target(remote-target-populate
                        DEPENDS populate
                        COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/start-on-${RSYNC_TARGET}.sh
-                       COMMAND rsync --archive --delete ${PROJECT_PKG_DIR}/ ${RSYNC_TARGET}:${RSYNC_PREFIX}/${PROJECT_NAME}
+                       COMMAND rsync --archive --delete ${PROJECT_PKG_BUILD_DIR}/ ${RSYNC_TARGET}:${RSYNC_PREFIX}/${PROJECT_NAME}
                        COMMENT "${REMOTE_LAUNCH}"
                )
        endif()
@@ -253,11 +253,13 @@ macro(project_package_build)
 endmacro(project_package_build)
 
 macro(project_subdirs_add)
-       if(${ARGV0})
+       set (ARGSLIST ${ARGN})
+       list(LENGTH ARGSLIST ARGSNUM)
+       if(${ARGSNUM} GREATER 0)
                file(GLOB filelist "${ARGV0}")
        else()
-               file(GLOB filelist "*")
-       endif(${ARGV0})
+       file(GLOB filelist "*")
+       endif()
 
        foreach(filename ${filelist})
                if(EXISTS "${filename}/CMakeLists.txt")