summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmBuildSharedLibrariesCommand.cxx36
-rw-r--r--Source/cmBuildSharedLibrariesCommand.h64
-rw-r--r--Source/cmWrapExcludeFilesCommand.cxx41
-rw-r--r--Source/cmWrapExcludeFilesCommand.h63
4 files changed, 204 insertions, 0 deletions
diff --git a/Source/cmBuildSharedLibrariesCommand.cxx b/Source/cmBuildSharedLibrariesCommand.cxx
new file mode 100644
index 0000000..e0f04f6
--- /dev/null
+++ b/Source/cmBuildSharedLibrariesCommand.cxx
@@ -0,0 +1,36 @@
+/*=========================================================================
+
+ 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 "cmBuildSharedLibrariesCommand.h"
+
+// cmBuildSharedLibrariesCommand
+bool cmBuildSharedLibrariesCommand::Invoke(std::vector<std::string>& args)
+{
+ // Now check and see if the value has been stored in the cache
+ // already, if so use that value and don't look for the program
+ const char* cacheValue
+ = cmCacheManager::GetInstance()->GetCacheValue("BUILD_SHARED_LIBS");
+ if(!cacheValue)
+ {
+ cmCacheManager::GetInstance()->AddCacheEntry("BUILD_SHARED_LIBS","0",
+ cmCacheManager::BOOL);
+ m_Makefile->AddDefinition("BUILD_SHARED_LIBS", "0");
+ }
+ else
+ {
+ m_Makefile->AddDefinition("BUILD_SHARED_LIBS", cacheValue);
+ }
+ return true;
+}
diff --git a/Source/cmBuildSharedLibrariesCommand.h b/Source/cmBuildSharedLibrariesCommand.h
new file mode 100644
index 0000000..6571a5c
--- /dev/null
+++ b/Source/cmBuildSharedLibrariesCommand.h
@@ -0,0 +1,64 @@
+#ifndef cmBuildSharedLibrariesCommand_h
+#define cmBuildSharedLibrariesCommand_h
+
+#include "cmStandardIncludes.h"
+#include "cmCommand.h"
+
+/** \class cmBuildSharedLibrariesCommand
+ * \brief Define a command that searches for an include file.
+ *
+ * cmBuildSharedLibrariesCommand is used to define a CMake variable include
+ * path location by specifying a file and list of directories.
+ */
+class cmBuildSharedLibrariesCommand : public cmCommand
+{
+public:
+ /**
+ * This is a virtual constructor for the command.
+ */
+ virtual cmCommand* Clone()
+ {
+ return new cmBuildSharedLibrariesCommand;
+ }
+
+ /**
+ * 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 "BUILD_SHARED_LIBRARIES";}
+
+ /**
+ * Succinct documentation.
+ */
+ virtual const char* GetTerseDocumentation()
+ {
+ return "Build shared libraries instead of static";
+ }
+
+ /**
+ * More documentation.
+ */
+ virtual const char* GetFullDocumentation()
+ {
+ return
+ "BUILD_SHARED_LIBRARIES()";
+ }
+
+private:
+};
+
+
+
+#endif
diff --git a/Source/cmWrapExcludeFilesCommand.cxx b/Source/cmWrapExcludeFilesCommand.cxx
new file mode 100644
index 0000000..328e7a1
--- /dev/null
+++ b/Source/cmWrapExcludeFilesCommand.cxx
@@ -0,0 +1,41 @@
+/*=========================================================================
+
+ 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 "cmWrapExcludeFilesCommand.h"
+
+// cmWrapExcludeFilesCommand
+bool cmWrapExcludeFilesCommand::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 j = args.begin();
+ j != args.end(); ++j)
+ {
+ std::vector<cmClassFile>& Classes = m_Makefile->GetClasses();
+ for(unsigned int i = 0; i < Classes.size(); i++)
+ {
+ if(Classes[i].m_ClassName == (*j))
+ {
+ Classes[i].m_WrapExclude = true;
+ break;
+ }
+ }
+ }
+ return true;
+}
+
diff --git a/Source/cmWrapExcludeFilesCommand.h b/Source/cmWrapExcludeFilesCommand.h
new file mode 100644
index 0000000..6ecfa1b
--- /dev/null
+++ b/Source/cmWrapExcludeFilesCommand.h
@@ -0,0 +1,63 @@
+/*=========================================================================
+
+ 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 cmWrapExcludeFilesCommand_h
+#define cmWrapExcludeFilesCommand_h
+
+#include "cmStandardIncludes.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 Invoke(std::vector<std::string>& 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 "A list of classes, to exclude from wrapping.";
+ }
+
+ /**
+ * Longer documentation.
+ */
+ virtual const char* GetFullDocumentation()
+ {
+ return
+ "WRAP_EXCLUDE_FILES(file1 file2 ..)";
+ }
+
+ cmTypeMacro(cmWrapExcludeFilesCommand, cmCommand);
+};
+
+
+
+#endif