• R/O
  • SSH

cmake_tools: Commit

This library contains CMake code (files with .cmake extentions),
Python scripts and it is intended for simplification different actions
on the organization of the build environment.


Commit MetaInfo

Revisionca3f8f1f3ab0829b63f0ebce53cd6b2af2fe6b8d (tree)
Zeit2017-10-30 00:37:29
Autors.gusarov
Commiters.gusarov

Log Message

New inplementation of cmtAssertVariableEmpty/cmtAssertVariableNotEmpty.
It should be free of CMP0054 policy warning with the same behaviour

Ändern Zusammenfassung

Diff

diff -r 9344d5bff9f4 -r ca3f8f1f3ab0 tools/check_variables.cmake
--- a/tools/check_variables.cmake Sun Oct 22 04:02:58 2017 +0300
+++ b/tools/check_variables.cmake Sun Oct 29 18:37:29 2017 +0300
@@ -5,13 +5,15 @@
55 # Runtime asserts for variables
66
77 function(cmtAssertVariableEmpty variable)
8- if ("${${variable}}" NOT STREQUAL "")
8+ string(COMPARE EQUAL "${${variable}}" "" result)
9+ if (NOT result)
910 message(FATAL_ERROR "${variable} is not empty")
1011 endif()
1112 endfunction(cmtAssertVariableEmpty)
1213
1314 function(cmtAssertVariableNotEmpty variable)
14- if ("${${variable}}" STREQUAL "")
15+ string(COMPARE EQUAL "${${variable}}" "" result)
16+ if (result)
1517 message(FATAL_ERROR "${variable} is empty")
1618 endif()
1719 endfunction(cmtAssertVariableNotEmpty)
Show on old repository browser