variable_requires.rst 743 B

12345678910111213141516171819202122
  1. variable_requires
  2. -----------------
  3. Disallowed. See CMake Policy :policy:`CMP0035`.
  4. Use the :command:`if` command instead.
  5. Assert satisfaction of an option's required variables.
  6. ::
  7. variable_requires(TEST_VARIABLE RESULT_VARIABLE
  8. REQUIRED_VARIABLE1
  9. REQUIRED_VARIABLE2 ...)
  10. The first argument (``TEST_VARIABLE``) is the name of the variable to be
  11. tested, if that variable is false nothing else is done. If
  12. ``TEST_VARIABLE`` is true, then the next argument (``RESULT_VARIABLE``)
  13. is a variable that is set to true if all the required variables are set.
  14. The rest of the arguments are variables that must be true or not set
  15. to NOTFOUND to avoid an error. If any are not true, an error is
  16. reported.