summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-04-08 17:10:44 (GMT)
committerBrad King <brad.king@kitware.com>2003-04-08 17:10:44 (GMT)
commit7dff3a7f69d1ec1e36d38903e94e433f6583d96e (patch)
tree52188fec4a7e35d1fd08e3ed6c3dcfbf1095a818 /Source/kwsys/CMakeLists.txt
parent7f48313225537a7bcc92c0f1c73754bdc50a2ca4 (diff)
downloadCMake-7dff3a7f69d1ec1e36d38903e94e433f6583d96e.zip
CMake-7dff3a7f69d1ec1e36d38903e94e433f6583d96e.tar.gz
CMake-7dff3a7f69d1ec1e36d38903e94e433f6583d96e.tar.bz2
ENH: Added kwsys library for platform-independent system tools.
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r--Source/kwsys/CMakeLists.txt47
1 files changed, 47 insertions, 0 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
new file mode 100644
index 0000000..f5df8e2
--- /dev/null
+++ b/Source/kwsys/CMakeLists.txt
@@ -0,0 +1,47 @@
+PROJECT(${KWSYS_NAMESPACE})
+INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIStreamHeaders.cmake)
+INCLUDE(${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake)
+INCLUDE(${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake)
+INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake)
+CHECK_INCLUDE_FILE_CXX("sstream" CMAKE_HAS_ANSI_STRING_STREAM)
+
+SET(KWSYS_NO_STD_NAMESPACE ${CMAKE_NO_STD_NAMESPACE})
+SET(KWSYS_NO_ANSI_STREAM_HEADERS ${CMAKE_NO_ANSI_STREAM_HEADERS})
+SET(KWSYS_NO_ANSI_STRING_STREAM ${CMAKE_NO_ANSI_STRING_STREAM})
+SET(KWSYS_NO_ANSI_FOR_SCOPE ${CMAKE_NO_ANSI_FOR_SCOPE})
+
+SET(CLASSES Directory RegularExpression SystemTools)
+SET(HEADERS Configure StandardIncludes)
+
+SET(SRCS)
+SET(KWSYS_INCLUDES)
+FOREACH(c ${CLASSES})
+ SET(SRCS ${SRCS} ${c}.cxx)
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/${c}.hxx.in
+ ${PROJECT_BINARY_DIR}/../${KWSYS_NAMESPACE}/${c}.hxx
+ @ONLY IMMEDIATE)
+ SET(KWSYS_INCLUDES ${KWSYS_INCLUDES}
+ ${PROJECT_BINARY_DIR}/../${KWSYS_NAMESPACE}/${c}.hxx)
+ENDFOREACH(c)
+
+FOREACH(h ${HEADERS})
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/${h}.hxx.in
+ ${PROJECT_BINARY_DIR}/../${KWSYS_NAMESPACE}/${h}.hxx
+ @ONLY IMMEDIATE)
+ SET(KWSYS_INCLUDES ${KWSYS_INCLUDES}
+ ${PROJECT_BINARY_DIR}/../${KWSYS_NAMESPACE}/${h}.hxx)
+ENDFOREACH(h)
+
+ADD_LIBRARY(${KWSYS_NAMESPACE} ${SRCS})
+
+ADD_DEFINITIONS("-DKWSYS_NAMESPACE=${KWSYS_NAMESPACE}")
+INCLUDE_DIRECTORIES(BEFORE ${PROJECT_BINARY_DIR}/../${KWSYS_NAMESPACE})
+
+IF(KWSYS_LIBRARY_INSTALL_DIR)
+ INSTALL_TARGETS(${KWSYS_LIBRARY_INSTALL_DIR} ${KWSYS_NAMESPACE})
+ENDIF(KWSYS_LIBRARY_INSTALL_DIR)
+
+IF(KWSYS_INCLUDE_INSTALL_DIR)
+ INSTALL_FILES(${KWSYS_INCLUDE_INSTALL_DIR}/${KWSYS_NAMESPACE}
+ FILES ${KWSYS_INCLUDES})
+ENDIF(KWSYS_INCLUDE_INSTALL_DIR)