aboutsummaryrefslogtreecommitdiff
path: root/cmake/ProjUtilities.cmake
diff options
context:
space:
mode:
authorMike Taves <mwtoews@gmail.com>2019-03-18 23:58:41 +1300
committerMike Taves <mwtoews@gmail.com>2019-03-19 20:04:48 +1300
commit2622d3851573cd44fc7b36bfd15f07215f434d4b (patch)
tree0bd797dc0c66c52b494c7b5dfe7b45f32fecc459 /cmake/ProjUtilities.cmake
parent8cf492acb3840eff5064a2da421c143e1fd1646c (diff)
downloadPROJ-2622d3851573cd44fc7b36bfd15f07215f434d4b.tar.gz
PROJ-2622d3851573cd44fc7b36bfd15f07215f434d4b.zip
Normalize CMake with cmakelint, 2-space indent
Diffstat (limited to 'cmake/ProjUtilities.cmake')
-rw-r--r--cmake/ProjUtilities.cmake45
1 files changed, 23 insertions, 22 deletions
diff --git a/cmake/ProjUtilities.cmake b/cmake/ProjUtilities.cmake
index 72373719..1a2b6052 100644
--- a/cmake/ProjUtilities.cmake
+++ b/cmake/ProjUtilities.cmake
@@ -5,7 +5,7 @@
################################################################################
# Copyright (C) 2007 Douglas Gregor <doug.gregor@gmail.com>
# Copyright (C) 2007 Troy Straszheim
-# Copyright (C) 2010 Mateusz Loskot <mateusz@loskot.net>
+# Copyright (C) 2010 Mateusz Loskot <mateusz@loskot.net>
#
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
@@ -13,7 +13,7 @@
################################################################################
# Macros in this module:
#
-# proj_target_output_name:
+# proj_target_output_name:
#
################################################################################
@@ -21,8 +21,8 @@
# A big shout out to the cmake gurus @ compiz
#
-function (colormsg)
- string (ASCII 27 _escape)
+function(colormsg)
+ string(ASCII 27 _escape)
set(WHITE "29")
set(GRAY "30")
set(RED "31")
@@ -32,7 +32,7 @@ function (colormsg)
set(MAG "35")
set(CYAN "36")
- foreach (color WHITE GRAY RED GREEN YELLOW BLUE MAG CYAN)
+ foreach(color WHITE GRAY RED GREEN YELLOW BLUE MAG CYAN)
set(HI${color} "1\;${${color}}")
set(LO${color} "2\;${${color}}")
set(_${color}_ "4\;${${color}}")
@@ -43,14 +43,14 @@ function (colormsg)
set(str "")
set(coloron FALSE)
foreach(arg ${ARGV})
- if (NOT ${${arg}} STREQUAL "")
- if (CMAKE_COLOR_MAKEFILE)
+ if(NOT ${${arg}} STREQUAL "")
+ if(CMAKE_COLOR_MAKEFILE)
set(str "${str}${_escape}[${${arg}}m")
set(coloron TRUE)
endif()
else()
set(str "${str}${arg}")
- if (coloron)
+ if(coloron)
set(str "${str}${_escape}[0m")
set(coloron FALSE)
endif()
@@ -60,19 +60,19 @@ function (colormsg)
message(STATUS ${str})
endfunction()
-# colormsg("Colors:"
-# WHITE "white" GRAY "gray" GREEN "green"
-# RED "red" YELLOW "yellow" BLUE "blue" MAG "mag" CYAN "cyan"
-# _WHITE_ "white" _GRAY_ "gray" _GREEN_ "green"
-# _RED_ "red" _YELLOW_ "yellow" _BLUE_ "blue" _MAG_ "mag" _CYAN_ "cyan"
-# _HIWHITE_ "white" _HIGRAY_ "gray" _HIGREEN_ "green"
-# _HIRED_ "red" _HIYELLOW_ "yellow" _HIBLUE_ "blue" _HIMAG_ "mag" _HICYAN_ "cyan"
-# HIWHITE "white" HIGRAY "gray" HIGREEN "green"
-# HIRED "red" HIYELLOW "yellow" HIBLUE "blue" HIMAG "mag" HICYAN "cyan"
+# colormsg("Colors:"
+# WHITE "white" GRAY "gray" GREEN "green"
+# RED "red" YELLOW "yellow" BLUE "blue" MAG "mag" CYAN "cyan"
+# _WHITE_ "white" _GRAY_ "gray" _GREEN_ "green"
+# _RED_ "red" _YELLOW_ "yellow" _BLUE_ "blue" _MAG_ "mag" _CYAN_ "cyan"
+# _HIWHITE_ "white" _HIGRAY_ "gray" _HIGREEN_ "green"
+# _HIRED_ "red" _HIYELLOW_ "yellow" _HIBLUE_ "blue" _HIMAG_ "mag"
+# _HICYAN_ "cyan" HIWHITE "white" HIGRAY "gray" HIGREEN "green"
+# HIRED "red" HIYELLOW "yellow" HIBLUE "blue" HIMAG "mag" HICYAN "cyan"
# "right?")
#
-# pretty-prints the value of a variable so that the
+# pretty-prints the value of a variable so that the
# equals signs align
#
@@ -82,7 +82,7 @@ function(boost_report_value NAME)
#message(STATUS "boost_report_value: NAME=${NAME} (${varlen})")
#message(STATUS "boost_report_value: \${NAME}=${${NAME}}")
math(EXPR padding_len 40-${varlen})
- string(SUBSTRING " "
+ string(SUBSTRING " "
0 ${padding_len} varpadding)
colormsg("${NAME}${varpadding} = ${${NAME}}")
endfunction()
@@ -98,12 +98,13 @@ function(proj_target_output_name TARGET_NAME OUTPUT_NAME)
endif()
if(NOT DEFINED ${PROJECT_INTERN_NAME}_VERSION)
- message(SEND_ERROR "Error, the variable ${${PROJECT_INTERN_NAME}_VERSION} is not defined!")
+ message(SEND_ERROR
+ "Error, the variable ${${PROJECT_INTERN_NAME}_VERSION} is not defined!")
endif()
# On Windows, ABI version is specified using binary file name suffix.
# On Unix, suffix is empty and SOVERSION is used instead.
- if (WIN32)
+ if(WIN32)
string(LENGTH "${${PROJECT_INTERN_NAME}_ABI_VERSION}" abilen)
if(abilen GREATER 0)
set(SUFFIX "_${${PROJECT_INTERN_NAME}_ABI_VERSION}")
@@ -111,4 +112,4 @@ function(proj_target_output_name TARGET_NAME OUTPUT_NAME)
endif()
set(${OUTPUT_NAME} ${TARGET_NAME}${SUFFIX} PARENT_SCOPE)
-endfunction() \ No newline at end of file
+endfunction()