From 315179c719ff305aa84dadf48e93dc81d8ae7866 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Thu, 1 Jul 2010 17:41:44 +0000 Subject: [PATCH] fix compilation with freeimage --- CMakeLists.txt | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac44fa67..96664b67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,11 @@ # For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like # e.g.: # SET(OPENJPEG_NAMESPACE "GDCMOPENJPEG") -CMAKE_MINIMUM_REQUIRED(VERSION 2.4) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +IF(COMMAND CMAKE_POLICY) + CMAKE_POLICY(SET CMP0003 NEW) +ENDIF(COMMAND CMAKE_POLICY) IF(NOT OPENJPEG_NAMESPACE) SET(OPENJPEG_NAMESPACE "OPENJPEG") @@ -16,10 +20,6 @@ ENDIF(NOT OPENJPEG_NAMESPACE) # In all cases: STRING(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME) -IF(COMMAND CMAKE_POLICY) - CMAKE_POLICY(SET CMP0003 NEW) -ENDIF(COMMAND CMAKE_POLICY) - PROJECT(${OPENJPEG_NAMESPACE} C) # Do full dependency headers. @@ -127,9 +127,6 @@ SUBDIRS( # mj2 #j2kviewer/src ) -IF(BUILD_EXAMPLES) - SUBDIRS(codec) -ENDIF(BUILD_EXAMPLES) #IF(NOT UNIX) #SUBDIRS( @@ -139,6 +136,12 @@ ENDIF(BUILD_EXAMPLES) # ) #ENDIF(NOT UNIX) +#----------------------------------------------------------------------------- +# Build example only if requested +IF(BUILD_EXAMPLES) + SUBDIRS(codec) +ENDIF(BUILD_EXAMPLES) + #----------------------------------------------------------------------------- # For the documentation OPTION(BUILD_DOCUMENTATION "Build the doxygen documentation" OFF) @@ -157,6 +160,7 @@ ENDIF(BUILD_TESTING) IF(BUILD_TESTING) SET(CMAKE_MODULE_PATH "${OPENJPEG_SOURCE_DIR}/CMake") FIND_PACKAGE(FreeImage REQUIRED) +INCLUDE_DIRECTORIES( ${FREEIMAGE_INCLUDE_PATH} ) SUBDIRS( test_V2_tile_handling @@ -166,8 +170,8 @@ ENDIF(BUILD_TESTING) # Adding test with dataset from: # http://www.crc.ricoh.com/~gormish/jpeg2000conformance/ +# -> wget http://www.crc.ricoh.com/~gormish/jpeg2000conformance/j2kp4files_v1_5.zip # http://www.jpeg.org/jpeg2000guide/testimages/testimages.html - #----------------------------------------------------------------------------- # Adding JPEG2000_CONFORMANCE_DATA_ROOT FIND_PATH(JPEG2000_CONFORMANCE_DATA_ROOT testimages.html