[trunk] WIP: remove previous commit about memory leak with ppm read function
[openjpeg.git] / CMakeLists.txt
index 513e9cdd1bd4bb091125dfd6baa79fe9db210ba4..47ebfdcd19886a7555275cb56210b529345594d1 100644 (file)
@@ -28,7 +28,7 @@ INCLUDE_REGULAR_EXPRESSION("^.*$")
 #-----------------------------------------------------------------------------
 # OPENJPEG version number, useful for packaging and doxygen doc:
 SET(OPENJPEG_VERSION_MAJOR 1)
-SET(OPENJPEG_VERSION_MINOR 4)
+SET(OPENJPEG_VERSION_MINOR 99)
 SET(OPENJPEG_VERSION_BUILD 0)
 SET(OPENJPEG_VERSION
   "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
@@ -39,12 +39,13 @@ SET(OPENJPEG_LIBRARY_PROPERTIES
   SOVERSION "${OPENJPEG_VERSION_MAJOR}"
 )
 
-
+# --------------------------------------------------------------------------
 # Path to additional CMake modules
 SET(CMAKE_MODULE_PATH
     ${CMAKE_SOURCE_DIR}/CMake
     ${CMAKE_MODULE_PATH})
 
+# --------------------------------------------------------------------------
 # On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
 # warnings
 IF(WIN32)
@@ -108,12 +109,9 @@ ENDIF(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
 
 #-----------------------------------------------------------------------------
 # Test for some required system information.
+# For example this macro test the endianness (CMAKE_WORDS_BIGENDIAN)
 INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityC.cmake)
 
-#-----------------------------------------------------------------------------
-# Test for getopt being available in this system
-INCLUDE (${OPENJPEG_SOURCE_DIR}/CMake/CheckHaveGetopt.cmake )
-
 #-----------------------------------------------------------------------------
 # Setup file for setting custom ctest vars
 CONFIGURE_FILE(
@@ -222,7 +220,7 @@ ENDIF (BUILD_CODEC OR BUILD_MJ2 OR BUILD_JPIP)
 
 #-----------------------------------------------------------------------------
 # opj_config.h generation (2/2)
-CONFIGURE_FILE("${OPENJPEG_SOURCE_DIR}/opj_configh.cmake.in"
+CONFIGURE_FILE("${OPENJPEG_SOURCE_DIR}/opj_config.h.cmake.in"
  "${OPENJPEG_BINARY_DIR}/opj_config.h"
  @ONLY
  )
@@ -233,7 +231,10 @@ OPTION(BUILD_JPWL "Build the JPWL library and executables" OFF)
 
 #-----------------------------------------------------------------------------
 # Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
-ADD_SUBDIRECTORY(doc)
+OPTION(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
+IF(BUILD_DOC)
+    ADD_SUBDIRECTORY(doc)
+ENDIF(BUILD_DOC)
 
 #-----------------------------------------------------------------------------
 # Buld Testing
@@ -243,18 +244,19 @@ IF(BUILD_TESTING)
     ENABLE_TESTING()
     INCLUDE(CTest)
   
-    # Add repository where to find tests
-    ADD_SUBDIRECTORY(tests)
-  
     # Search openjpeg data needed for the tests
     # They could be found via svn on the OpenJPEG google code project
     # svn checkout http://openjpeg.googlecode.com/svn/data (about 70 Mo) 
     FIND_PATH(OPJ_DATA_ROOT README-OPJ-Data 
               PATHS $ENV{OPJ_DATA_ROOT} ${CMAKE_SOURCE_DIR}/../data)
-              
-    SET (REF_DECODER_BIN_PATH "NOT-FOUND" CACHE PATH "Single directory where find the reference encoder binaries to enable encoding test suite.")
+  
+    # For encoding tests we need the path to the ref decoder exe/lib (kakadu)           
+    SET (REF_DECODER_BIN_PATH "NOTFOUND" CACHE PATH "Single directory where find the reference decoder binaries to enable encoding test suite.")
     MARK_AS_ADVANCED(REF_DECODER_BIN_PATH)
-          
+    
+    # Add repository where to find tests
+    ADD_SUBDIRECTORY(tests)
+    
   ELSE(BUILD_CODEC)
     message(FATAL_ERROR "You need build codec to run the tests")
   ENDIF(BUILD_CODEC)