summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-03-29 13:20:08 (GMT)
committerBrad King <brad.king@kitware.com>2005-03-29 13:20:08 (GMT)
commit22f6d68be3e6630b21bb17de63273965de44ee45 (patch)
tree8225f2a9c0bb6fb085e482bc04f44bfb7e7a8e5d /Source/kwsys/CMakeLists.txt
parentc7a2c80c178457b4d8a1525a6b0ccff9ca4e5afa (diff)
downloadCMake-22f6d68be3e6630b21bb17de63273965de44ee45.zip
CMake-22f6d68be3e6630b21bb17de63273965de44ee45.tar.gz
CMake-22f6d68be3e6630b21bb17de63273965de44ee45.tar.bz2
ENH: Added istream and ostream operators for stl string in KWSys when using old streams that do not provide them.
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r--Source/kwsys/CMakeLists.txt31
1 files changed, 30 insertions, 1 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index c3455f3..c2f4b66 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -175,6 +175,21 @@ ELSE(KWSYS_IOS_USE_SSTREAM)
ENDIF(KWSYS_IOS_USE_STRSTREAM_H)
ENDIF(KWSYS_IOS_USE_SSTREAM)
+IF(KWSYS_IOS_USE_ANSI)
+ # ANSI streams always have string operators.
+ SET(KWSYS_STL_STRING_HAVE_OSTREAM 1)
+ SET(KWSYS_STL_STRING_HAVE_ISTREAM 1)
+ELSE(KWSYS_IOS_USE_ANSI)
+ # There may not be string operators for old streams.
+ SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
+ -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD})
+ KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_OSTREAM
+ "Checking whether stl string has ostream operator<<" DIRECT)
+ KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_ISTREAM
+ "Checking whether stl string has istream operator>>" DIRECT)
+ SET(KWSYS_PLATFORM_CXX_TEST_DEFINES)
+ENDIF(KWSYS_IOS_USE_ANSI)
+
IF(UNIX)
KWSYS_PLATFORM_CXX_TEST(KWSYS_STAT_HAS_ST_MTIM
"Checking whether struct stat has st_mtim member" DIRECT)
@@ -210,11 +225,25 @@ INCLUDE_DIRECTORIES(${KWSYS_HEADER_ROOT})
#-----------------------------------------------------------------------------
# Create STL header wrappers to block warnings in the STL headers and
# give standard names by which they may be included.
+SET(KWSYS_STL_HEADER_EXTRA_string 1)
FOREACH(header algorithm deque iterator list map numeric queue set stack string
utility vector)
# Configure the header wrapper.
SET(KWSYS_STL_HEADER "${header}")
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_stl.h.in
+ IF(KWSYS_STL_HEADER_EXTRA_${header})
+ SET(KWSYS_STL_HEADER_EXTRA
+ "#define ${KWSYS_NAMESPACE}_stl_${header}_including_hxx\n# include <${KWSYS_NAMESPACE}/stl/${header}.hxx>\n#undef ${KWSYS_NAMESPACE}_stl_${header}_including_hxx\n")
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_stl_${header}.hxx.in
+ ${KWSYS_HEADER_DIR}/stl/${header}.hxx
+ @ONLY IMMEDIATE)
+ IF(KWSYS_HEADER_INSTALL_DIR)
+ INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE}/stl
+ FILES ${KWSYS_HEADER_DIR}/stl/${header}.hxx)
+ ENDIF(KWSYS_HEADER_INSTALL_DIR)
+ ELSE(KWSYS_STL_HEADER_EXTRA_${header})
+ SET(KWSYS_STL_HEADER_EXTRA "")
+ ENDIF(KWSYS_STL_HEADER_EXTRA_${header})
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_stl.hxx.in
${KWSYS_HEADER_DIR}/stl/${header}
@ONLY IMMEDIATE)