ENH: no longer used

This commit is contained in:
Ken Martin 2005-06-03 13:00:58 -04:00
parent 672296fced
commit fdbfd6fc6e
6 changed files with 0 additions and 544 deletions

View File

@ -1,139 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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 "cmSourceFilesCommand.h"
#include "cmSourceFile.h"
#include <stdlib.h> // required for atof
bool cmSourceFilesCommand::IsDeprecated(int major, int minor)
{
if ( major >= 1 && minor >= 4 )
{
this->SetError("The SOURCE_FILES command was deprecated in CMake version 1.4 and will be removed in later versions of CMake. You should modify your CMakeLists.txt files to use the SET command instead, or set the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.2 or less.\n");
return true;
}
return false;
}
// cmSourceFilesCommand
bool cmSourceFilesCommand::InitialPass(std::vector<std::string> const& args)
{
const char* versionValue
= m_Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
if (atof(versionValue) > 1.2)
{
cmSystemTools::Message("The SOURCE_FILES command was deprecated in CMake version 1.4 and will be removed in later versions. You should modify your CMakeLists.txt files to use the SET command instead, or set the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.2 or less.\n","Warning");
}
if(args.size() < 1 )
{
this->SetError("called with incorrect number of arguments");
return false;
}
std::string sourceListValue;
// was the list already populated
std::string name = args[0];
const char *def = m_Makefile->GetDefinition(name.c_str());
if (def)
{
sourceListValue = def;
}
int generated = 0;
for(std::vector<std::string>::const_iterator i = (args.begin() + 1);
i != args.end(); ++i)
{
std::string copy = *i;
// Keyword GENERATED in the source file list means that
// from here on files will be generated
if ( copy == "GENERATED" )
{
generated = 1;
continue;
}
cmSourceFile* sf = m_Makefile->GetSource(copy.c_str());
if(sf)
{
// if the source file is already in the makefile,
// then add the pointer to the source list without creating cmSourceFile
if (sourceListValue.size() > 0)
{
sourceListValue += ";";
}
sourceListValue += copy;
continue;
}
cmSourceFile file;
file.SetProperty("ABSTRACT","0");
std::string path = cmSystemTools::GetFilenamePath(copy);
if ( generated )
{
// This file will be generated, so we should not check
// if it exist.
std::string ext = cmSystemTools::GetFilenameExtension(copy);
std::string name_no_ext = cmSystemTools::GetFilenameName(copy.c_str());
name_no_ext = name_no_ext.substr(0, name_no_ext.length()-ext.length());
if ( ext.length() && ext[0] == '.' )
{
ext = ext.substr(1);
}
if((path.size() && path[0] == '/') ||
(path.size() > 1 && path[1] == ':'))
{
file.SetName(name_no_ext.c_str(), path.c_str(), ext.c_str(), false);
}
else
{
file.SetName(name_no_ext.c_str(),
m_Makefile->GetCurrentOutputDirectory(),
ext.c_str(), false);
}
}
else
{
// if this is a full path then
if((path.size() && path[0] == '/') ||
(path.size() > 1 && path[1] == ':'))
{
file.SetName(cmSystemTools::GetFilenameName(copy.c_str()).c_str(),
path.c_str(),
m_Makefile->GetSourceExtensions(),
m_Makefile->GetHeaderExtensions());
}
else
{
file.SetName(copy.c_str(), m_Makefile->GetCurrentDirectory(),
m_Makefile->GetSourceExtensions(),
m_Makefile->GetHeaderExtensions());
}
}
m_Makefile->AddSource(file);
if (sourceListValue.size() > 0)
{
sourceListValue += ";";
}
sourceListValue += copy;
}
m_Makefile->AddDefinition(name.c_str(), sourceListValue.c_str());
return true;
}

View File

