[CMake] Enforce variable is defined

Rolf Eike Beer eike at sf-mail.de
Sat Jan 14 14:50:25 EST 2012


Thorsten Wagner wrote:
> Hello,
> how can i enforce that a variable will be defined?

Try this:

if (NOT DEFINED MY_SPECIAL_VAR)
  message(FATAL_ERROR "You must set MY_SPECIAL_VAR")
endif ()

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120114/e583e69c/attachment.pgp>


More information about the CMake mailing list