comparison cmake/function/IrccdIndentMessage.cmake @ 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
children c6fbb6e0e06d
comparison
equal deleted inserted replaced
269:08a041011599 270:90909cf677b1
1 #
2 # IrccdIndentMessage.cmake -- CMake build system for irccd
3 #
4 # Copyright (c) 2016 David Demelier <markand@malikania.fr>
5 #
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
9 #
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #
18
19 #
20 # irccd_indent_message
21 # -------------------------------------------------------------------
22 #
23 # irccd_indent_message(variable value padding)
24 #
25 # Indent a message and its value with the specified amount of spaces between
26 # variable and value.
27 #
28 # Example:
29 #
30 # irccd_indent_message("godmode: " "false", 20)
31 #
32 # Will output:
33 #
34 # godmode: false
35 #
36
37 function(irccd_indent_message var value padding)
38 string(LENGTH "${var}" length)
39
40 while (${length} LESS ${padding})
41 math(EXPR length "${length} + 1")
42 set(space "${space} ")
43 endwhile ()
44
45 message("${var}${space}${value}")
46 endfunction()