summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoffrey Cross <geoff@cross.lu>2001-03-12 15:10:39 (GMT)
committerGeoffrey Cross <geoff@cross.lu>2001-03-12 15:10:39 (GMT)
commit8c4795025fd28088507e5814e167bdfc9f0345f0 (patch)
treec334e9cdaf39bf9cc639ae499e70947b9e2e6eeb
parent8fb07209ebb805f9f1dbade9b68134f9a33555cf (diff)
downloadCMake-8c4795025fd28088507e5814e167bdfc9f0345f0.zip
CMake-8c4795025fd28088507e5814e167bdfc9f0345f0.tar.gz
CMake-8c4795025fd28088507e5814e167bdfc9f0345f0.tar.bz2
Include directories under Win32 only (inherited by subdirs)
-rw-r--r--Source/cmCommands.cxx2
-rw-r--r--Source/cmWin32IncludeDirectoryCommand.cxx42
-rw-r--r--Source/cmWin32IncludeDirectoryCommand.h83
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