]> Creatis software - gdcm.git/blobdiff - CMakeLists.txt
ENH: Need newline to avoid warning
[gdcm.git] / CMakeLists.txt
index 14ba182f2ea3f484ef6a84f3fffeee8e787c1137..a62d5c5468490f106b619fd038f7d338be6384ef 100644 (file)
@@ -87,6 +87,26 @@ IF("GDCM_COMPILER_HAS_FUNCTION" MATCHES "^GDCM_COMPILER_HAS_FUNCTION$")
   ENDIF(GDCM_COMPILER_HAS_FUNCTION)
 ENDIF("GDCM_COMPILER_HAS_FUNCTION" MATCHES "^GDCM_COMPILER_HAS_FUNCTION$")
 
+#-----------------------------------------------------------------------------
+# Test is compiler support istringstream
+IF("GDCM_TEST_ISTRINGSTREAM" MATCHES "^GDCM_TEST_ISTRINGSTREAM$")
+  MESSAGE(STATUS "Checking istringstream")
+  TRY_RUN(GDCM_TEST_ISTRINGSTREAM GDCM_TEST_ISTRINGSTREAM_COMPILED
+          ${GDCM_BINARY_DIR}/CMakeTmp/
+          ${GDCM_SOURCE_DIR}/CMake/gdcmTestIstringStream.cxx)
+  IF(GDCM_TEST_ISTRINGSTREAM_COMPILED)
+    IF(GDCM_TEST_ISTRINGSTREAM)
+      MESSAGE(STATUS "Checking istringstream works -- yes")
+      SET(GDCM_TEST_ISTRINGSTREAM 1 CACHE INTERNAL "Whether istringstream works.")
+    ELSE(GDCM_TEST_ISTRINGSTREAM)
+      MESSAGE(STATUS "Checking istringstream works -- no")
+      SET(GDCM_TEST_ISTRINGSTREAM 0 CACHE INTERNAL "Whether istringstream works.")
+    ENDIF(GDCM_TEST_ISTRINGSTREAM)
+  ELSE(GDCM_TEST_ISTRINGSTREAM_COMPILED)
+    MESSAGE(STATUS "Checking istringstream -- failed")
+  ENDIF(GDCM_TEST_ISTRINGSTREAM_COMPILED)
+ENDIF("GDCM_TEST_ISTRINGSTREAM" MATCHES "^GDCM_TEST_ISTRINGSTREAM$")
+
 #-----------------------------------------------------------------------------
 # Build directory on which many applications depend
 SUBDIRS(
@@ -169,7 +189,7 @@ IF( ${CMAKE_HAVE_SYS_SOCKET_H} )
     FILE(WRITE ${GDCM_BINARY_DIR}/CMakeTmp/gdcmTestHAVESALEN.c
       "${POUND}include <sys/types.h>\n"
       "${POUND}include <sys/socket.h>\n"
-      "int main() { struct sockaddr sa; sa.sa_len = 0; }")
+      "int main() { struct sockaddr sa; sa.sa_len = 0; }\n")
     MESSAGE(STATUS "Checking if ifreq has a sa_len")
     TRY_COMPILE(HAVE_SA_LEN
       ${GDCM_BINARY_DIR}