[CMake] How to add "modifiers" to functions

Eric Noulard eric.noulard at gmail.com
Sat Dec 17 02:48:19 EST 2011


2011/12/17 Renato Utsch <renatoutsch at gmail.com>:
> I am trying to make a function that will check if the build is
> in-source or out-of-source.

This is not really possible to do [yet]
see http://public.kitware.com/Bug/view.php?id=6672

> But I wanted to add a "REQUIRED"
> 'modifier' to the function, that if it finds that the build in
> in-source, and if we specify "REQUIRED" (as with, like, find_package()
> CMake command) it would show an error message to the console. It would
> be like above to call it:
>
> check_build_in_source( VARIABLE REQUIRED )

Concerning user macro with keyword arguments have a look at the
CMakeParseArguments module,

cmake --help-module CMakeParseArguments


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list