From 4497b6ac84016c72d408dfef8e6ee1088c0a226b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 29 Dec 2014 14:48:21 +0500 Subject: Cycles: Synchronize changes with standalone repository This changes were done in original commit of the standalone Cycles repository and needed here for easier patch synchronization. --- intern/cycles/cmake/external_libs.cmake | 67 +++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'intern/cycles/cmake') diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index 4f02b93f04a..f92b51a9a38 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -16,6 +16,11 @@ endif() ########################################################################### # GLEW +# Workaround for unconventional variable name use in Blender. +if(NOT CYCLES_STANDALONE_REPOSITORY) + set(GLEW_INCLUDE_DIR "${GLEW_INCLUDE_PATH}") +endif() + if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) set(CYCLES_APP_GLEW_LIBRARY ${BLENDER_GLEW_LIBRARIES}) endif() @@ -32,3 +37,65 @@ if(WITH_CYCLES_CUDA_BINARIES) set(WITH_CYCLES_CUDA_BINARIES OFF) endif() endif() + +# Packages which are being found by Blender when building from inside Blender +# source code. but which we need to take care of when building Cycles from a +# standalone repository +if(CYCLES_STANDALONE_REPOSITORY) + if(APPLE OR WIN32) + include(precompiled_libs) + endif() + + #### + # OpenGL + + # TODO(sergey): We currently re-use the same variable name as we use + # in Blender. Ideally we need to make it CYCLES_GL_LIBRARIES. + find_package(OpenGL REQUIRED) + find_package(GLEW REQUIRED) + list(APPEND BLENDER_GL_LIBRARIES + "${OPENGL_gl_LIBRARY}" + "${OPENGL_glu_LIBRARY}" + "${GLEW_LIBRARY}" + ) + + #### + # OpenImageIO + find_package(OpenImageIO REQUIRED) + + # OIIO usually depends on OpenEXR, so find this library + # but don't make it required. + find_package(OpenEXR) + + #### + # Boost + set(__boost_packages filesystem regex system thread date_time) + if(WITH_CYCLES_NETWORK) + list(APPEND __boost_packages serialization) + endif() + if(WITH_CYCLES_OSL AND APPLE) + list(APPEND __boost_packages wave) + endif() + find_package(Boost 1.48 COMPONENTS ${__boost_packages} REQUIRED) + if(NOT Boost_FOUND) + # Try to find non-multithreaded if -mt not found, this flag + # doesn't matter for us, it has nothing to do with thread + # safety, but keep it to not disturb build setups. + set(Boost_USE_MULTITHREADED OFF) + find_package(Boost 1.48 COMPONENTS ${__boost_packages}) + endif() + unset(__boost_packages) + set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS}) + set(BOOST_LIBRARIES ${Boost_LIBRARIES}) + set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS}) + set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB") + + #### + # OpenShadingLanguage + if(WITH_CYCLES_OSL) + find_package(OpenShadingLanguage REQUIRED) + find_package(LLVM REQUIRED) + endif() + + unset(_lib_DIR) +endif() -- cgit v1.2.3