add cmake option WITH_SYSTEM_OPENJPEG so linux can build cycles without having libope...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 23 Jun 2012 14:23:44 +0000 (14:23 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 23 Jun 2012 14:23:44 +0000 (14:23 +0000)
CMakeLists.txt
build_files/cmake/macros.cmake
extern/CMakeLists.txt
extern/libopenjpeg/image.c

index b983a5556f6add2c9c66c4a7be58745b9e29a2a4..f3614007ef98b4fb3aae19a77d9e822ad47410d7 100644 (file)
@@ -159,7 +159,7 @@ unset(PLATFORM_DEFAULT)
 if(UNIX AND NOT APPLE)
        option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)"   ON)
        option(WITH_X11_XF86VMODE "Enable X11 video mode switching"     ON)
-       option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON)
+       option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" ON)
 
        # freebsd doesn't seems to support XDND
        if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
@@ -170,6 +170,17 @@ else()
        set(WITH_SYSTEM_GLEW OFF)
 endif()
 
+
+# (unix defaults to System OpenJPEG On)
+if(UNIX AND NOT APPLE)
+       set(PLATFORM_DEFAULT ON)
+else()
+       set(PLATFORM_DEFAULT OFF)
+endif()
+option(WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" ${PLATFORM_DEFAULT})
+unset(PLATFORM_DEFAULT)
+
+
 # Modifiers
 option(WITH_MOD_FLUID          "Enable Elbeem Modifier (Fluid Simulation)" ON)
 option(WITH_MOD_SMOKE          "Enable Smoke Modifier (Smoke Simulation)" ON)
@@ -1485,7 +1496,7 @@ endif()
 
 
 if(WITH_IMAGE_OPENJPEG)
-       if(UNIX AND NOT APPLE)
+       if(WITH_SYSTEM_OPENJPEG)
                # dealt with above
        else()
                set(OPENJPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/libopenjpeg")
@@ -1791,8 +1802,9 @@ if(FIRST_RUN)
        info_cfg_option(WITH_INSTALL_PORTABLE)
        info_cfg_option(WITH_X11_XF86VMODE)
        info_cfg_option(WITH_X11_XINPUT)
-       info_cfg_option(WITH_SYSTEM_GLEW)
        info_cfg_option(WITH_MEM_JEMALLOC)
+       info_cfg_option(WITH_SYSTEM_GLEW)
+       info_cfg_option(WITH_SYSTEM_OPENJPEG)
 
        info_cfg_text("Image Formats:")
        info_cfg_option(WITH_IMAGE_CINEON)
index 6939f21d461a6c7e0796fadf4a5ff04f807344bd..61a89b568ad3b30c50f1d6a675869cb0e023209f 100644 (file)
@@ -193,7 +193,7 @@ macro(SETUP_LIBDIRS)
        if(WITH_OPENIMAGEIO)
                link_directories(${OPENIMAGEIO_LIBPATH})
        endif()
-       if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
+       if(WITH_IMAGE_OPENJPEG AND WITH_SYSTEM_OPENJPEG)
                link_directories(${OPENJPEG_LIBPATH})
        endif()
        if(WITH_CODEC_QUICKTIME)
@@ -303,7 +303,7 @@ macro(setup_liblinks
                        target_link_libraries(${target} ${OPENEXR_LIBRARIES})
                endif()
        endif()
-       if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
+       if(WITH_IMAGE_OPENJPEG AND WITH_SYSTEM_OPENJPEG)
                target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
        endif()
        if(WITH_CODEC_FFMPEG)
index 67a899082e2b433e308711867aa05936618f27e1..b5f94c06d4c25d9eb0c14f88d85654eec22e1005 100644 (file)
@@ -48,7 +48,7 @@ if(WITH_GAMEENGINE)
        add_subdirectory(recastnavigation)
 endif()
 
-if(WITH_IMAGE_OPENJPEG AND (NOT UNIX OR APPLE))
+if(WITH_IMAGE_OPENJPEG AND (NOT WITH_SYSTEM_OPENJPEG))
        add_subdirectory(libopenjpeg)
 endif()
 
index a4d2c010a56d1ab6863c60b5e1b604f92d6b9829..7c1e7f7faa2639c65143e58156778524e2224c3e 100644 (file)
@@ -86,4 +86,3 @@ void OPJ_CALLCONV opj_image_destroy(opj_image_t *image) {
                opj_free(image);
        }
 }
-