MACOSX : Fixed the XCode project file to link with the PNG library. Library and heade...
[openjpeg.git] / CMakeLists.txt
index dc3783b8cdf7632a32727d69514959415f0cb588..bd78c87bca067b4bee613ae138bacbf046f0e673 100644 (file)
@@ -7,7 +7,6 @@
 # For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like
 # e.g.:
 # SET(OPENJPEG_NAMESPACE "GDCMOPENJPEG")
-PROJECT(OPENJPEG C)
 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
 
 IF(NOT OPENJPEG_NAMESPACE)
@@ -17,7 +16,7 @@ ENDIF(NOT OPENJPEG_NAMESPACE)
 # In all cases:
 STRING(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME)
 
-PROJECT(${JPEG_NAMESPACE} C)
+PROJECT(${OPENJPEG_NAMESPACE} C)
 
 # Do full dependency headers.
 INCLUDE_REGULAR_EXPRESSION("^.*$")
@@ -25,7 +24,7 @@ INCLUDE_REGULAR_EXPRESSION("^.*$")
 #-----------------------------------------------------------------------------
 # OPENJPEG version number, useful for packaging and doxygen doc:
 SET(OPENJPEG_VERSION_MAJOR 1)
-SET(OPENJPEG_VERSION_MINOR 2)
+SET(OPENJPEG_VERSION_MINOR 4)
 SET(OPENJPEG_VERSION_BUILD 0)
 SET(OPENJPEG_VERSION
   "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
@@ -116,3 +115,12 @@ FIND_PATH(JPEG2000_CONFORMANCE_DATA_ROOT testimages.html
   $ENV{JPEG2000_CONFORMANCE_DATA_ROOT}
 )
 
+#-----------------------------------------------------------------------------
+# Compiler specific flags:
+IF(CMAKE_COMPILER_IS_GNUCC)
+  # For all builds, make sure openjpeg is std99 compliant:
+  SET(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}")
+  # Do not use ffast-math for all build, it would produce incorrect results, only set for release:
+  SET(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}")
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+