diff options
author | Brad King <brad.king@kitware.com> | 2005-03-26 13:19:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-03-26 13:19:36 (GMT) |
commit | 098c33c4dae7e18bed03d63c062401dcb8031c03 (patch) | |
tree | 34e0f1aa49426f54665e3e61582fe6b579ced47a /Source/kwsys/CMakeLists.txt | |
parent | 8c62539cabc5016a23e918748ea4be30b142d97e (diff) | |
download | CMake-098c33c4dae7e18bed03d63c062401dcb8031c03.zip CMake-098c33c4dae7e18bed03d63c062401dcb8031c03.tar.gz CMake-098c33c4dae7e18bed03d63c062401dcb8031c03.tar.bz2 |
ENH: Added istream and ostream operators for stl string when using old streams that do not provide them.
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 31 |
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) |