[Bf-blender-cvs] [4fc9178] blender-v2.77-release: CMake cleanup target_link_libraries_decoupled

Martijn Berger noreply at git.blender.org
Tue Apr 5 10:38:43 CEST 2016


Commit: 4fc9178af994765470836a3ee359250a33e63482
Author: Martijn Berger
Date:   Wed Mar 30 15:15:07 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB4fc9178af994765470836a3ee359250a33e63482

CMake cleanup target_link_libraries_decoupled

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

M	CMakeLists.txt
M	build_files/cmake/macros.cmake
M	intern/cycles/app/CMakeLists.txt

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7232e5e..1572e2b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1427,11 +1427,18 @@ elseif(WIN32)
 				set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
 				set(OPENEXR_LIBPATH ${OPENEXR}/lib)
 				set(OPENEXR_LIBRARIES
+					optimized
 					${OPENEXR_LIBPATH}/Iex-2_2.lib
 					${OPENEXR_LIBPATH}/Half.lib
 					${OPENEXR_LIBPATH}/IlmImf-2_2.lib
 					${OPENEXR_LIBPATH}/Imath-2_2.lib
 					${OPENEXR_LIBPATH}/IlmThread-2_2.lib
+					debug
+					${OPENEXR_LIBPATH}/Iex-2_2_d.lib
+					${OPENEXR_LIBPATH}/Half_d.lib
+					${OPENEXR_LIBPATH}/IlmImf-2_2_d.lib
+					${OPENEXR_LIBPATH}/Imath-2_2_d.lib
+					${OPENEXR_LIBPATH}/IlmThread-2_2_d.lib
 				)
 			endif()
 		endif()
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index df0c365..7bdf790 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -141,22 +141,6 @@ function(target_link_libraries_debug
 	endforeach()
 endfunction()
 
-function(target_link_libraries_decoupled
-	target
-	libraries_var
-	)
-
-	if(NOT MSVC)
-		target_link_libraries(${target} ${${libraries_var}})
-	else()
-		# For MSVC we link to different libraries depending whether
-		# release or debug target is being built.
-		file_list_suffix(_libraries_debug "${${libraries_var}}" "_d")
-		target_link_libraries_debug(${target} "${_libraries_debug}")
-		target_link_libraries_optimized(${target} "${${libraries_var}}")
-	endif()
-endfunction()
-
 # Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/
 # use it instead of include_directories()
 function(blender_include_dirs
@@ -417,14 +401,7 @@ function(setup_liblinks
 	endif()
 	target_link_libraries(${target} ${JPEG_LIBRARIES})
 	if(WITH_IMAGE_OPENEXR)
-		if(WIN32 AND NOT UNIX AND NOT CMAKE_COMPILER_IS_GNUCC)
-			file_list_suffix(OPENEXR_LIBRARIES_DEBUG "${OPENEXR_LIBRARIES}" "_d")
-			target_link_libraries_debug(${target} "${OPENEXR_LIBRARIES_DEBUG}")
-			target_link_libraries_optimized(${target} "${OPENEXR_LIBRARIES}")
-			unset(OPENEXR_LIBRARIES_DEBUG)
-		else()
-			target_link_libraries(${target} ${OPENEXR_LIBRARIES})
-		endif()
+		target_link_libraries(${target} ${OPENEXR_LIBRARIES})
 	endif()
 	if(WITH_IMAGE_OPENJPEG AND WITH_SYSTEM_OPENJPEG)
 		target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt
index af20356..d40a1a1 100644
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@ -84,18 +84,12 @@ include_directories(SYSTEM ${INC_SYS})
 macro(cycles_target_link_libraries target)
 	target_link_libraries(${target} ${LIBRARIES})
 	if(WITH_CYCLES_OSL)
-		target_link_libraries_decoupled(${target} OSL_LIBRARIES)
-		if(MSVC)
-			target_link_libraries_debug(${target} "${LLVM_LIBRARIES_DEBUG}")
-			target_link_libraries_optimized(${target} "${LLVM_LIBRARIES}")
-		else()
-			target_link_libraries(${target} ${LLVM_LIBRARIES})
-		endif()
+		target_link_libraries(${target} ${OSL_LIBRARIES} ${LLVM_LIBRARIES})
 	endif()
-	target_link_libraries_decoupled(${target} OPENIMAGEIO_LIBRARIES)
-	target_link_libraries_decoupled(${target} OPENEXR_LIBRARIES)
 	target_link_libraries(
 		${target}
+		${OPENIMAGEIO_LIBRARIES}
+		${OPENEXR_LIBRARIES}
 		${PUGIXML_LIBRARIES}
 		${BOOST_LIBRARIES}
 		${CMAKE_DL_LIBS}




More information about the Bf-blender-cvs mailing list