[Bf-blender-cvs] [4497b6a] master: Cycles: Synchronize changes with standalone repository

Sergey Sharybin noreply at git.blender.org
Wed Dec 31 21:32:43 CET 2014


Commit: 4497b6ac84016c72d408dfef8e6ee1088c0a226b
Author: Sergey Sharybin
Date:   Mon Dec 29 14:48:21 2014 +0500
Branches: master
https://developer.blender.org/rB4497b6ac84016c72d408dfef8e6ee1088c0a226b

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.

===================================================================

M	CMakeLists.txt
M	intern/cycles/CMakeLists.txt
M	intern/cycles/app/CMakeLists.txt
M	intern/cycles/blender/CMakeLists.txt
M	intern/cycles/cmake/external_libs.cmake
M	intern/cycles/device/CMakeLists.txt
M	intern/cycles/render/CMakeLists.txt
M	intern/cycles/util/CMakeLists.txt

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ee277b..1267553 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1076,10 +1076,10 @@ if(UNIX AND NOT APPLE)
 		# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
 		# otherwise LLVM is missing the osl_allocate_closure_component function
 		list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -Wl,--whole-archive ${OSL_LIB_EXEC} -Wl,--no-whole-archive ${OSL_LIB_QUERY})
-		find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
+		find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
 		find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
 	
-		if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
+		if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
 			set(OSL_FOUND TRUE)
 		else()
 			message(STATUS "OSL not found")
@@ -1760,10 +1760,10 @@ elseif(WIN32)
 		find_library(OSL_LIB_COMP_DEBUG NAMES oslcomp_d PATHS ${CYCLES_OSL}/lib)
 		find_library(OSL_LIB_QUERY_DEBUG NAMES oslquery_d PATHS ${CYCLES_OSL}/lib)
 		list(APPEND OSL_LIBRARIES optimized ${OSL_LIB_COMP} optimized ${OSL_LIB_EXEC} optimized ${OSL_LIB_QUERY} debug ${OSL_LIB_EXEC_DEBUG} debug ${OSL_LIB_COMP_DEBUG} debug ${OSL_LIB_QUERY_DEBUG})
-		find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
+		find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
 		find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
 	
-		if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
+		if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
 			set(OSL_FOUND TRUE)
 		else()
 			message(STATUS "OSL not found")
@@ -2054,10 +2054,10 @@ elseif(APPLE)
 		find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
 		# WARNING! depends on correct order of OSL libs linking
 		list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
-		find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
+		find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
 		find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
 	
-		if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
+		if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
 			set(OSL_FOUND TRUE)
 		else()
 			message(STATUS "OSL not found")
@@ -2629,7 +2629,7 @@ mark_as_advanced(
 	OSL_COMPILER
 	OSL_LIB_COMP
 	OSL_LIB_QUERY
-	OSL_INCLUDES
+	OSL_INCLUDE_DIR
 )
 
 mark_as_advanced(
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index c8c71fe..0191201 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -120,7 +120,7 @@ if(WITH_CYCLES_OSL)
 	add_definitions(-DOSL_STATIC_LIBRARY)
 	include_directories(
 		SYSTEM
-		${OSL_INCLUDES}
+		${OSL_INCLUDE_DIR}
 	)
 endif()
 
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt
index c846489..3d4a72d 100644
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@ -22,7 +22,6 @@ set(LIBRARIES
 	${BOOST_LIBRARIES}
 	${OPENEXR_LIBRARIES}
 	${BLENDER_GL_LIBRARIES}
-	bf_intern_glew_mx
 	${CYCLES_APP_GLEW_LIBRARY}
 	${OPENIMAGEIO_LIBRARIES}
 	${PNG_LIBRARIES}
@@ -33,20 +32,30 @@ set(LIBRARIES
 	extern_cuew
 )
 
+if(NOT CYCLES_STANDALONE_REPOSITORY)
+	list(APPEND LIBRARIES bf_intern_glew_mx)
+endif()
+
 add_definitions(${GL_DEFINITIONS})
 
 if(WIN32)
 	list(APPEND LIBRARIES ${PTHREADS_LIBRARIES})
 endif()
 
-link_directories(${OPENIMAGEIO_LIBPATH} ${BOOST_LIBPATH} ${PNG_LIBPATH} ${JPEG_LIBPATH} ${ZLIB_LIBPATH} ${TIFF_LIBPATH})
+link_directories(${OPENIMAGEIO_LIBPATH}
+                 ${BOOST_LIBPATH}
+                 ${PNG_LIBPATH}
+                 ${JPEG_LIBPATH}
+                 ${ZLIB_LIBPATH}
+                 ${TIFF_LIBPATH}
+                 ${OPENEXR_LIBPATH})
 
 if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
 	list(APPEND LIBRARIES ${GLUT_LIBRARIES})
 endif()
 
 if(WITH_CYCLES_OSL)
-	list(APPEND LIBRARIES cycles_kernel_osl ${OSL_LIBRARIES} ${LLVM_LIBRARY})
+	list(APPEND LIBRARIES cycles_kernel_osl ${OSL_LIBRARIES} ${LLVM_LIBRARIES})
 endif()
 
 include_directories(${INC})
diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt
index e1d592d..fff9ed2 100644
--- a/intern/cycles/blender/CMakeLists.txt
+++ b/intern/cycles/blender/CMakeLists.txt
@@ -17,7 +17,7 @@ set(INC
 
 set(INC_SYS
 	${PYTHON_INCLUDE_DIRS}
-	${GLEW_INCLUDE_PATH}
+	${GLEW_INCLUDE_DIR}
 )
 
 set(SRC
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index 4f02b93..f92b51a 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()
diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt
index 998b353..b0fa283 100644
--- a/intern/cycles/device/CMakeLists.txt
+++ b/intern/cycles/device/CMakeLists.txt
@@ -10,7 +10,7 @@ set(INC
 )
 
 set(INC_SYS
-	${GLEW_INCLUDE_PATH}
+	${GLEW_INCLUDE_DIR}
 	../../../extern/cuew/include
 	../../../extern/clew/include
 )
diff --git a/intern/cycles/render/CMakeLists.txt b/intern/cycles/render/CMakeLists.txt
index c3907da..2dc6962 100644
--- a/intern/cycles/render/CMakeLists.txt
+++ b/intern/cycles/render/CMakeLists.txt
@@ -11,7 +11,7 @@ set(INC
 )
 
 set(INC_SYS
-	${GLEW_INCLUDE_PATH}
+	${GLEW_INCLUDE_DIR}
 )
 
 set(SRC
diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt
index a07deb6..336e5e1 100644
--- a/intern/cycles/util/CMakeLists.txt
+++ b/intern/cycles/util/CMakeLists.txt
@@ -5,7 +5,7 @@ set(INC
 )
 
 set(INC_SYS
-	${GLEW_INCLUDE_PATH}
+	${GLEW_INCLUDE_DIR}
 )
 
 set(SRC




More information about the Bf-blender-cvs mailing list