parameters: (pattern, what)
return_statement: return values
docstring: Search root CMakeLists.txt module for the given pattern(s).
docstring_summary: Search root CMakeLists.txt module for the given pattern(s).
docstring_tokens: Search root CMakeLists . txt module for the given pattern ( s ) .
function: def _get_cmake_values(pattern, what):
      """Search root CMakeLists.txt module for the given pattern(s)."""
      values = None
      cmake_path = os.path.join(ROOT, "CMakeLists.txt")
  
      with open(cmake_path, "r") as cmake_file:
          for line in cmake_file:
              match = re.match(pattern, line)
              if match:
                  values = match.groups()
                  break
  
      if not values:
          raise RuntimeError("Failed to get '{}' value from '{}'!".format(
              what, 
              cmake_path
          ))
  
      return values
function_tokens: def _get_cmake_values ( pattern , what ) : values = None cmake_path = os . path . join ( ROOT , "CMakeLists.txt" ) with open ( cmake_path , "r" ) as cmake_file : for line in cmake_file : match = re . match ( pattern , line ) if match : values = match . groups ( ) break if not values : raise RuntimeError ( "Failed to get '{}' value from '{}'!" . format ( what , cmake_path ) ) return values