Browse Source

ENH: Setup for testing as a stand-alone project.

Brad King 22 years ago
parent
commit
332f402191
4 changed files with 25 additions and 24 deletions
  1. 11 0
      Source/kwsys/CMakeLists.txt
  2. 0 24
      Source/kwsys/README.itk
  3. 7 0
      Source/kwsys/README.txt
  4. 7 0
      Source/kwsys/test1.cxx

+ 11 - 0
Source/kwsys/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)

+ 0 - 24
Source/kwsys/README.itk

@@ -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.

+ 7 - 0
Source/kwsys/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.

+ 7 - 0
Source/kwsys/test1.cxx

@@ -0,0 +1,7 @@
+#include <kwsys/Directory.hxx>
+
+int main()
+{
+  kwsys::Directory();
+  return 0;
+}