]> Creatis software - gdcm.git/blobdiff - CMakeLists.txt
* Update the version to 1.3.0
[gdcm.git] / CMakeLists.txt
index cc7a610247e6cb079eb1ef503b794a942d8d0068..728923a4f4f0127b4c3741800e75e815cdc1114b 100644 (file)
@@ -5,8 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
 #-----------------------------------------------------------------------------
 # GDCM version number, usefull for packaging and doxygen doc:
 SET(GDCM_MAJOR_VERSION 1)
-SET(GDCM_MINOR_VERSION 1)
-SET(GDCM_BUILD_VERSION 1)
+SET(GDCM_MINOR_VERSION 3)
+SET(GDCM_BUILD_VERSION 0)
 SET(GDCM_VERSION 
     "${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
 
@@ -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(
@@ -132,6 +152,9 @@ CHECK_INCLUDE_FILE("stdint.h"       CMAKE_HAVE_STDINT_H)
 IF(UNIX) #Avoid polluting Win32 cmakecache
   CHECK_INCLUDE_FILE("inttypes.h"     CMAKE_HAVE_INTTYPES_H)
 ENDIF(UNIX)
+# Special Time support, two convention: *NIX vs Win32
+CHECK_INCLUDE_FILE("sys/times.h"     CMAKE_HAVE_SYS_TIMES_H)
+CHECK_INCLUDE_FILE("sys/timeb.h"     CMAKE_HAVE_SYS_TIMEB_H)
 
 # Check if header file exists and add it to the list.
 INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake)
@@ -166,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}
@@ -197,7 +220,7 @@ OPTION(GDCM_FORCE_BIGENDIAN_EMULATION "Force Big Endian Emulation. Do use if you
 CONFIGURE_FILE(${GDCM_SOURCE_DIR}/gdcmConfigure.h.in
                ${GDCM_BINARY_DIR}/gdcmConfigure.h @ONLY IMMEDIATE)
 
-INSTALL_FILES(/include .h gdcmConfigure.h)
+INSTALL_FILES(/include/gdcm .h gdcmConfigure.h)
 INSTALL_FILES(/lib .cmake GDCMBuildSettings  GDCMConfig  GDCMLibraryDepends)
 
 #-----------------------------------------------------------------------------