X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=130073046e856d8648e31f97e98bf20131d07ad1;hb=HEAD;hp=cdccd4aa9e73dc06b94c60710267cff9c083351f;hpb=b5f3df815c0d7b76369c3371f71afb8e5bd37ee5;p=gdcm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index cdccd4aa..13007304 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,30 @@ +# --------------------------------- +# +# Unless you are an experimented cmake user, +# have a look at : +# http://www.creatis.insa-lyon.fr/site/fr/CreatoolsGettingStarted-v2.0.X +# before starting. +# +# --------------------------------- + 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) + + if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) + endif(COMMAND cmake_policy) + + + #----------------------------------------------------------------------------- # GDCM version number, usefull for packaging and doxygen doc: SET(GDCM_MAJOR_VERSION 1) SET(GDCM_MINOR_VERSION 3) SET(GDCM_BUILD_VERSION 2) -SET(GDCM_VERSION +SET(GDCM_VERSION "${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}") #----------------------------------------------------------------------------- @@ -23,7 +39,6 @@ IF(CMAKE_COMPILER_2005) ADD_DEFINITIONS(-D_SCL_SECURE_NO_DEPRECATE) ENDIF(CMAKE_COMPILER_2005) - #----------------------------------------------------------------------------- # Build shared lib by default OPTION(BUILD_SHARED_LIBS "Build GDCM with shared libraries." ON) @@ -268,10 +283,11 @@ OPTION(BUILD_TESTING "Build testing." ON) IF(BUILD_TESTING) CONFIGURE_FILE(${GDCM_SOURCE_DIR}/CMake/CTestCustom.ctest.in - ${GDCM_BINARY_DIR}/CTestCustom.ctest @ONLY) + ${GDCM_BINARY_DIR}/CMake/CTestCustom.ctest @ONLY) + FILE(WRITE ${GDCM_BINARY_DIR}/CTestCustom.cmake + "INCLUDE(\"${GDCM_BINARY_DIR}/CMake/CTestCustom.ctest\")\n") ENABLE_TESTING() - INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake) - MARK_AS_ADVANCED(DART_ROOT) + INCLUDE(CTest) SUBDIRS(Testing) ENDIF(BUILD_TESTING) @@ -285,6 +301,8 @@ IF(GDCM_VTK) IF(VTK_FOUND) #INCLUDE(${VTK_USE_FILE}) SUBDIRS(vtk) + ELSEIF(VTK_FOUND) + message(FATAL_ERROR "VTK not found") ENDIF(VTK_FOUND) ENDIF(GDCM_VTK)