Fix blenderplayer build after OpenMP changes.
[blender.git] / source / creator / CMakeLists.txt
index a71c1bb198465a459d00c2fb655062fdd421f660..1ce8a8d1c4cba3279295d8bb10003bb97c7700e2 100644 (file)
@@ -265,15 +265,30 @@ endif()
 set(BLENDER_TEXT_FILES
        ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
        ${CMAKE_SOURCE_DIR}/release/text/GPL3-license.txt
-       ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
        ${CMAKE_SOURCE_DIR}/release/text/copyright.txt
-       ${CMAKE_SOURCE_DIR}/release/text/jemalloc-license.txt
-       ${CMAKE_SOURCE_DIR}/release/text/ocio-license.txt
        # generate this file
        # ${CMAKE_SOURCE_DIR}/release/text/readme.html
        ${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-bfont.ttf.txt
 )
 
+if(WITH_PYTHON)
+       list(APPEND BLENDER_TEXT_FILES
+               ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
+       )
+endif()
+
+if(WITH_OPENCOLORIO)
+       list(APPEND BLENDER_TEXT_FILES
+               ${CMAKE_SOURCE_DIR}/release/text/ocio-license.txt
+       )
+endif()
+
+if(WITH_MEM_JEMALLOC)
+       list(APPEND BLENDER_TEXT_FILES
+               ${CMAKE_SOURCE_DIR}/release/text/jemalloc-license.txt
+       )
+endif()
+
 if(WITH_INTERNATIONAL)
        list(APPEND BLENDER_TEXT_FILES
                ${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-droidsans.ttf.txt
@@ -326,7 +341,7 @@ install(
 
 if(WITH_PYTHON)
        # install(CODE "message(\"copying blender scripts...\")")
-       
+
        # exclude addons_contrib if release
        if("${BLENDER_VERSION_CYCLE}" STREQUAL "release" OR
           "${BLENDER_VERSION_CYCLE}" STREQUAL "rc")
@@ -352,7 +367,7 @@ if(WITH_PYTHON)
                PATTERN "${ADDON_EXCLUDE_CONDITIONAL}" EXCLUDE
                PATTERN "${FREESTYLE_EXCLUDE_CONDITIONAL}" EXCLUDE
        )
-       
+
        unset(ADDON_EXCLUDE_CONDITIONAL)
        unset(FREESTYLE_EXCLUDE_CONDITIONAL)
 endif()
@@ -632,7 +647,7 @@ if(UNIX AND NOT APPLE)
                                unset(_suffix)
                        endif()
                        unset(_target_LIB)
-                       
+
                endif()
        endif()
 elseif(WIN32)
@@ -702,7 +717,7 @@ elseif(WIN32)
                        )
 
                        if(WITH_PYTHON_INSTALL_NUMPY)
-                               set(PYTHON_NUMPY_VERSION 1.13)
+                               set(PYTHON_NUMPY_VERSION 1.15)
                                add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages
                                        COMMAND ${CMAKE_COMMAND} -E
                                                make_directory ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages)
@@ -738,6 +753,19 @@ elseif(WIN32)
                                DESTINATION ${BLENDER_VERSION}/python/bin
                                CONFIGURATIONS Debug
                        )
+                       if(WINDOWS_PYTHON_DEBUG)
+                               install(
+                                       FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.pdb
+                                       DESTINATION "."
+                                       CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
+                               )
+
+                               install(
+                                       FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.pdb
+                                       DESTINATION "."
+                                       CONFIGURATIONS Debug
+                               )
+                       endif()
                endif()
 
                unset(_PYTHON_VERSION_NO_DOTS)
@@ -757,7 +785,7 @@ elseif(WIN32)
 
        if(MSVC)
                install(
-                       FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll
+                       FILES ${LIBDIR}/pthreads/lib/pthreadVC3.dll
                        DESTINATION "."
                )
        endif()
