####################### cmakepp_lang/types/bool ####################### .. module:: cmakepp_lang/types/bool .. function:: cpp_is_bool(return str2check) Determines if the provided string can lexically be cast to a boolean. This function will compare the provided string against the list of boolean literals known to CMakePP. The actual string comparison is done in a case-insensitive manner. :param return: Name of the variable used to hold the return. :type return: desc :param str2check: The string we are checking for its bool-ness :type str2check: str :returns: ``return`` will contain ``TRUE`` if ``str2check`` is one of the recognized boolean literals and ``FALSE`` otherwise. :rtype: bool :var CMAKEPP_BOOL_LITERALS: Used to get the list of boolean literals. Example Usage ============= The following code snippet shows how to use ``cpp_is_bool`` to determine if the provided variable is a boolean. .. code-block:: cmake include(cmakepp_lang/types/bool) set(var2check TRUE) cpp_is_bool(result "${var2check}") message("var2check is a bool: ${result}") # will print TRUE Error Checking ============== ``cpp_is_bool`` will ensure that it has been called with exactly two arguments.