2014-11-16 13:01:10 +00:00
|
|
|
###########################################################################
|
|
|
|
# Precompiled libraries tips and hints, for find_package().
|
|
|
|
|
|
|
|
if(CYCLES_STANDALONE_REPOSITORY)
|
|
|
|
if(APPLE OR WIN32)
|
|
|
|
include(precompiled_libs)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
###########################################################################
|
|
|
|
# GLUT
|
|
|
|
|
2013-08-30 17:34:27 +00:00
|
|
|
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
|
2011-08-16 16:15:34 +00:00
|
|
|
set(GLUT_ROOT_PATH ${CYCLES_GLUT})
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
find_package(GLUT)
|
|
|
|
message(STATUS "GLUT_FOUND=${GLUT_FOUND}")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2014-06-28 17:59:54 +00:00
|
|
|
include_directories(
|
|
|
|
SYSTEM
|
|
|
|
${GLUT_INCLUDE_DIR}
|
|
|
|
)
|
2011-08-16 16:15:34 +00:00
|
|
|
endif()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2014-10-07 20:46:19 +00:00
|
|
|
###########################################################################
|
|
|
|
# GLEW
|
|
|
|
|
2014-12-29 09:48:21 +00:00
|
|
|
# Workaround for unconventional variable name use in Blender.
|
|
|
|
if(NOT CYCLES_STANDALONE_REPOSITORY)
|
|
|
|
set(GLEW_INCLUDE_DIR "${GLEW_INCLUDE_PATH}")
|
|
|
|
endif()
|
|
|
|
|
2014-10-07 20:46:19 +00:00
|
|
|
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
|
|
|
|
set(CYCLES_APP_GLEW_LIBRARY ${BLENDER_GLEW_LIBRARIES})
|
2011-08-16 16:15:34 +00:00
|
|
|
endif()
|
2011-05-27 12:13:10 +00:00
|
|
|
|
2011-11-10 12:52:17 +00:00
|
|
|
###########################################################################
|
|
|
|
# CUDA
|
|
|
|
|
2016-01-14 07:48:14 +00:00
|
|
|
if(WITH_CYCLES_CUDA_BINARIES OR NOT WITH_CUDA_DYNLOAD)
|
2011-11-10 12:52:17 +00:00
|
|
|
find_package(CUDA) # Try to auto locate CUDA toolkit
|
|
|
|
if(CUDA_FOUND)
|
|
|
|
message(STATUS "CUDA nvcc = ${CUDA_NVCC_EXECUTABLE}")
|
|
|
|
else()
|
|
|
|
message(STATUS "CUDA compiler not found, disabling WITH_CYCLES_CUDA_BINARIES")
|
|
|
|
set(WITH_CYCLES_CUDA_BINARIES OFF)
|
2016-02-11 12:51:47 +00:00
|
|
|
if(NOT WITH_CUDA_DYNLOAD)
|
|
|
|
message(STATUS "Additionally falling back to dynamic CUDA load")
|
|
|
|
set(WITH_CUDA_DYNLOAD ON)
|
|
|
|
endif()
|
2011-11-10 12:52:17 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2014-12-29 09:48:21 +00:00
|
|
|
|
|
|
|
# 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)
|
2014-11-15 15:45:43 +00:00
|
|
|
# PThreads
|
2014-11-16 13:01:10 +00:00
|
|
|
# TODO(sergey): Bloody exception, handled in precompiled_libs.cmake.
|
|
|
|
if(NOT WIN32)
|
|
|
|
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
endif()
|
2014-11-15 15:45:43 +00:00
|
|
|
|
2014-12-29 09:48:21 +00:00
|
|
|
####
|
|
|
|
# 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)
|
2014-11-15 17:56:22 +00:00
|
|
|
if(OPENIMAGEIO_PUGIXML_FOUND)
|
|
|
|
set(PUGIXML_INCLUDE_DIR "${OPENIMAGEIO_INCLUDE_DIR/OpenImageIO}")
|
|
|
|
set(PUGIXML_LIBRARIES "")
|
|
|
|
else()
|
|
|
|
find_package(PugiXML REQUIRED)
|
|
|
|
endif()
|
2014-12-29 09:48:21 +00:00
|
|
|
|
|
|
|
# OIIO usually depends on OpenEXR, so find this library
|
|
|
|
# but don't make it required.
|
|
|
|
find_package(OpenEXR)
|
|
|
|
|
2015-09-05 12:33:59 +00:00
|
|
|
####
|
|
|
|
# OpenShadingLanguage
|
|
|
|
if(WITH_CYCLES_OSL)
|
|
|
|
find_package(OpenShadingLanguage REQUIRED)
|
|
|
|
find_package(LLVM REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
2014-12-29 09:48:21 +00:00
|
|
|
####
|
|
|
|
# Boost
|
|
|
|
set(__boost_packages filesystem regex system thread date_time)
|
|
|
|
if(WITH_CYCLES_NETWORK)
|
2014-11-15 17:56:22 +00:00
|
|
|
list(APPEND __boost_packages serialization)
|
2014-12-29 09:48:21 +00:00
|
|
|
endif()
|
2014-11-16 13:01:10 +00:00
|
|
|
if(WITH_CYCLES_OSL)
|
2014-11-15 17:56:22 +00:00
|
|
|
# TODO(sergey): This is because of the way how our precompiled
|
|
|
|
# libraries works, could be different for someone's else libs..
|
2014-11-16 13:01:10 +00:00
|
|
|
if(APPLE OR MSVC)
|
|
|
|
list(APPEND __boost_packages wave)
|
2015-09-05 12:33:59 +00:00
|
|
|
elseif(NOT (${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6"))
|
|
|
|
list(APPEND __boost_packages wave)
|
2014-11-16 13:01:10 +00:00
|
|
|
endif()
|
2014-12-29 09:48:21 +00:00
|
|
|
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")
|
|
|
|
|
2014-11-15 20:12:19 +00:00
|
|
|
####
|
|
|
|
# Logging
|
|
|
|
if(WITH_CYCLES_LOGGING)
|
|
|
|
find_package(Glog REQUIRED)
|
|
|
|
find_package(Gflags REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
2014-12-29 09:48:21 +00:00
|
|
|
unset(_lib_DIR)
|
2014-11-15 20:12:19 +00:00
|
|
|
else()
|
|
|
|
if(WIN32)
|
2016-01-04 11:47:36 +00:00
|
|
|
set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src/windows)
|
|
|
|
set(GFLAGS_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/gflags/src)
|
2014-11-15 20:12:19 +00:00
|
|
|
else()
|
2016-01-04 11:47:36 +00:00
|
|
|
set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src)
|
|
|
|
set(GFLAGS_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/gflags/src)
|
2014-11-15 20:12:19 +00:00
|
|
|
endif()
|
2014-12-31 20:01:31 +00:00
|
|
|
set(GFLAGS_NAMESPACE "gflags")
|
|
|
|
set(LLVM_LIBRARIES ${LLVM_LIBRARY})
|
2014-12-29 09:48:21 +00:00
|
|
|
endif()
|