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:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-11-16 16:01:10 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2014-12-31 23:31:08 +0300
commit9b8942ac71cfe000b1402c5379342c2f1be2b288 (patch)
treeb1985adef97ce070d4ffad200b3287c8c4e98e4c /intern/cycles/app/CMakeLists.txt
parent9e2e408323f967a3f8b13e27e601ebfaa109ffcd (diff)
Cycles Standalone: Add initial support for compilation on Windows
This applies to an application comiling from the standalone Cycles repository only. There's still lack of proper install target, so currently pthreads library is to be copied next to cycles.exe manually.
Diffstat (limited to 'intern/cycles/app/CMakeLists.txt')
-rw-r--r--intern/cycles/app/CMakeLists.txt26
1 files changed, 23 insertions, 3 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()
-