X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=5824e07ede56d578cc67cd32110460995beb6a74;hb=6efceb0f2d025e536c69ea4345a83555a059cfa6;hp=9c3cc1366fd218331ac435c1ca6354284f53c409;hpb=8fb1011e6fca9654c69d4921642f18146c66ca7f;p=gdcm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c3cc136..5824e07e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,11 +3,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 1.8) #----------------------------------------------------------------------------- # GDCM version number, usefull for packaging and doxygen doc: -SET(GDCM_VERSION_MAJOR 0) -SET(GDCM_VERSION_MINOR 4) -SET(GDCM_VERSION_PATCH 0) -SET(GDCM_VERSION "${GDCM_VERSION_MAJOR}.${GDCM_VERSION_MINOR}") -SET(GDCM_VERSION_FULL "${GDCM_VERSION}.${GDCM_VERSION_PATCH}") +SET(GDCM_MAJOR_VERSION 0) +SET(GDCM_MINOR_VERSION 4) +SET(GDCM_BUILD_VERSION 1) +SET(GDCM_VERSION + "${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}") #----------------------------------------------------------------------------- # datadir in CMake: @@ -18,30 +18,66 @@ MARK_AS_ADVANCED(GDCM_DATA_DIR) #----------------------------------------------------------------------------- # Build shared lib by default OPTION(BUILD_SHARED_LIBS "Build GDCM with shared libraries." ON) -SET(GDCM_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) + +OPTION(GDCM_DEBUG "Turn verbosity of some statement ON." OFF) +MARK_AS_ADVANCED(GDCM_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.") +SET (EXECUTABLE_OUTPUT_PATH ${GDCM_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.") +SET (LIBRARY_OUTPUT_PATH ${GDCM_BINARY_DIR}/bin 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}") #----------------------------------------------------------------------------- # Build directory on which many applications depend SUBDIRS( src Dicts - Test ) +#----------------------------------------------------------------------------- +# Example subdir: + +OPTION(BUILD_EXAMPLES "Build GDCM examples." ON) +IF(BUILD_EXAMPLES) + SUBDIRS(Example) +ENDIF(BUILD_EXAMPLES) + +#----------------------------------------------------------------------------- +# 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 +) + +# Set the place for the public dictionary, must be set before gdcmConfigure.h +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) + +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(BUILD_TESTING "Build testing." ON) + +IF(BUILD_TESTING) + ENABLE_TESTING() + INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake) + MARK_AS_ADVANCED(DART_ROOT) + SUBDIRS(Test) +ENDIF(BUILD_TESTING) + #----------------------------------------------------------------------------- OPTION(GDCM_VTK "Build VTK-GDCM Lib." OFF) @@ -78,30 +114,3 @@ IF(GDCM_DOXYGEN) ENDIF(DOXYGEN) ENDIF(GDCM_DOXYGEN) -#----------------------------------------------------------------------------- -# Configure files with settings for use by the build. - -# to be rewritten to include only the necessary -#CONFIGURE_FILE(${GDCM_SOURCE_DIR}/UseGdcm.cmake.in -# ${GDCM_BINARY_DIR}/UseGdcm.cmake COPYONLY IMMEDIATE) - - -#----------------------------------------------------------------------------- -# 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"`