diff options
-rw-r--r-- | Source/cmCommands.cxx | 2 | ||||
-rw-r--r-- | Source/cmWin32IncludeDirectoryCommand.cxx | 42 | ||||
-rw-r--r-- | Source/cmWin32IncludeDirectoryCommand.h | 83 |
3 files changed, 127 insertions, 0 deletions
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index e62f3e9..f4abf32 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -23,6 +23,7 @@ #include "cmUnixLibrariesCommand.cxx" #include "cmWin32DefinesCommand.cxx" #include "cmWin32LibrariesCommand.cxx" +#include "cmWin32IncludeDirectoryCommand.cxx" #include "cmConfigureFileNoAutoconf.cxx" #include "cmCableCommand.cxx" #include "cmCableData.cxx" @@ -63,6 +64,7 @@ void GetPredefinedCommands(std::list<cmCommand*>& commands) commands.push_back(new cmUnixLibrariesCommand); commands.push_back(new cmWin32DefinesCommand); commands.push_back(new cmWin32LibrariesCommand); + commands.push_back(new cmWin32IncludeDirectoryCommand); commands.push_back(new cmConfigureFileNoAutoconf); commands.push_back(new cmCableDefineSetCommand); commands.push_back(new cmCableOpenNamespaceCommand); diff --git a/Source/cmWin32IncludeDirectoryCommand.cxx b/Source/cmWin32IncludeDirectoryCommand.cxx new file mode 100644 index 0000000..c595893 --- /dev/null +++ b/Source/cmWin32IncludeDirectoryCommand.cxx @@ -0,0 +1,42 @@ +/*========================================================================= + + Program: Insight Segmentation & Registration Toolkit + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) 2000 National Library of Medicine + All rights reserved. + + See COPYRIGHT.txt for copyright details. + +=========================================================================*/ +#include "cmWin32IncludeDirectoryCommand.h" +#include "cmCacheManager.h" + +// cmWin32IncludeDirectoryCommand +cmWin32IncludeDirectoryCommand::cmWin32IncludeDirectoryCommand() +{ +#ifndef _WIN32 + this->EnabledOff(); +#endif +} + + +bool cmWin32IncludeDirectoryCommand::Invoke(std::vector<std::string>& args) +{ + if(args.size() < 1 ) + { + this->SetError("called with incorrect number of arguments"); + return false; + } + for(std::vector<std::string>::iterator i = args.begin(); + i != args.end(); ++i) + { + m_Makefile->AddIncludeDirectory((*i).c_str()); + } + return true; +} + diff --git a/Source/cmWin32IncludeDirectoryCommand.h b/Source/cmWin32IncludeDirectoryCommand.h new file mode 100644 index 0000000..f2ee7e5 --- /dev/null +++ b/Source/cmWin32IncludeDirectoryCommand.h @@ -0,0 +1,83 @@ +/*========================================================================= + + Program: Insight Segmentation & Registration Toolkit + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) 2000 National Library of Medicine + All rights reserved. + + See COPYRIGHT.txt for copyright details. + +=========================================================================*/ +#ifndef cmWin32IncludeDirectoryCommand_h +#define cmWin32IncludeDirectoryCommand_h + +#include "cmStandardIncludes.h" +#include "cmCommand.h" + +/** \class cmWin32IncludeDirectoryCommand + * \brief Add Win32 include directories to the build. + * + * cmWin32IncludeDirectoryCommand is used to specify directory locations + * to search for included files under a Windows system. + */ +class cmWin32IncludeDirectoryCommand : public cmCommand +{ +public: + /** + * Constructor + */ + cmWin32IncludeDirectoryCommand(); + + /** + * This is a virtual constructor for the command. + */ + virtual cmCommand* Clone() + { + return new cmWin32IncludeDirectoryCommand; + } + + /** + * This is called when the command is first encountered in + * the CMakeLists.txt file. + */ + virtual bool Invoke(std::vector<std::string>& args); + + /** + * This determines if the command gets propagated down + * to makefiles located in subdirectories. + */ + virtual bool IsInherited() {return true;} + + /** + * The name of the command as specified in CMakeList.txt. + */ + virtual const char* GetName() { return "WIN32_INCLUDE_DIRECTORIES";} + + /** + * Succinct documentation. + */ + virtual const char* GetTerseDocumentation() + { + return "Add Win32 include directories to the build."; + } + + /** + * More documentation. + */ + virtual const char* GetFullDocumentation() + { + return + "WIN32_INCLUDE_DIRECTORIES(dir1 dir2 ...)"; + } + + cmTypeMacro(cmWin32IncludeDirectoryCommand, cmCommand); +}; + + + +#endif |