[CMake] How to add "modifiers" to functions

Renato Utsch renatoutsch at gmail.com
Fri Dec 16 19:39:37 EST 2011


I am trying to make a function that will check if the build is
in-source or out-of-source. 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 )

How can I make this?


Renato


More information about the CMake mailing list