[cmake-commits] martink committed cmEndFunctionCommand.h NONE 1.1 cmEndFunctionCommand.cxx NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Dec 3 12:47:24 EST 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv25749

Added Files:
	cmEndFunctionCommand.h cmEndFunctionCommand.cxx 
Log Message:
ENH: add functions


--- NEW FILE: cmEndFunctionCommand.h ---
/*=========================================================================

  Program:   CMake - Cross-Platform Makefile Generator
  Module:    $RCSfile: cmEndFunctionCommand.h,v $
  Language:  C++
  Date:      $Date: 2007/12/03 17:47:22 $
  Version:   $Revision: 1.1 $

  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmEndFunctionCommand_h
#define cmEndFunctionCommand_h

#include "cmCommand.h"

/** \class cmEndFunctionCommand
 * \brief ends an if block
 *
 * cmEndFunctionCommand ends an if block
 */
class cmEndFunctionCommand : public cmCommand
{
public:
  /**
   * This is a virtual constructor for the command.
   */
  virtual cmCommand* Clone() 
    {
    return new cmEndFunctionCommand;
    }

  /**
   * Override cmCommand::InvokeInitialPass to get arguments before
   * expansion.
   */
  virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&);
  
  /**
   * This is called when the command is first encountered in
   * the CMakeLists.txt file.
   */
  virtual bool InitialPass(std::vector<std::string> const&) {return false;}

  /**
   * This determines if the command is invoked when in script mode.
   */
  virtual bool IsScriptable() { return true; }

  /**
   * The name of the command as specified in CMakeList.txt.
   */
  virtual const char* GetName() { return "endfunction";}

  /**
   * Succinct documentation.
   */
  virtual const char* GetTerseDocumentation() 
    {
    return "Ends a list of commands in a function block.";
    }
  
  /**
   * More documentation.
   */
  virtual const char* GetFullDocumentation()
    {
    return
      "  endfunction(expression)\n"
      "See the function command.";
    }
  
  cmTypeMacro(cmEndFunctionCommand, cmCommand);
};


#endif

--- NEW FILE: cmEndFunctionCommand.cxx ---
/*=========================================================================

  Program:   CMake - Cross-Platform Makefile Generator
  Module:    $RCSfile: cmEndFunctionCommand.cxx,v $
  Language:  C++
  Date:      $Date: 2007/12/03 17:47:22 $
  Version:   $Revision: 1.1 $

  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#include "cmEndFunctionCommand.h"

bool cmEndFunctionCommand
::InvokeInitialPass(std::vector<cmListFileArgument> const&)
{
  this->SetError("An ENDFUNCTION command was found outside of a proper "
                 "FUNCTION ENDFUNCTION structure. Or its arguments did not "
                 "match the opening FUNCTION command.");
  return false;
}




More information about the Cmake-commits mailing list