diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-06-28 17:44:47 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-06-28 17:44:47 +0400 |
commit | bdb92dab74eb46e3444949d79ab9ee8ecdc65b0f (patch) | |
tree | 6091d831da4e82f0946684fdd1af7ab484fff51a /intern/cycles/blender/CMakeLists.txt | |
parent | 27a99869aa4220b6e8fd15defca3e14c9e96f1e4 (diff) |
Cycles: for mac and unix, copy oiio/boost dynamic libraries into cycles lib
directory to avoid library path issues.
Diffstat (limited to 'intern/cycles/blender/CMakeLists.txt')
-rw-r--r-- | intern/cycles/blender/CMakeLists.txt | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index ef68431267c..9367bb6382f 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -78,11 +78,7 @@ TARGET_LINK_LIBRARIES(cycles_blender ${LIBRARIES}) INSTALL(FILES ${addonfiles} DESTINATION ${CYCLES_INSTALL_PATH}/cycles) INSTALL(TARGETS cycles_blender LIBRARY DESTINATION ${CYCLES_INSTALL_PATH}/cycles) -IF(UNIX AND NOT APPLE) - SET_TARGET_PROPERTIES(cycles_blender PROPERTIES INSTALL_RPATH $ORIGIN/lib) -ENDIF() - -# Install DLL's +# Install Dynamic Libraries IF(WIN32) FILE(GLOB OIIO_DLLS "${CYCLES_OIIO}/bin/*.dll") @@ -91,4 +87,39 @@ IF(WIN32) DESTINATION ${CYCLES_INSTALL_PATH}/cycles) ENDIF() +IF(UNIX) + # copy libraries to cycles lib directory + SET(install_libs + ${OPENIMAGEIO_LIBRARY} + ${Boost_LIBRARIES} + ${OSL_LIBRARIES} + ${PARTIO_LIBRARIES}) + + 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) + EXECUTE_PROCESS(COMMAND echo ${install_name_command} ${CYCLES_INSTALL_PATH}/cycles/libcycles_blender.so) + " + ) + ELSE() + ENDIF() +ENDIF() + |