add cmake option WITH_SYSTEM_OPENJPEG so linux can build cycles without having libope...
[blender.git] / CMakeLists.txt
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)