X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=a3ab0d5c34551ead0c67316de9d4a402a748fcb0;hb=2943fda916fe14973cda2deddad3fc7dd6fc7d19;hp=4433fd5f6c2732a7cddf18f4281ebedb8f4d5143;hpb=6ab7853638f8dc05d71f7c6ce2adb4f161d863cd;p=gdcm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 4433fd5f..a3ab0d5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,33 +20,26 @@ MARK_AS_ADVANCED(GDCM_DATA_DIR) OPTION(BUILD_SHARED_LIBS "Build GDCM with shared libraries." ON) SET(GDCM_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) -SET(CMAKE_CONFIGURATION_TYPES - Debug - Release -) -SET(CMAKE_BUILD_TYPE_INIT Debug) - -# Deals with problem on SunOS: -# ostrstream vs. ostringstream - -#SET(GDCM_NO_ANSI_STRING_STREAM -# ${CMAKE_NO_ANSI_STRING_STREAM} +#----------------------------------------------------------------------------- +# Does not work as of 2004/04/05 +#SET(CMAKE_CONFIGURATION_TYPES +# Debug +# Release #) -#CONFIGURE_FILE(${GDCM_SOURCE_DIR}/src/gdcmCommon.h.in -# ${GDCM_BINARY_DIR}/src/gdcmCommon.h @ONLY IMMEDIATE) +#SET(CMAKE_BUILD_TYPE_INIT Debug) #----------------------------------------------------------------------------- # Output directories. #Put all stuff in one single dir for Win32, otherwise dll are a pain: -IF(WIN32 AND GDCM_BUILD_SHARED_LIBS) - SET(OUTPUT_LIB_DIR ${GDCM_SOURCE_DIR}/bin) -ELSE(WIN32 AND GDCM_BUILD_SHARED_LIBS) - SET(OUTPUT_LIB_DIR ${GDCM_SOURCE_DIR}/lib) -ENDIF(WIN32 AND GDCM_BUILD_SHARED_LIBS) - -SET (EXECUTABLE_OUTPUT_PATH ${GDCM_SOURCE_DIR}/bin CACHE PATH "Single output directory for building all executables.") -SET (LIBRARY_OUTPUT_PATH ${OUTPUT_LIB_DIR} CACHE PATH "Single output directory for building all libraries.") -MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH) +#IF(WIN32 AND GDCM_BUILD_SHARED_LIBS) +# SET(OUTPUT_LIB_DIR ${GDCM_SOURCE_DIR}/bin) +#ELSE(WIN32 AND GDCM_BUILD_SHARED_LIBS) +# SET(OUTPUT_LIB_DIR ${GDCM_SOURCE_DIR}/lib) +#ENDIF(WIN32 AND GDCM_BUILD_SHARED_LIBS) + +#SET (EXECUTABLE_OUTPUT_PATH ${GDCM_SOURCE_DIR}/bin CACHE PATH "Single output directory for building all executables.") +#SET (LIBRARY_OUTPUT_PATH ${OUTPUT_LIB_DIR} CACHE PATH "Single output directory for building all libraries.") +#MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH) SET(GDCM_LIBRARY_PATH "${LIBRARY_OUTPUT_PATH}") SET(GDCM_EXECUTABLE_PATH "${EXECUTABLE_OUTPUT_PATH}") @@ -58,6 +51,59 @@ SUBDIRS( Test ) +#----------------------------------------------------------------------------- +# Adding GDCM_DATA_ROOT +FIND_PATH(GDCM_DATA_ROOT gdcm-ACR-LibIDO.acr + ${GDCM_SOURCE_DIR}/../gdcmData + $ENV{GDCM_DATA} + $ENV{PUB_DICT_PATH}/../../gdcmData +) + +#----------------------------------------------------------------------------- +# Deals with problem on SunOS: +# ostrstream vs. ostringstream + +#----------------------------------------------------------------------------- +# Why one should not use ADD_DEFINITIONS +# http://www.cmake.org/pipermail/cmake/2003-September/004286.html + +#----------------------------------------------------------------------------- +# __STDC_LIMIT_MACROS -> Refer to stdint.h +# http://www.cmake.org/pipermail/cmake/2003-October/004369.html +# http://www.cmake.org/pipermail/cmake/2003-October/004373.html + +#SET(GDCM_COMPILE_FLAGS "-D__STDC_LIMIT_MACROS -DPUB_DICT_PATH=\\\"${CMAKE_INSTALL_PREFIX}${GDCM_DATA_DIR}\\\"" ) + +SET( GDCM_PUB_DICT_PATH "${CMAKE_INSTALL_PREFIX}${GDCM_DATA_DIR}") + +# SunOS + old gcc fixes: +INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) +IF(CMAKE_NO_ANSI_STRING_STREAM) + SET(GDCM_NO_ANSI_STRING_STREAM 1) +ENDIF(CMAKE_NO_ANSI_STRING_STREAM) + +INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) +CHECK_INCLUDE_FILE("stdint.h" CMAKE_HAVE_STDINT_H) + +IF(NOT CMAKE_HAVE_STDINT_H) + SET(GDCM_HAVE_NO_STDINT_H 1) +ENDIF(NOT CMAKE_HAVE_STDINT_H) + +CONFIGURE_FILE(${GDCM_SOURCE_DIR}/gdcmConfigure.h.in + ${GDCM_BINARY_DIR}/gdcmConfigure.h @ONLY IMMEDIATE) + +INSTALL_FILES(/include .h gdcmConfigure.h) + +#----------------------------------------------------------------------------- +# Add the testing directories +OPTION(GDCM_BUILD_TESTING "Test the project" ON) +IF(GDCM_BUILD_TESTING) + ENABLE_TESTING() + INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake) + SUBDIRS(Test) +ENDIF(GDCM_BUILD_TESTING) + + #----------------------------------------------------------------------------- OPTION(GDCM_VTK "Build VTK-GDCM Lib." OFF) IF(GDCM_VTK) @@ -103,7 +149,7 @@ CONFIGURE_FILE( ${GDCM_BINARY_DIR}/gdcmConfig.cmake @ONLY IMMEDIATE ) -# Export uor build settings and library +# Export our build settings and library # dependencies for the use by the user projects. INCLUDE( ${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake) @@ -116,7 +162,7 @@ EXPORT_LIBRARY_DEPENDENCIES( ${GDCM_BINARY_DIR}/gdcmLibraryDepends.cmake ) -# Intall the âckaging files for use by FIND_PACKAGE(GDCM) in user projects. +# Intall the packaging files for use by FIND_PACKAGE(GDCM) in user projects. INSTALL_FILES(/lin/gdcm FILES ${GDCM_SOURCE_DIR}/gdcmUse.cmake ${GDCM_BINARY_DIR}/gdcmConfig.cmake @@ -124,22 +170,3 @@ INSTALL_FILES(/lin/gdcm FILES ${GDCM_BINARY_DIR}/gdcmLibraryDepends.cmake ) -#----------------------------------------------------------------------------- -# Copy / paste from old m4 script: - -# EXTRA_DIST = \ -# AUTHORS \ -# ChangeLog \ -# COPYING \ -# INSTALL \ -# NEWS \ -# README \ -# TODO \ -# gdcm.spec \ -# gdcm.dsw - -#release: -# $(MAKE) dist distdir=$(PACKAGE)-$(VERSION) - -#snapshot: -# $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`