Cycles: OS X build system changes to use lib/ openimageio and boost.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 30 Jun 2011 14:47:57 +0000 (14:47 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 30 Jun 2011 14:47:57 +0000 (14:47 +0000)
intern/cycles/CMakeLists.txt
intern/cycles/blender/CMakeLists.txt
intern/cycles/cmake/external_libs.cmake

index 38be2f62ec4f17e0662cb1705ba0faddfea8cf7b..8f8b431ada591da8412e4517819717dea24e093b 100644 (file)
@@ -22,9 +22,12 @@ SET(CYCLES_CUDA_MAXREG 24 CACHE STRING "CUDA maximum number of register to use")
 
 # Paths
 
+IF(UNIX AND NOT APPLE)
+       SET(CYCLES_OIIO "" CACHE PATH "Path to OpenImageIO installation")
+       SET(CYCLES_BOOST "/usr" CACHE PATH "Path to Boost installation")
+ENDIF()
+
 SET(CYCLES_OSL "" CACHE PATH "Path to OpenShadingLanguage installation")
-SET(CYCLES_OIIO "" CACHE PATH "Path to OpenImageIO installation")
-SET(CYCLES_BOOST "/usr" CACHE PATH "Path to Boost installation")
 SET(CYCLES_CUDA "/usr/local/cuda" CACHE PATH "Path to CUDA installation")
 SET(CYCLES_OPENCL "" CACHE PATH "Path to OpenCL installation")
 SET(CYCLES_PARTIO "" CACHE PATH "Path to Partio installation")
index 013c671468e6095d40b6923c82b8e4673758698f..50cd8502720c91acd2793ea9505f25eebf04b0bf 100644 (file)
@@ -87,7 +87,7 @@ IF(WIN32)
                DESTINATION ${CYCLES_INSTALL_PATH}/cycles)
 ENDIF()
 
-IF(UNIX)
+IF(UNIX AND NOT APPLE)
        # copy libraries to cycles lib directory
        SET(install_libs
                ${OPENIMAGEIO_LIBRARY}
@@ -101,27 +101,7 @@ IF(UNIX)
        INSTALL(FILES ${install_libs}
                DESTINATION ${CYCLES_INSTALL_PATH}/cycles/lib)
        
-       IF(NOT APPLE)
-               # set path to look for dynamic libs
-               SET_TARGET_PROPERTIES(cycles_blender PROPERTIES INSTALL_RPATH $ORIGIN/lib)
-       ELSE()
-               # modify our libs to looks for dynamic libs in cycles lib directory
-               SET(install_name_command "install_name_tool")
-
-               FOREACH(lib ${install_libs})
-                       GET_FILENAME_COMPONENT(libname ${lib} NAME)
-                       SET(install_name_command " ${install_name_command} -change ${lib} @loader_path/lib/${libname}")
-                       SET(install_name_command " ${install_name_command} -change ${libname} @loader_path/lib/${libname}")
-               ENDFOREACH()
-
-               INSTALL(
-                       CODE
-                       "
-                       EXECUTE_PROCESS(COMMAND ${install_name_command} ${CYCLES_INSTALL_PATH}/cycles/libcycles_blender.so)
-                       "
-               )
-       ELSE()
-       ENDIF()
+       # set path to look for dynamic libs
+       SET_TARGET_PROPERTIES(cycles_blender PROPERTIES INSTALL_RPATH $ORIGIN/lib)
 ENDIF()
 
-
index 754ea825b31d9af8df2fc0813b0d0ba76b4125b7..6da71c8235fb4eb29cbfd4b7851a3a6f642d2dc0 100644 (file)
@@ -1,16 +1,23 @@
 ###########################################################################
-# Windows lib directory libraries
+# Windows and Darwin lib directory libraries
 
 IF(WIN32)
-       if(CMAKE_CL_64)
-               set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
-       else()
-               set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
-       endif()
+       IF(CMAKE_CL_64)
+               SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
+       ELSE()
+               SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
+       ENDIF()
+ENDIF()
 
+IF(APPLE)
+       SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
+       SET(OIIO_STATIC ON)
+ENDIF()
+
+IF(LIBDIR)
        SET(CYCLES_OIIO ${LIBDIR}/openimageio)
        SET(CYCLES_BOOST ${LIBDIR}/boost)
-       SET(Boost_USE_STATIC_LIBS ON)
+       SET(Boost_USE_STATIC_LIBS ON)
 ENDIF()
 
 ###########################################################################
@@ -65,6 +72,25 @@ ENDIF()
 ADD_DEFINITIONS(-DWITH_OIIO)
 INCLUDE_DIRECTORIES(${OPENIMAGEIO_INCLUDES} ${OPENIMAGEIO_INCLUDES}/OpenImageIO)
 
+IF(OIIO_STATIC)
+       ADD_DEFINITIONS(-DOIIO_STATIC_BUILD)
+
+       SET(OPENIMAGEIO_LIBRARY
+               ${OPENIMAGEIO_LIBRARY}
+               ${PNG_LIBRARIES}
+               ${JPEG_LIBRARIES}
+               ${TIFF_LIBRARY}
+               ${OPENEXR_LIBRARIES}
+               ${ZLIB_LIBRARIES})
+
+       LINK_DIRECTORIES(
+               ${JPEG_LIBPATH}
+               ${PNG_LIBPATH}
+               ${TIFF_LIBPATH}
+               ${OPENEXR_LIBPATH}
+               ${ZLIB_LIBPATH})
+ENDIF()
+
 ###########################################################################
 # GLUT