patch from IRIE Shinsuke, use systems openjpeg on *nix.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 15 Feb 2011 19:04:51 +0000 (19:04 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 15 Feb 2011 19:04:51 +0000 (19:04 +0000)
CMakeLists.txt
build_files/cmake/RpmBuild.cmake
build_files/cmake/macros.cmake
extern/CMakeLists.txt

index 349bbe23ac0a6d7aa341efd2d564d69edc4f4683..7d60bb70ab5e3a561aacf1cab102d61f080e8879 100644 (file)
@@ -933,8 +933,15 @@ if(WITH_RAYOPTIMIZATION)
 endif()
 
 if(WITH_IMAGE_OPENJPEG)
 endif()
 
 if(WITH_IMAGE_OPENJPEG)
-       set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
-       set(OPENJPEG_INC ${OPENJPEG})
+       if(UNIX AND NOT APPLE)
+               set(OPENJPEG /usr)
+               set(OPENJPEG_INC ${OPENJPEG}/include)
+               set(OPENJPEG_LIB openjpeg)
+               set(OPENJPEG_LIBPATH ${OPENJPEG}/lib)
+       else()
+               set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
+               set(OPENJPEG_INC ${OPENJPEG})
+       endif()
 endif()
 
 if(WITH_IMAGE_REDCODE)
 endif()
 
 if(WITH_IMAGE_REDCODE)
index 19943fd14cbe5526156d5e521f45131cc3d168c3..90f69d9b3346f8db52f0651c39426d88d28e8b46 100644 (file)
@@ -15,20 +15,3 @@ else ( RPMBUILD )
     message(STATUS "rpmbuild NOT found. RPM generation will not be available")
     set(RPMBUILD_FOUND "NO")
 endif ( RPMBUILD )
     message(STATUS "rpmbuild NOT found. RPM generation will not be available")
     set(RPMBUILD_FOUND "NO")
 endif ( RPMBUILD )
-#
-# VLMC RPM Finder
-# Authors: Rohit Yadav <rohityadav89@gmail.com>
-#
-
-find_program(RPMBUILD
-    NAMES rpmbuild
-    PATHS "/usr/bin")
-
-if ( RPMBUILD )
-    get_filename_component(RPMBUILD_PATH ${RPMBUILD} ABSOLUTE)
-    message(STATUS "Found rpmbuild : ${RPMBUILD_PATH}")
-    set(RPMBUILD_FOUND "YES")
-else ( RPMBUILD ) 
-    message(STATUS "rpmbuild NOT found. RPM generation will not be available")
-    set(RPMBUILD_FOUND "NO")
-endif ( RPMBUILD )
index b700fdf2cfa95494c58b934a92d33e80b57838c0..6fd9fda152bf65b07a1c14de4afd988f63d8a737 100644 (file)
@@ -85,6 +85,9 @@ macro(SETUP_LIBDIRS)
        if(WITH_IMAGE_TIFF)
                link_directories(${TIFF_LIBPATH})
        endif()
        if(WITH_IMAGE_TIFF)
                link_directories(${TIFF_LIBPATH})
        endif()
+       if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
+               link_directories(${OPENJPEG_LIBPATH})
+       endif()
        if(WITH_LCMS)
                link_directories(${LCMS_LIBPATH})
        endif()
        if(WITH_LCMS)
                link_directories(${LCMS_LIBPATH})
        endif()
@@ -180,6 +183,9 @@ macro(setup_liblinks
                        target_link_libraries(${target} ${OPENEXR_LIB})
                endif()
        endif()
                        target_link_libraries(${target} ${OPENEXR_LIB})
                endif()
        endif()
+       if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
+               target_link_libraries(${target} ${OPENJPEG_LIB})
+       endif()
        if(WITH_LCMS)
                target_link_libraries(${target} ${LCMS_LIBRARY})
        endif()
        if(WITH_LCMS)
                target_link_libraries(${target} ${LCMS_LIBRARY})
        endif()
index cdbfa3e0dff841ebd65d38fedad7bb6a1c190424..52b804b7bfc3c5a853d70faef28b62c36d42ae9a 100644 (file)
@@ -37,7 +37,7 @@ endif()
 
 add_subdirectory(glew)
 
 
 add_subdirectory(glew)
 
-if(WITH_IMAGE_OPENJPEG)
+if(WITH_IMAGE_OPENJPEG AND (NOT UNIX OR APPLE))
        add_subdirectory(libopenjpeg)
 endif()
 
        add_subdirectory(libopenjpeg)
 endif()