@@ -765,12 +793,12 @@ elseif(WIN32)
        if(WITH_CODEC_FFMPEG)
                install(
                        FILES
-                               ${LIBDIR}/ffmpeg/lib/avcodec-57.dll
-                               ${LIBDIR}/ffmpeg/lib/avformat-57.dll
-                               ${LIBDIR}/ffmpeg/lib/avdevice-57.dll
-                               ${LIBDIR}/ffmpeg/lib/avutil-55.dll
-                               ${LIBDIR}/ffmpeg/lib/swscale-4.dll
-                               ${LIBDIR}/ffmpeg/lib/swresample-2.dll
+                               ${LIBDIR}/ffmpeg/lib/avcodec-58.dll
+                               ${LIBDIR}/ffmpeg/lib/avformat-58.dll
+                               ${LIBDIR}/ffmpeg/lib/avdevice-58.dll
+                               ${LIBDIR}/ffmpeg/lib/avutil-56.dll
+                               ${LIBDIR}/ffmpeg/lib/swscale-5.dll
+                               ${LIBDIR}/ffmpeg/lib/swresample-3.dll
                        DESTINATION "."
                )
        endif()
@@ -796,7 +824,7 @@ elseif(WIN32)
                        DESTINATION "."
                )
        endif()
-       
+
        if(WITH_SYSTEM_AUDASPACE)
                install(
                        FILES
@@ -813,21 +841,12 @@ elseif(WIN32)
                        DESTINATION "."
                )
        endif()
-               
+
        install( # x86 builds can run on x64 Windows, so this is required at all times
                FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
                DESTINATION "."
        )
 
-       if(WITH_OPENCOLORIO)
-               set(OCIOBIN ${LIBDIR}/opencolorio/bin)
-                       install(
-                               FILES
-                                       ${OCIOBIN}/OpenColorIO.dll
-                               DESTINATION "."
-                       )
-       endif()
-
 elseif(APPLE)
 
        # handy install macro to exclude files, we use \$ escape for the "to"
@@ -895,6 +914,13 @@ elseif(APPLE)
                blender.app/Contents/
        )
 
+       if(WITH_OPENMP AND OPENMP_CUSTOM)
+               install(
+                       FILES ${LIBDIR}/openmp/lib/libomp.dylib
+                       DESTINATION blender.app/Contents/Resources/lib
+               )
+       endif()
+
        if(WITH_LLVM AND NOT LLVM_STATIC)
                install(
                        FILES ${LIBDIR}/llvm/lib/libLLVM-3.4.dylib
@@ -924,7 +950,7 @@ elseif(APPLE)
                )
                unset(_py_inc_suffix)
        endif()
-       
+
        # install blenderplayer bundle - copy of blender.app above. re-using macros et al
        # note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
        if(WITH_GAMEENGINE AND WITH_PLAYER)
@@ -953,14 +979,13 @@ elseif(APPLE)
                        blenderplayer.app/Contents/
                )
 
-               if(WITH_OPENMP AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4')
+               if(WITH_OPENMP AND OPENMP_CUSTOM)
                        install(
-                               FILES ${LIBDIR}/openmp/lib/libiomp5.dylib
-                               DESTINATION blenderplayer.app/Contents/Resources/lib/
+                               FILES ${LIBDIR}/openmp/lib/libomp.dylib
+                               DESTINATION blenderplayer.app/Contents/Resources/lib
                        )
                endif()
 
-
                # python
                if(WITH_PYTHON AND NOT WITH_PYTHON_FRAMEWORK)
                        # Copy the python libs into the install directory
@@ -1025,4 +1050,9 @@ if(WIN32 AND NOT WITH_PYTHON_MODULE)
                COMPONENT Blender
                DESTINATION "."
        )
+       set_target_properties(
+               blender
+               PROPERTIES
+                       VS_USER_PROPS "blender.Cpp.user.props"
+       )
 endif()