Addes jpeg2000 support to cmake.
authorKent Mein <mein@cs.umn.edu>
Fri, 6 Mar 2009 15:46:13 +0000 (15:46 +0000)
committerKent Mein <mein@cs.umn.edu>
Fri, 6 Mar 2009 15:46:13 +0000 (15:46 +0000)
I also did some small tweaks.  removed ifdef's for pluginapi
didn't need them there.
Fixed it so the filesel shows jp2 as image files.
(I'm going to do makefiles next)

Kent

CMakeLists.txt
blenderplayer/CMakeLists.txt
extern/CMakeLists.txt
extern/libopenjpeg/CMakeLists.txt [new file with mode: 0644]
source/blender/blenkernel/CMakeLists.txt
source/blender/blenpluginapi/iff.h
source/blender/imbuf/CMakeLists.txt
source/blender/src/CMakeLists.txt
source/blender/src/filesel.c
source/creator/CMakeLists.txt

index 4b96ca585a6ea49a30d152d03149e1c1412ff70b..0b7f3999e8264fb9546411c0f6b36490f881b4ba 100644 (file)
@@ -63,7 +63,7 @@ OPTION(WITH_QUICKTIME         "Enable Quicktime Support"                              OFF)
 OPTION(WITH_OPENEXR            "Enable OpenEXR Support (http://www.openexr.com)"       ON)
 OPTION(WITH_DDS                        "Enable DDS Support"                                    ON)
 OPTION(WITH_FFMPEG             "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
-OPTION(WITH_FFMPEG             "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
+OPTION(WITH_OPENJPEG           "Enable OpenJpeg Support (http://www.openjpeg.org/)"    OFF)
 OPTION(WITH_OPENAL             "Enable OpenAL Support (http://www.openal.org)"         ON)
 OPTION(WITH_OPENMP             "Enable OpenMP (has to be supported by the compiler)"   OFF)
 OPTION(WITH_WEBPLUGIN          "Enable Web Plugin (Unix only)"                         OFF)
@@ -431,6 +431,9 @@ SET(FTGL ${CMAKE_SOURCE_DIR}/extern/bFTGL)
 SET(FTGL_INC ${FTGL}/include)
 SET(FTGL_LIB extern_ftgl)
 
+set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
+set(OPENJPEG_INC ${OPENJPEG})
+set(OPENJPEG_LIb extern_libopenjpeg)
 
 #-----------------------------------------------------------------------------
 # Blender WebPlugin
index f02650f7ea01cc608bc158ce04698c285774bd7b..b9ac3c7a8c69b67e6f5beea926653e9ebd4f933d 100644 (file)
@@ -104,6 +104,7 @@ IF(UNIX)
     bf_blenlib 
     bf_cineon 
     bf_openexr 
+    extern_libopenjpeg 
     bf_dds
     bf_ftfont 
     extern_ftgl 
index ee5cab31e092c81012a283c78f879276bfbe34a7..b81efb52de901d06ee2b68f92e96940e6f1c79f5 100644 (file)
@@ -29,7 +29,7 @@ IF(WITH_GAMEENGINE)
 ENDIF(WITH_GAMEENGINE)
 
 IF(WITH_BULLET)
-    SUBDIRS(bullet2)
+  SUBDIRS(bullet2)
 ENDIF(WITH_BULLET)
 
 IF(WITH_INTERNATIONAL)
@@ -46,3 +46,6 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
 
 SUBDIRS(glew)
 
+IF(WITH_OPENJPEG)
+  SUBDIRS(libopenjpeg)
+ENDIF(WITH_OPENJPEG)
diff --git a/extern/libopenjpeg/CMakeLists.txt b/extern/libopenjpeg/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c179d53
--- /dev/null
@@ -0,0 +1,32 @@
+# $Id: CMakeLists.txt 14444 2008-04-16 22:40:48Z hos $
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurain.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+SET(INC . src ${FREETYPE_INC})
+
+FILE(GLOB SRC *.c except t1_generate_luts.c)
+ADD_DEFINITIONS(-DWITH_OPENJPEG)
+BLENDERLIB(extern_libopenjpeg "${SRC}" "${INC}")
+#, libtype=['international','player'], priority=[5, 210])
index 04ca5c79a113d7eaf815c0139b9829f733b6d52c..27be1b45779a73b2e8f44d5fa43bc3a5c54e7f9a 100644 (file)
@@ -47,6 +47,10 @@ IF(WITH_OPENEXR)
   ADD_DEFINITIONS(-DWITH_OPENEXR)
 ENDIF(WITH_OPENEXR)
 
+IF(WITH_OPENJPEG)
+  ADD_DEFINITIONS(-DWITH_OPENJPEG)
+ENDIF(WITH_OPENJPEG)
+
 IF(WITH_DDS)
   ADD_DEFINITIONS(-DWITH_DDS)
 ENDIF(WITH_DDS)
index e7f328d870f8084f97b8d99417fffb85522f7e64..9378cdc9134ae60af96e927fb1e5b2b1e306589f 100644 (file)
@@ -45,6 +45,8 @@
 #define IB_zbuf                        (1 << 13)
 #define IB_rgba                        (1 << 14)
 
+#define JP2             (1 << 18)
+
 #define AMI             (1 << 31)
 #define PNG             (1 << 30)
 #define Anim            (1 << 29)
 #endif
 #define RADHDR  (1<<24)
 
-#ifdef WITH_OPENJPEG
-#define JP2                            (1 << 18)
-#endif
-
 #define RAWTGA (TGA | 1)
 
 #define JPG_STD        (JPG | (0 << 8))
index 2d41a6d73e68b5cbffd103c122506266715ce233..9894aa8136e9c27a1a1fc54b037c8ce01c71b067 100644 (file)
@@ -33,6 +33,7 @@ SET(INC
   ${PNG_INC}
   ${TIFF_INC}
   ${ZLIB_INC}
+  ${OPENJPEG_INC}
 )
 
 IF(WITH_VERSE)
@@ -44,6 +45,10 @@ IF(WITH_OPENEXR)
   ADD_DEFINITIONS(-DWITH_OPENEXR)
 ENDIF(WITH_OPENEXR)
 
+IF(WITH_OPENJPEG)
+  ADD_DEFINITIONS(-DWITH_OPENJPEG)
+ENDIF(WITH_OPENJPEG)
+
 IF(WITH_QUICKTIME)
   SET(INC ${INC} ${QUICKTIME_INC})
   ADD_DEFINITIONS(-DWITH_QUICKTIME)
index e2757dbc75d266f9f2650c40e500c2e8acc99aa5..dc2928cd17bb90efb99c07e45eb04d38a4daa369 100644 (file)
@@ -50,6 +50,10 @@ IF(WITH_OPENEXR)
   ADD_DEFINITIONS(-DWITH_OPENEXR)
 ENDIF(WITH_OPENEXR)
 
+IF(WITH_OPENJPEG)
+  ADD_DEFINITIONS(-DWITH_OPENJPEG)
+ENDIF(WITH_OPENJPEG)
+
 IF(WITH_QUICKTIME)
   SET(INC ${INC} ${QUICKTIME_INC})
   ADD_DEFINITIONS(-DWITH_QUICKTIME)
index ee1fc5233955d2c11eebeb7813dbdc26b89238f1..9800c80b57d15637f63e04386481ef3b6634b6b9 100644 (file)
@@ -380,6 +380,9 @@ void test_flags_file(SpaceFile *sfile)
                        } else if (G.have_quicktime){
                                if(             BLI_testextensie(file->relname, ".jpg")
                                        ||      BLI_testextensie(file->relname, ".jpeg")
+#ifdef WITH_OPENJPEG
+                                       ||      BLI_testextensie(file->relname, ".jp2")
+#endif
                                        ||      BLI_testextensie(file->relname, ".hdr")
                                        ||      BLI_testextensie(file->relname, ".exr")
                                        ||      BLI_testextensie(file->relname, ".tga")
@@ -414,6 +417,9 @@ void test_flags_file(SpaceFile *sfile)
                                }
                        } else { // no quicktime
                                if(BLI_testextensie(file->relname, ".jpg")
+#ifdef WITH_OPENJPEG
+                                       ||      BLI_testextensie(file->relname, ".jp2")
+#endif
                                   ||   BLI_testextensie(file->relname, ".hdr")
                                   ||   BLI_testextensie(file->relname, ".exr")
                                        ||      BLI_testextensie(file->relname, ".tga")
index ee6f19e457d00690b36c0c93664fbe2c802180b2..8e2a906614d4ab6eca3c5c42c2c5d61475a81917 100644 (file)
@@ -267,6 +267,7 @@ IF(UNIX)
     bf_quicktime
     extern_binreloc
     extern_glew
+    extern_libopenjpeg
     bf_videotex
   )