X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=47d3d3ffd5f10e26fa18dc0652d3add0ab9bf2ef;hb=195ebc4ca17c18f169cb9ad26162a09b52ab1856;hp=69b7167751fc03fb6dfc7c3b62eb444cab57ab3a;hpb=066996143ee597cc94ffc6d27751301931afad30;p=gdcm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 69b71677..47d3d3ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,13 @@ PROJECT(GDCM) CMAKE_MINIMUM_REQUIRED(VERSION 2.0) # okay in fact you need at least cmake 2.0.4 to get swig working properly +# and you cannot use cmake 2.0.6 out of the box due to a bug (patched in debian package) #----------------------------------------------------------------------------- # GDCM version number, usefull for packaging and doxygen doc: SET(GDCM_MAJOR_VERSION 1) -SET(GDCM_MINOR_VERSION 1) -SET(GDCM_BUILD_VERSION 0) +SET(GDCM_MINOR_VERSION 3) +SET(GDCM_BUILD_VERSION 1) SET(GDCM_VERSION "${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}") @@ -24,8 +25,7 @@ MARK_AS_ADVANCED(GDCM_LEGACY_REMOVE GDCM_LEGACY_SILENT) #----------------------------------------------------------------------------- # Build shared lib by default -OPTION(GDCM_BUILD_SHARED_LIBS "Build GDCM with shared libraries." ON) -SET(BUILD_SHARED_LIBS ${GDCM_BUILD_SHARED_LIBS}) +OPTION(BUILD_SHARED_LIBS "Build GDCM with shared libraries." ON) OPTION(GDCM_DEBUG "Turn verbosity of some statement ON." OFF) MARK_AS_ADVANCED(GDCM_DEBUG) @@ -53,16 +53,14 @@ SET(GDCM_INCLUDE_DIRS ) SET(GDCM_LIBRARY_DIRS ${LIBRARY_OUTPUT_PATH}) SET(GDCM_LIBRARY_DEPENDS_FILE ${GDCM_BINARY_DIR}/GDCMLibraryDepends.cmake) -CONFIGURE_FILE(${GDCM_SOURCE_DIR}/GDCMConfig.cmake.in - ${GDCM_BINARY_DIR}/GDCMConfig.cmake @ONLY IMMEDIATE) # For installed GDCM: SET(GDCM_USE_FILE ${CMAKE_INSTALL_PREFIX}/lib/GDCM-${GDCM_VERSION}/GDCMUse.cmake) SET(GDCM_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include/GDCM-${GDCM_VERSION}) -SET(GDCM_LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/lib/ExodusII-${GDCM_VERSION}) +SET(GDCM_LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/lib/GDCM-${GDCM_VERSION}) SET(GDCM_LIBRARY_DEPENDS_FILE ${CMAKE_INSTALL_PREFIX}/lib/GDCM-${GDCM_VERSION}/GDCMLibraryDepends.cmake) CONFIGURE_FILE(${GDCM_SOURCE_DIR}/GDCMConfig.cmake.in - ${GDCM_BINARY_DIR}/Utilities/GDCMConfig.cmake @ONLY IMMEDIATE) + ${GDCM_BINARY_DIR}/GDCMConfig.cmake @ONLY IMMEDIATE) #----------------------------------------------------------------------------- # Test if compiler defines the pseudo-macro __FUNCTION__ @@ -89,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( @@ -134,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) @@ -160,7 +181,7 @@ IF(UNIX) #Avoid polluting Win32 cmakecache ENDIF(UNIX) #----------------------------------------------------------------------------- -# Test if os defines a lenght for sockaddr +# Test if os defines a length for sockaddr # only doing the test when we have sys/socket IF( ${CMAKE_HAVE_SYS_SOCKET_H} ) IF("HAVE_SA_LEN" MATCHES "^HAVE_SA_LEN$") @@ -168,7 +189,7 @@ IF( ${CMAKE_HAVE_SYS_SOCKET_H} ) FILE(WRITE ${GDCM_BINARY_DIR}/CMakeTmp/gdcmTestHAVESALEN.c "${POUND}include \n" "${POUND}include \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} @@ -199,7 +220,8 @@ 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) #----------------------------------------------------------------------------- # Add the testing directories