Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--intern/cycles/app/CMakeLists.txt26
-rw-r--r--intern/cycles/cmake/external_libs.cmake27
2 files changed, 42 insertions, 11 deletions
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt
index d48ef51ded4..baa0fdde7f3 100644
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@ -20,10 +20,8 @@ set(LIBRARIES
cycles_subd
cycles_util
${BOOST_LIBRARIES}
- ${OPENEXR_LIBRARIES}
${BLENDER_GL_LIBRARIES}
${CYCLES_APP_GLEW_LIBRARY}
- ${OPENIMAGEIO_LIBRARIES}
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${ZLIB_LIBRARIES}
@@ -33,6 +31,27 @@ set(LIBRARIES
extern_cuew
)
+macro(target_link_libraries_oiio target)
+ if(NOT MSVC)
+ target_link_libraries(${target}
+ ${OPENIMAGEIO_LIBRARIES}
+ ${OPENEXR_LIBRARIES})
+ else()
+ # For MSVC we link to different libraries depending whether
+ # release or debug target is being built.
+ file_list_suffix(OPENIMAGEIO_LIBRARIES_DEBUG "${OPENIMAGEIO_LIBRARIES}" "_d")
+ file_list_suffix(OPENIMAGEIO_LIBRARIES_DEBUG "${OPENEXR_LIBRARIES}" "_d")
+
+ target_link_libraries_debug("${target}" "${OPENIMAGEIO_LIBRARIES_DEBUG}")
+ target_link_libraries_debug("${target}" "${OPENEXR_LIBRARIES_DEBUG}")
+ target_link_libraries_optimized("${target}" "${OPENIMAGEIO_LIBRARIES}")
+ target_link_libraries_optimized("${target}" "${OPENEXR_LIBRARIES}")
+
+ unset(OPENIMAGEIO_LIBRARIES_DEBUG)
+ unset(OPENIMAGEIO_LIBRARIES_DEBUG)
+ endif()
+endmacro()
+
if(NOT PUGIXML_LIBRARIES STREQUAL "")
list(APPEND LIBRARIES ${PUGIXML_LIBRARIES})
endif()
@@ -78,6 +97,7 @@ if(WITH_CYCLES_STANDALONE)
add_executable(cycles ${SRC})
list(APPEND LIBRARIES ${PLATFORM_LINKLIBS})
target_link_libraries(cycles ${LIBRARIES} ${CMAKE_DL_LIBS})
+ target_link_libraries_oiio(cycles)
if(UNIX AND NOT APPLE)
set_target_properties(cycles PROPERTIES INSTALL_RPATH $ORIGIN/lib)
@@ -91,10 +111,10 @@ if(WITH_CYCLES_NETWORK)
)
add_executable(cycles_server ${SRC})
target_link_libraries(cycles_server ${LIBRARIES} ${CMAKE_DL_LIBS})
+ target_link_libraries_oiio(cycles_server)
if(UNIX AND NOT APPLE)
set_target_properties(cycles_server PROPERTIES INSTALL_RPATH $ORIGIN/lib)
endif()
unset(SRC)
endif()
-
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index 465f2d27cf9..00c9b5179d6 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -1,4 +1,13 @@
###########################################################################
+# Precompiled libraries tips and hints, for find_package().
+
+if(CYCLES_STANDALONE_REPOSITORY)
+ if(APPLE OR WIN32)
+ include(precompiled_libs)
+ endif()
+endif()
+
+###########################################################################
# GLUT
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
@@ -42,13 +51,13 @@ endif()
# 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()
-
# PThreads
- find_package(Threads REQUIRED)
- set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+ # 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()
####
# OpenGL
@@ -83,10 +92,12 @@ if(CYCLES_STANDALONE_REPOSITORY)
if(WITH_CYCLES_NETWORK)
list(APPEND __boost_packages serialization)
endif()
- if(WITH_CYCLES_OSL AND APPLE)
+ if(WITH_CYCLES_OSL)
# TODO(sergey): This is because of the way how our precompiled
# libraries works, could be different for someone's else libs..
- list(APPEND __boost_packages wave)
+ if(APPLE OR MSVC)
+ list(APPEND __boost_packages wave)
+ endif()
endif()
find_package(Boost 1.48 COMPONENTS ${__boost_packages} REQUIRED)
if(NOT Boost_FOUND)