CMake cleanup target_link_libraries_decoupled
authorMartijn Berger <martijn.berger@gmail.com>
Wed, 30 Mar 2016 13:15:07 +0000 (15:15 +0200)
committerMartijn Berger <martijn.berger@gmail.com>
Wed, 30 Mar 2016 13:15:17 +0000 (15:15 +0200)
CMakeLists.txt
build_files/cmake/macros.cmake
intern/cycles/app/CMakeLists.txt

index b9b5cb0885444d084a87bf5dbe4555d75813ef11..9a175160eb1d72b7f3d500a9fe5534778ab88084 100644 (file)
@@ -1443,11 +1443,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()
index c9cee9208abbd888c31b83d3fdffba7ed154b353..2b7a43b7e969aae7b1692ffffd644f4bcbea9b97 100644 (file)
@@ -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
@@ -412,14 +396,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})
index af20356ad7724d1fd5fa096b7acbb85e6fe38883..d40a1a14f7232c87357b23019d603ad4a065dc52 100644 (file)
@@ -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}