From b1cfaf3f48fd667c89f0623361253251ff39b99c Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Thu, 8 May 2003 14:17:26 -0400
Subject: [PATCH] ENH: Setup for testing as a stand-alone project.

---
 CMakeLists.txt | 11 +++++++++++
 README.itk     | 24 ------------------------
 README.txt     |  7 +++++++
 test1.cxx      |  7 +++++++
 4 files changed, 25 insertions(+), 24 deletions(-)
 delete mode 100644 README.itk
 create mode 100644 README.txt
 create mode 100644 test1.cxx

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f5df8e2..6edaf3f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,8 @@
+IF(NOT KWSYS_NAMESPACE)
+  SET(KWSYS_NAMESPACE "kwsys")
+  SET(KWSYS_DEFAULTS 1)
+ENDIF(NOT KWSYS_NAMESPACE)
+
 PROJECT(${KWSYS_NAMESPACE})
 INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIStreamHeaders.cmake)
 INCLUDE(${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake)
@@ -45,3 +50,9 @@ IF(KWSYS_INCLUDE_INSTALL_DIR)
   INSTALL_FILES(${KWSYS_INCLUDE_INSTALL_DIR}/${KWSYS_NAMESPACE}
                 FILES ${KWSYS_INCLUDES})
 ENDIF(KWSYS_INCLUDE_INSTALL_DIR)
+
+IF(KWSYS_DEFAULTS)
+  INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/..)
+  ADD_EXECUTABLE(test1 test1.cxx)
+  TARGET_LINK_LIBRARIES(test1 ${KWSYS_NAMESPACE})
+ENDIF(KWSYS_DEFAULTS)
diff --git a/README.itk b/README.itk
deleted file mode 100644
index 30206d4..0000000
--- a/README.itk
+++ /dev/null
@@ -1,24 +0,0 @@
-KWSys provides a platform-independent API to many common system
-features that are implemented differently on every platform.  This
-library is intended to be shared among many projects.
-
-How to use KWSys from ITK:
-
-#include <itkkwsys/SystemTools.hxx>
-
-bool MyIsDirectory(const char* fname)
-{
-  return itkkwsys::SystemTools::FileIsDirectory(fname);
-}
-
-How to modify KWSys:
-
-When adding a method to an existing class, make no mention of ITK.
-KWSys has no knowledge of ITK headers or libraries.  Please also keep
-in mind that KWSys must be able to build on more platforms and
-compilers than ITK.  Refer to existing code for conventions to ease
-this task.
-
-If you want to add a class, please contact the ITK mailing list for
-discussion.  Please do not add a class without permission from
-Kitware.
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..4f439d1
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,7 @@
+KWSys provides a platform-independent API to many common system
+features that are implemented differently on every platform.  This
+library is intended to be shared among many projects.
+
+You are probably reading this file in the source tree of a surrounding
+project.  In that case, see "../README.kwsys" for details of using
+KWSys in your project.
diff --git a/test1.cxx b/test1.cxx
new file mode 100644
index 0000000..e46f02c
--- /dev/null
+++ b/test1.cxx
@@ -0,0 +1,7 @@
+#include <kwsys/Directory.hxx>
+
+int main()
+{
+  kwsys::Directory();
+  return 0;
+}
-- 
GitLab