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.
Revision | ca3f8f1f3ab0829b63f0ebce53cd6b2af2fe6b8d (tree) |
---|---|
Zeit | 2017-10-30 00:37:29 |
Autor | s.gusarov |
Commiter | s.gusarov |
New inplementation of cmtAssertVariableEmpty/cmtAssertVariableNotEmpty.
It should be free of CMP0054 policy warning with the same behaviour
@@ -5,13 +5,15 @@ | ||
5 | 5 | # Runtime asserts for variables |
6 | 6 | |
7 | 7 | function(cmtAssertVariableEmpty variable) |
8 | - if ("${${variable}}" NOT STREQUAL "") | |
8 | + string(COMPARE EQUAL "${${variable}}" "" result) | |
9 | + if (NOT result) | |
9 | 10 | message(FATAL_ERROR "${variable} is not empty") |
10 | 11 | endif() |
11 | 12 | endfunction(cmtAssertVariableEmpty) |
12 | 13 | |
13 | 14 | function(cmtAssertVariableNotEmpty variable) |
14 | - if ("${${variable}}" STREQUAL "") | |
15 | + string(COMPARE EQUAL "${${variable}}" "" result) | |
16 | + if (result) | |
15 | 17 | message(FATAL_ERROR "${variable} is empty") |
16 | 18 | endif() |
17 | 19 | endfunction(cmtAssertVariableNotEmpty) |