@ -1,96 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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 cmSourceFilesCommand_h
#define cmSourceFilesCommand_h
#include "cmCommand.h"
/** \class cmSourceFilesCommand
* \brief Add source files to the build.
*
* cmSourceFilesCommand adds source files to the build. The source
* files will be added to the current library (if defined by the
* LIBRARY(library) command. Use this command to add source files not
* dependent on other packages (use SOURCE_FILES_REQUIRED() to add
* dependent source files).
*
* It allows sources to be added even if they are generated by a build
* process. This can be achieved usiong GENERATED keyword:
* SOURCE_FILES( Project_SRCS
* Source1
* Source2
* ...
* GENERATED
* SourceThatDoesNotExist )
*
* \sa cmSourceFilesRequireCommand
*/
class cmSourceFilesCommand : public cmCommand
{
public:
/**
* This is a virtual constructor for the command.
*/
virtual cmCommand* Clone()
{
return new cmSourceFilesCommand;
}
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() { return "SOURCE_FILES";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation()
{
return "Deprecated. Use SET to list sources in a variable.";
}
/**
* This determines if the method is deprecated or not
*/
virtual bool IsDeprecated(int major, int minor);
/**
* More documentation.
*/
virtual const char* GetFullDocumentation()
{
return
" SOURCE_FILES(variable file1 file2 ...\n"
" [ GENERATED generated_file1 ... ])\n"
"Adds the given sources to the list in the given variable. Sources "
"listed after GENERATED will be given the GENERATED property. See "
"SET_SOURCE_FILES_PROPERTIES to add the GENERATED property to any "
"source.";
}
cmTypeMacro(cmSourceFilesCommand, cmCommand);
};
#endif

View File

@ -1,84 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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 "cmSourceFilesRemoveCommand.h"
#include <stdlib.h> // required for atof
// cmSourceFilesRemoveCommand
bool cmSourceFilesRemoveCommand::InitialPass(std::vector<std::string> const& args)
{
const char* versionValue
= m_Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
if (versionValue && atof(versionValue) > 1.2)
{
this->SetError("The SOURCE_FILES_REMOVE command has been deprecated in CMake version 1.4. You should use the REMOVE command instead.\n");
return false;
}
if(args.size() < 2 )
{
this->SetError("called with incorrect number of arguments");
return false;
}
const char* variable = args[0].c_str(); // VAR is always first
// get the old value
const char* cacheValue
= m_Makefile->GetDefinition(variable);
// expand the variable
std::vector<std::string> varArgsExpanded;
cmSystemTools::ExpandListArgument(cacheValue, varArgsExpanded);
// expand the args
// check for REMOVE(VAR v1 v2 ... vn)
std::vector<std::string> argsExpanded;
std::vector<std::string> temp;
for(unsigned int j = 1; j < args.size(); ++j)
{
temp.push_back(args[j]);
}
cmSystemTools::ExpandList(temp, argsExpanded);
// now create the new value
std::string value;
for(unsigned int j = 0; j < varArgsExpanded.size(); ++j)
{
int found = 0;
for(unsigned int k = 0; k < argsExpanded.size(); ++k)
{
if (varArgsExpanded[j] == argsExpanded[k])
{
found = 1;
break;
}
}
if (!found)
{
if (value.size())
{
value += ";";
}
value += varArgsExpanded[j];
}
}
// add the definition
m_Makefile->AddDefinition(variable, value.c_str());
return true;
}

View File

@ -1,81 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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 cmSourceFilesRemoveCommand_h
#define cmSourceFilesRemoveCommand_h
#include "cmCommand.h"
/** \class cmSourceFilesRemoveCommand
* \brief Remove source files from the build.
*
* cmSourceFilesRemoveCommand removes source files from the build.
* The sourcefiles will be removed from the current library (if defined by the
* LIBRARY(library) command. This command is primarily designed to allow
* customization of builds where (for example) a certain source file is
* failing to compile and the user wishes to edit it out conditionally.
*
* \sa cmSourceFilesRequireCommand
*/
class cmSourceFilesRemoveCommand : public cmCommand
{
public:
/**
* This is a virtual constructor for the command.
*/
virtual cmCommand* Clone()
{
return new cmSourceFilesRemoveCommand;
}
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() { return "SOURCE_FILES_REMOVE";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation()
{
return "Remove sources from those listed in the given variable.";
}
/**
* Remove (conditionally if desired) a list of source files from a group.
* This is most likely when the user has problems compiling certain files
* in a library and wants to remove them (perhaps in an optional INCLUDE)
*/
virtual const char* GetFullDocumentation()
{
return
" SOURCE_FILES_REMOVE(variable file1 file2 ...)\n"
"Removes the sources specified from the sources listed in the given "
"variable.";
}
cmTypeMacro(cmSourceFilesRemoveCommand, cmCommand);
};
#endif

View File

@ -1,80 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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 "cmWrapExcludeFilesCommand.h"
#include "cmSourceFile.h"
#include <stdlib.h> // required for atof
// cmWrapExcludeFilesCommand
bool cmWrapExcludeFilesCommand::InitialPass(std::vector<std::string> const& argsIn)
{
const char* versionValue
= m_Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
if (versionValue && atof(versionValue) > 1.2)
{
this->SetError("The WRAP_EXCLUDE_FILES command has been deprecated in CMake version 1.4. You should use the SET_SOURCE_FILES_PROPERTIES command instead.\n");
return false;
}
if(argsIn.size() < 1 )
{
this->SetError("called with incorrect number of arguments");
return false;
}
std::vector<std::string> args;
m_Makefile->ExpandSourceListArguments(argsIn, args, 0);
for(std::vector<std::string>::const_iterator j = args.begin();
j != args.end(); ++j)
{
// if the file is already in the makefile just set properites on it
cmSourceFile* sf = m_Makefile->GetSource(j->c_str());
if(sf)
{
sf->SetProperty("WRAP_EXCLUDE","1");
}
// if file is not already in the makefile, then add it
else
{
std::string newfile = *j;
cmSourceFile file;
std::string path = cmSystemTools::GetFilenamePath(newfile);
// set the flags
file.SetProperty("WRAP_EXCLUDE","1");
// if this is a full path then
if((path.size() && path[0] == '/') ||
(path.size() > 1 && path[1] == ':'))
{
file.SetName(cmSystemTools::GetFilenameName(newfile.c_str()).c_str(),
path.c_str(),
m_Makefile->GetSourceExtensions(),
m_Makefile->GetHeaderExtensions());
}
else
{
file.SetName(newfile.c_str(), m_Makefile->GetCurrentDirectory(),
m_Makefile->GetSourceExtensions(),
m_Makefile->GetHeaderExtensions());
}
// add the source file to the makefile
m_Makefile->AddSource(file);
}
}
return true;
}

View File

@ -1,64 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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 cmWrapExcludeFilesCommand_h
#define cmWrapExcludeFilesCommand_h
#include "cmCommand.h"
class cmWrapExcludeFilesCommand : public cmCommand
{
public:
virtual cmCommand* Clone()
{
return new cmWrapExcludeFilesCommand;
}
/**
* This is called when the command is first encountered in
* the input file.
*/
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() { return "WRAP_EXCLUDE_FILES";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation()
{
return "Deprecated. See SET_SOURCE_FILES_PROPERTIES.";
}
/**
* Longer documentation.
*/
virtual const char* GetFullDocumentation()
{
return
" WRAP_EXCLUDE_FILES(file1 file2 ...)\n"
"Marks files with the WRAP_EXCLUDE property.";
}
cmTypeMacro(cmWrapExcludeFilesCommand, cmCommand);
};
#endif