Fix blenderplayer build after OpenMP changes.
[blender.git] / source / creator / CMakeLists.txt
index 73400da48458ff3e21ad83e960fba69da22de835..1ce8a8d1c4cba3279295d8bb10003bb97c7700e2 100644 (file)
 setup_libdirs()
 
 blender_include_dirs(
+       ../../intern/clog
        ../../intern/guardedalloc
        ../../intern/glew-mx
        ../blender/blenlib
        ../blender/blenkernel
        ../blender/blenloader
+       ../blender/depsgraph
        ../blender/editors/include
        ../blender/makesrna
        ../blender/imbuf
@@ -48,7 +50,7 @@ if(WIN32)
 endif()
 
 if(WITH_LIBMV)
-       blender_include_dirs(../../extern/libmv)
+       blender_include_dirs(../../intern/libmv)
        add_definitions(-DWITH_LIBMV)
 endif()
 
@@ -81,6 +83,10 @@ if(WITH_GAMEENGINE)
 endif()
 
 if(WITH_SDL)
+       if(WITH_SDL_DYNLOAD)
+               add_definitions(-DWITH_SDL_DYNLOAD)
+               blender_include_dirs(../../extern/sdlew/include)
+       endif()
        add_definitions(-DWITH_SDL)
 endif()
 
@@ -97,6 +103,10 @@ endif()
 # Setup the exe sources and buildinfo
 set(SRC
        creator.c
+       creator_args.c
+       creator_signals.c
+
+       creator_intern.h
 )
 
 # MSVC 2010 gives linking errors with the manifest
@@ -104,28 +114,17 @@ if(WIN32 AND NOT UNIX)
        string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
        string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
        string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3)
-       if(MINGW)
-               add_definitions(
-                       -DWINDRES
-                       -DBLEN_VER_RC_STR_M=${BLENDER_VERSION}
-                       -DBLEN_VER_RC_1=${bver1}
-                       -DBLEN_VER_RC_2=${bver2}
-                       -DBLEN_VER_RC_3=${bver3}
-                       -DBLEN_VER_RC_4=0
-               )
-       else()
-               add_definitions(
-                       -DBLEN_VER_RC_STR=${BLENDER_VERSION}
-                       -DBLEN_VER_RC_1=${bver1}
-                       -DBLEN_VER_RC_2=${bver2}
-                       -DBLEN_VER_RC_3=${bver3}
-                       -DBLEN_VER_RC_4=0
-               )
-       endif()
+       add_definitions(
+               -DBLEN_VER_RC_STR=${BLENDER_VERSION}
+               -DBLEN_VER_RC_1=${bver1}
+               -DBLEN_VER_RC_2=${bver2}
+               -DBLEN_VER_RC_3=${bver3}
+               -DBLEN_VER_RC_4=0
+       )
 
 
        list(APPEND SRC
-               ../icons/winblender.rc
+               ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.rc
        )
 endif()
 
@@ -160,23 +159,47 @@ if(WITH_BUILDINFO)
        #       except when used as an include path.
 
        # include the output directory, where the buildinfo.h file is generated
-       include_directories(${CMAKE_BINARY_DIR}/source/creator)
+       include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+
+       # XXX, ${buildinfo_h_fake} is used here,
+       # because we rely on that file being detected as missing
+       # every build so that the real header "buildinfo.h" is updated.
+       #
+       # Keep this until we find a better way to resolve!
+
+       set(buildinfo_h_real "${CMAKE_CURRENT_BINARY_DIR}/buildinfo.h")
+       set(buildinfo_h_fake "${CMAKE_CURRENT_BINARY_DIR}/buildinfo.h_fake")
+
+       if(EXISTS ${buildinfo_h_fake})
+               message(FATAL_ERROR "File \"${buildinfo_h_fake}\" found, this should never be created, remove!")
+       endif()
 
        # a custom target that is always built
        add_custom_target(buildinfo ALL
-               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h)
+               DEPENDS ${buildinfo_h_fake})
 
-       # creates svnheader.h using cmake script
-       add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h
+       # creates buildinfo.h using cmake script
+       add_custom_command(
+               OUTPUT
+                       ${buildinfo_h_fake}  # ensure we always run
+                       ${buildinfo_h_real}
                COMMAND ${CMAKE_COMMAND}
                -DSOURCE_DIR=${CMAKE_SOURCE_DIR}
+               # overrides only used when non-empty strings
+               -DBUILD_DATE=${BUILDINFO_OVERRIDE_DATE}
+               -DBUILD_TIME=${BUILDINFO_OVERRIDE_TIME}
                -P ${CMAKE_SOURCE_DIR}/build_files/cmake/buildinfo.cmake)
 
        # buildinfo.h is a generated file
-       set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h
+       set_source_files_properties(
+               ${buildinfo_h_real}
                PROPERTIES GENERATED TRUE
                HEADER_FILE_ONLY TRUE)
 
+       unset(buildinfo_h_real)
+       unset(buildinfo_h_fake)
+
        # add deps below, after adding blender
        # -------------- done with header values.
 
@@ -189,6 +212,8 @@ if(WITH_BUILDINFO)
        add_dependencies(buildinfoobj buildinfo)
 endif()
 
+add_cc_flags_custom_test(blender)
+
 # message(STATUS "Configuring blender")
 if(WITH_PYTHON_MODULE)
        add_definitions(-DWITH_PYTHON_MODULE)
@@ -211,6 +236,7 @@ if(WITH_PYTHON_MODULE)
                set_target_properties(
                        blender
                        PROPERTIES
+                               MACOSX_BUNDLE TRUE
                                LINK_FLAGS_RELEASE "${PLATFORM_LINKFLAGS}"
                                LINK_FLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG}"
                )
@@ -227,6 +253,7 @@ if(WITH_PYTHON_MODULE)
 
 else()
        add_executable(blender ${EXETYPE} ${SRC})
+       WINDOWS_SIGN_TARGET(blender)
 endif()
 
 if(WITH_BUILDINFO)
@@ -234,26 +261,34 @@ if(WITH_BUILDINFO)
        add_dependencies(blender buildinfo)
 endif()
 
-# Post build steps for bundling/packaging.
-
-
-if(MSVC_IDE)
-       # ${CMAKE_CFG_INTDIR} should replace \${BUILD_TYPE} when using add_command
-       set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE})
-elseif(APPLE)
-       set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE})
-else()
-       set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH})
-endif()
 
 set(BLENDER_TEXT_FILES
        ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
-       ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
+       ${CMAKE_SOURCE_DIR}/release/text/GPL3-license.txt
        ${CMAKE_SOURCE_DIR}/release/text/copyright.txt
-       ${CMAKE_SOURCE_DIR}/release/text/readme.html
+       # 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
@@ -266,26 +301,31 @@ endif()
 # Platform Specific Var: TARGETDIR_VER
 
 if(UNIX AND NOT APPLE)
-       if(WITH_INSTALL_PORTABLE)
-               set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
+       if(WITH_PYTHON_MODULE)
+               if(WITH_INSTALL_PORTABLE)
+                       set(TARGETDIR_VER ${BLENDER_VERSION})
+               else()
+                       set(TARGETDIR_VER ${PYTHON_SITE_PACKAGES}/${BLENDER_VERSION})
+               endif()
        else()
-               if(WITH_PYTHON_MODULE)
-                       set(TARGETDIR_VER ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/${BLENDER_VERSION})
+               if(WITH_INSTALL_PORTABLE)
+                       set(TARGETDIR_VER ${BLENDER_VERSION})
                else()
-                       set(TARGETDIR_VER ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION})
+                       set(TARGETDIR_VER share/blender/${BLENDER_VERSION})
                endif()
        endif()
 
 elseif(WIN32)
-       set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
+       set(TARGETDIR_VER ${BLENDER_VERSION})
 
 elseif(APPLE)
        if(WITH_PYTHON_MODULE)
-               set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
+               set(TARGETDIR_VER ${BLENDER_VERSION})
        else()
-               set(TARGETDIR_VER ${TARGETDIR}/blender.app/Contents/Resources/${BLENDER_VERSION})
+               set(TARGETDIR_VER blender.app/Contents/Resources/${BLENDER_VERSION})
        endif()
-
+       # Skip relinking on cpack / install
+       set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true)
 endif()
 
 
@@ -301,9 +341,10 @@ install(
 
 if(WITH_PYTHON)
        # install(CODE "message(\"copying blender scripts...\")")
-       
+
        # exclude addons_contrib if release
-       if("${BLENDER_VERSION_CYCLE}" STREQUAL "release")
+       if("${BLENDER_VERSION_CYCLE}" STREQUAL "release" OR
+          "${BLENDER_VERSION_CYCLE}" STREQUAL "rc")
                set(ADDON_EXCLUDE_CONDITIONAL "addons_contrib/*")
        else()
                set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*")  # dummy, wont do anything
@@ -320,11 +361,13 @@ if(WITH_PYTHON)
                DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts
                DESTINATION ${TARGETDIR_VER}
                PATTERN ".git" EXCLUDE
+               PATTERN ".gitignore" EXCLUDE
+               PATTERN ".arcconfig" EXCLUDE
                PATTERN "__pycache__" EXCLUDE
                PATTERN "${ADDON_EXCLUDE_CONDITIONAL}" EXCLUDE
                PATTERN "${FREESTYLE_EXCLUDE_CONDITIONAL}" EXCLUDE
        )
-       
+
        unset(ADDON_EXCLUDE_CONDITIONAL)
        unset(FREESTYLE_EXCLUDE_CONDITIONAL)
 endif()
@@ -390,7 +433,8 @@ if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*")
        # message after building.
        add_custom_command(
                TARGET blender POST_BUILD MAIN_DEPENDENCY blender
-               COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}'
+               COMMAND ${CMAKE_COMMAND} -E
+                       echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}'
        )
 endif()
 
@@ -401,74 +445,74 @@ endif()
 if(UNIX AND NOT APPLE)
 
        if(NOT WITH_PYTHON_MODULE)
-               install(
-                       CODE
-                       "
-                       execute_process(COMMAND
-                                                       ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1.py
-                                                       ${TARGETDIR}/blender
-                                                       ${TARGETDIR}/blender.1)
-                       "
-               )
+               if(WITH_DOC_MANPAGE)
+                       add_custom_target(
+                               blender_man_page ALL
+                               COMMAND ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1.py
+                                       ${EXECUTABLE_OUTPUT_PATH}/blender
+                                       ${CMAKE_CURRENT_BINARY_DIR}/blender.1)
+                       add_dependencies(blender_man_page blender)
+               endif()
        endif()
 
        # there are a few differences between portable and system install
-       if(WITH_INSTALL_PORTABLE)
+       if(WITH_PYTHON_MODULE)
+               if(WITH_INSTALL_PORTABLE)
+                       install(
+                               TARGETS blender
+                               DESTINATION "."
+                       )
+               else()
+                       install(
+                               TARGETS blender
+                               LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}
+                       )
+               endif()
+               # none of the other files are needed currently
+       elseif(WITH_INSTALL_PORTABLE)
                install(
-                       FILES ${TARGETDIR}/blender.1
-                       DESTINATION ${TARGETDIR}
+                       TARGETS blender
+                       DESTINATION "."
                )
 
+               if(WITH_DOC_MANPAGE)
+                       install(
+                               FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.1
+                               DESTINATION "."
+                       )
+               endif()
                install(
                        FILES
                                ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
                                ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
-                       DESTINATION ${TARGETDIR}
+                       DESTINATION "."
                )
 
                install(
                        PROGRAMS
                        ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
-                       DESTINATION ${TARGETDIR}
-               )
-
-               install(
-                       FILES ${BLENDER_TEXT_FILES}
-                       DESTINATION ${TARGETDIR}
+                       DESTINATION "."
                )
 
+               set(BLENDER_TEXT_FILES_DESTINATION ".")
        else()
                # main blender binary
-               if(WITH_PYTHON_MODULE)
-                       install(
-                               TARGETS blender
-                               LIBRARY
-                               DESTINATION ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages
-                       )
-               else()
-                       install(
-                               PROGRAMS ${TARGETDIR}/blender
-                               DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
-                       )
+               install(
+                       TARGETS blender
+                       DESTINATION bin
+               )
+               if(WITH_DOC_MANPAGE)
                        # manpage only with 'blender' binary
                        install(
-                               FILES ${TARGETDIR}/blender.1
-                               DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
-                       )
-               endif()
-
-
-               if(WITH_GAMEENGINE AND WITH_PLAYER)
-                       install(
-                               PROGRAMS ${TARGETDIR}/blenderplayer
-                               DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
+                               FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.1
+                               DESTINATION share/man/man1
                        )
                endif()
 
                # misc files
                install(
                        FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
-                       DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
+                       DESTINATION share/applications
                )
                install(
                        DIRECTORY
@@ -478,25 +522,28 @@ if(UNIX AND NOT APPLE)
                                ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32
                                ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48
                                ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256
-                       DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
+                       DESTINATION share/icons/hicolor
                        PATTERN "*.svg" EXCLUDE
                )
                install(
                        FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
-                       DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps
+                       DESTINATION share/icons/hicolor/scalable/apps
                )
                install(
                        PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
-                       DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
-               )
-               install(
-                       FILES ${BLENDER_TEXT_FILES}
-                       DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
+                       DESTINATION bin
                )
+               set(BLENDER_TEXT_FILES_DESTINATION share/doc/blender)
        endif()
 
        if(WITH_PYTHON)
                if(WITH_PYTHON_INSTALL)
+
+                       install(
+                               PROGRAMS ${PYTHON_EXECUTABLE}
+                               DESTINATION ${TARGETDIR_VER}/python/bin
+                       )
+
                        # on some platforms (like openSUSE) Python is linked
                        # to be used from lib64 folder.
                        # determine this from Python's libraries path
@@ -511,17 +558,13 @@ if(UNIX AND NOT APPLE)
                        unset(_pypath_real)
 
                        # Copy the systems python into the install directory
-                       # Scons copy in tools/Blender.py
                        # install(CODE "message(\"copying a subset of the systems python...\")")
                        install(
                                DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION}
                                DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}
-                               PATTERN ".svn" EXCLUDE
                                PATTERN "__pycache__" EXCLUDE               # * any cache *
-                               PATTERN "distutils" EXCLUDE                 # ./distutils
+                               PATTERN "config-${PYTHON_VERSION}m/*.a" EXCLUDE  # static lib
                                PATTERN "lib2to3" EXCLUDE                   # ./lib2to3
-                               PATTERN "config" EXCLUDE                    # ./config
-                               PATTERN "config-*" EXCLUDE                  # ./config-*
                                PATTERN "site-packages/*" EXCLUDE           # ./site-packages/*
                                PATTERN "tkinter" EXCLUDE                   # ./tkinter
                                PATTERN "lib-dynload/_tkinter.*" EXCLUDE    # ./lib-dynload/_tkinter.co
@@ -531,8 +574,14 @@ if(UNIX AND NOT APPLE)
                                PATTERN "turtle.py" EXCLUDE                 # ./turtle.py
                        )
 
-                       # # doesnt work, todo
-                       # install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
+                       # Needed for distutils/pip
+                       # get the last part of the include dir, will be 'python{version}{abiflag}',
+                       get_filename_component(_py_inc_suffix ${PYTHON_INCLUDE_DIR} NAME)
+                       install(
+                               FILES ${PYTHON_INCLUDE_DIR}/pyconfig.h
+                               DESTINATION ${TARGETDIR_VER}/python/include/${_py_inc_suffix}
+                       )
+                       unset(_py_inc_suffix)
 
                        if(WITH_PYTHON_INSTALL_NUMPY)
                                # Install to the same directory as the source, so debian-like
@@ -548,11 +597,10 @@ if(UNIX AND NOT APPLE)
                                        PATTERN "__pycache__" EXCLUDE           # * any cache *
                                        PATTERN "*.pyc" EXCLUDE                 # * any cache *
                                        PATTERN "*.pyo" EXCLUDE                 # * any cache *
-                                       PATTERN "distutils" EXCLUDE             # ./distutils
                                        PATTERN "oldnumeric" EXCLUDE            # ./oldnumeric
                                        PATTERN "doc" EXCLUDE                   # ./doc
                                        PATTERN "tests" EXCLUDE                 # ./tests
-                                       PATTERN "f2py" EXCLUDE                  # ./f2py - fortran/python interface code, not fun for blender devs.
+                                       PATTERN "f2py" EXCLUDE                  # ./f2py - fortran/python interface code, not for blender.
                                        PATTERN "include" EXCLUDE               # include dirs all over, we wont use NumPy/CAPI
                                        PATTERN "*.h" EXCLUDE                   # some includes are not in include dirs
                                        PATTERN "*.a" EXCLUDE                   # ./core/lib/libnpymath.a - for linking, we dont need.
@@ -573,10 +621,9 @@ if(UNIX AND NOT APPLE)
                                        PATTERN "__pycache__" EXCLUDE           # * any cache *
                                        PATTERN "*.pyc" EXCLUDE                 # * any cache *
                                        PATTERN "*.pyo" EXCLUDE                 # * any cache *
-                                       PATTERN "cacert.pem" EXCLUDE            # for now we don't deal with security
                                )
                                # On some platforms requests does have extra dependencies.
-                               set(_requests_deps "chardet" "urllib3")
+                               set(_requests_deps "certifi" "chardet" "idna" "urllib3")
                                foreach(_requests_dep ${_requests_deps})
                                        if(EXISTS ${PYTHON_REQUESTS_PATH}/${_requests_dep})
                                                install(
@@ -594,87 +641,131 @@ if(UNIX AND NOT APPLE)
                                                FILES ${PYTHON_REQUESTS_PATH}/six.py
                                                DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix}
                                        )
-                                       endif()
+                               endif()
                                unset(_requests_dep)
                                unset(_requests_deps)
                                unset(_suffix)
                        endif()
                        unset(_target_LIB)
-                       
+
                endif()
        endif()
 elseif(WIN32)
 
-       install(
-               FILES ${BLENDER_TEXT_FILES}
-               DESTINATION ${TARGETDIR}
-       )
+       set(BLENDER_TEXT_FILES_DESTINATION ".")
 
        if(WITH_PYTHON)
                string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
 
-               install(
-                       FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll ${LIBDIR}/python/lib/sqlite3.dll
-                       DESTINATION ${TARGETDIR}
-                       CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
-               )
+               if(NOT CMAKE_COMPILER_IS_GNUCC)
+                       install(
+                               FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll
+                               DESTINATION "."
+                               CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
+                       )
 
-               install(
-                       FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll ${LIBDIR}/python/lib/sqlite3_d.dll
-                       DESTINATION ${TARGETDIR}
-                       CONFIGURATIONS Debug
-               )
+                       install(
+                               FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll
+                               DESTINATION "."
+                               CONFIGURATIONS Debug
+                       )
+               endif()
 
                if(WITH_PYTHON_INSTALL)
                        # note, as far as python is concerned 'RelWithDebInfo' is not debug since its without debug flags.
 
-                       # create the directory in multiple steps, so it actually gets created when it doesn't exist yet
-                       install(
-                               CODE
-                               "
-                               message(\"creating ${TARGETDIR_VER}/python/lib\")
-                               file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python\")
-                               file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python/lib\")
-                               message(\"done creating dir\")
-                               "
-                       )
+                       install(DIRECTORY DESTINATION ${TARGETDIR_VER}/python)
+                       install(DIRECTORY DESTINATION ${TARGETDIR_VER}/python/lib)
+
+                       # WARNING: its important that 'CMAKE_INSTALL_CONFIG_NAME' is evaluated at build time
+                       # and _NOT_ configuration time, when modifying the lines below,
+                       # check it works in both Release & Debug mode.
+                       #
+                       # Edit with extreme care! - Campbell
 
+                       # extract python
                        install(
                                CODE
                                "
-                               if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" STREQUAL \"Debug\")
-                                       execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
-                                               \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_d.tar.gz\")
+                               message(STATUS \"Extracting Python to: \${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python\")
+                               if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Dd][Ee][Bb][Uu][Gg])$\")
+                                       set(PYTHON_ZIP \"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_d.tar.gz\")
                                else()
-                                       execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
-                                               \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}.tar.gz\")
+                                       set(PYTHON_ZIP \"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}.tar.gz\")
                                endif()
+
+                               execute_process(
+                                       COMMAND \${CMAKE_COMMAND} -E make_directory
+                                               \"\${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python\"
+                                       COMMAND \${CMAKE_COMMAND} -E
+                                               chdir \"\${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python\"
+                                               \${CMAKE_COMMAND} -E
+                                               tar xzfv \"\${PYTHON_ZIP}\"
+                               )
+                               unset(PYTHON_ZIP)
                                "
                        )
 
+                       # release/site-packages
+                       install(
+                               DIRECTORY ${LIBDIR}/release/site-packages
+                               DESTINATION ${BLENDER_VERSION}/python/lib
+                               PATTERN ".svn" EXCLUDE
+                               PATTERN "__pycache__" EXCLUDE           # * any cache *
+                               PATTERN "*.pyc" EXCLUDE                 # * any cache *
+                               PATTERN "*.pyo" EXCLUDE                 # * any cache *)
+                       )
+
                        if(WITH_PYTHON_INSTALL_NUMPY)
+                               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)
+
+                               add_custom_command(
+                                       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy
+                                       COMMAND ${CMAKE_COMMAND} -E
+                                               tar xzvf "${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_${PYTHON_NUMPY_VERSION}$<$<CONFIG:Debug>:d>.tar.gz"
+                                       DEPENDS
+                                               ${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_${PYTHON_NUMPY_VERSION}$<$<CONFIG:Debug>:d>.tar.gz
+                                               ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages
+                                       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages
+                               )
+                               add_custom_target(
+                                       python_numpy ALL
+                                       DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy
+                               )
                                install(
-                                       CODE
-                                       "
-                                       execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib/site-packages\"
-                                               \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_1.8.tar.gz\")
-                                       "
+                                       DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy
+                                       DESTINATION ${BLENDER_VERSION}/python/lib/site-packages
                                )
                        endif()
 
-                       # release/site-packages
+
+                       # TODO(sergey): For unti we've got better way to deal with python binary
                        install(
-                               CODE
-                               "
-                               execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy_directory
-                                       ${LIBDIR}/release/site-packages
-                                       \"${TARGETDIR_VER}/python/lib/site-packages\")
-                               "
+                               FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll
+                               DESTINATION ${BLENDER_VERSION}/python/bin
+                               CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
                        )
+                       install(
+                               FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll
+                               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
+                               )
 
-
-                       # doesnt work, todo
-                       # install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
+                               install(
+                                       FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.pdb
+                                       DESTINATION "."
+                                       CONFIGURATIONS Debug
+                               )
+                       endif()
                endif()
 
                unset(_PYTHON_VERSION_NO_DOTS)
@@ -683,76 +774,39 @@ elseif(WIN32)
        # EGL Runtime Components
        if(WITH_GL_EGL)
                if(WIN32)
-                       install(FILES "${OPENGLES_DLL}"     DESTINATION ${TARGETDIR})
-                       install(FILES "${OPENGLES_EGL_DLL}" DESTINATION ${TARGETDIR})
+                       install(FILES "${OPENGLES_DLL}"     DESTINATION ".")
+                       install(FILES "${OPENGLES_EGL_DLL}" DESTINATION ".")
 
                        if(WITH_GL_ANGLE)
-                               install(FILES "${D3DCOMPILER_DLL}" DESTINATION ${TARGETDIR})
+                               install(FILES "${D3DCOMPILER_DLL}" DESTINATION ".")
                        endif()
                endif()
        endif()
 
        if(MSVC)
                install(
-                       FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll
-                       DESTINATION ${TARGETDIR}
+                       FILES ${LIBDIR}/pthreads/lib/pthreadVC3.dll
+                       DESTINATION "."
                )
-       else()
-               #MinGW64 comes with own version. For portable builds it will probaly have to be copied to work
-               if(NOT WITH_MINGW64)
-                       install(
-                               FILES ${LIBDIR}/pthreads/lib/pthreadGC2.dll
-                               DESTINATION ${TARGETDIR}
-                       )
-               elseif(WITH_MINGW64)
-                       install(
-                               FILES 
-                                       ${LIBDIR}/binaries/libgcc_s_sjlj-1.dll
-                                       ${LIBDIR}/binaries/libwinpthread-1.dll
-                                       ${LIBDIR}/binaries/libstdc++-6.dll
-                               DESTINATION ${TARGETDIR}
-                       )
-                       
-                       if(WITH_OPENMP)
-                               install(
-                                       FILES 
-                                       ${LIBDIR}/binaries/libgomp-1.dll
-                                       DESTINATION ${TARGETDIR}
-                               )
-                       endif()
-               endif()
        endif()
 
        if(WITH_CODEC_FFMPEG)
-               if(WITH_MINGW64)
-                       install(
-                               FILES
-                                       ${LIBDIR}/ffmpeg/lib/avcodec-53.dll
-                                       ${LIBDIR}/ffmpeg/lib/avformat-53.dll
-                                       ${LIBDIR}/ffmpeg/lib/avdevice-53.dll
-                                       ${LIBDIR}/ffmpeg/lib/avutil-51.dll
-                                       ${LIBDIR}/ffmpeg/lib/swscale-2.dll
-                                       ${LIBDIR}/ffmpeg/lib/swresample-0.dll
-                                       ${LIBDIR}/ffmpeg/lib/xvidcore.dll
-                               DESTINATION ${TARGETDIR}
-                       )
-               else()
-                       install(
-                               FILES
-                                       ${LIBDIR}/ffmpeg/lib/avcodec-55.dll
-                                       ${LIBDIR}/ffmpeg/lib/avformat-55.dll
-                                       ${LIBDIR}/ffmpeg/lib/avdevice-55.dll
-                                       ${LIBDIR}/ffmpeg/lib/avutil-52.dll
-                                       ${LIBDIR}/ffmpeg/lib/swscale-2.dll
-                               DESTINATION ${TARGETDIR}
-                       )
-               endif()
+               install(
+                       FILES
+                               ${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()
 
        if(WITH_CODEC_SNDFILE)
                install(
                        FILES ${LIBDIR}/sndfile/lib/libsndfile-1.dll
-                       DESTINATION ${TARGETDIR}
+                       DESTINATION "."
                )
        endif()
 
@@ -760,47 +814,39 @@ elseif(WIN32)
                install(
                        FILES
                                ${LIBDIR}/openal/lib/OpenAL32.dll
-                               ${LIBDIR}/openal/lib/wrap_oal.dll
-                       DESTINATION ${TARGETDIR}
+                       DESTINATION "."
                )
        endif()
 
        if(WITH_SDL)
                install(
-                       FILES ${LIBDIR}/sdl/lib/SDL.dll
-                       DESTINATION ${TARGETDIR}
+                       FILES ${LIBDIR}/sdl/lib/SDL2.dll
+                       DESTINATION "."
+               )
+       endif()
+
+       if(WITH_SYSTEM_AUDASPACE)
+               install(
+                       FILES
+                               ${LIBDIR}/audaspace/lib/audaspace.dll
+                               ${LIBDIR}/audaspace/lib/audaspace-c.dll
+                               ${LIBDIR}/audaspace/lib/audaspace-py.dll
+                       DESTINATION "."
                )
        endif()
 
        if(NOT CMAKE_CL_64)
                install(
                        FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
-                       DESTINATION ${TARGETDIR}
+                       DESTINATION "."
                )
        endif()
-               
+
        install( # x86 builds can run on x64 Windows, so this is required at all times
                FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
-               DESTINATION ${TARGETDIR}
+               DESTINATION "."
        )
 
-       if(WITH_OPENCOLORIO)
-               set(OCIOBIN ${LIBDIR}/opencolorio/bin)
-               if(NOT MINGW)
-                       install(
-                               FILES
-                                       ${OCIOBIN}/OpenColorIO.dll
-                               DESTINATION ${TARGETDIR}
-                       )
-               else()
-                       install(
-                               FILES
-                                       ${OCIOBIN}/libOpenColorIO.dll
-                               DESTINATION ${TARGETDIR}
-                       )
-               endif()
-       endif()
-
 elseif(APPLE)
 
        # handy install macro to exclude files, we use \$ escape for the "to"
@@ -818,90 +864,99 @@ elseif(APPLE)
                        PATTERN "__pycache__" EXCLUDE
                        PATTERN "__MACOSX" EXCLUDE
                        PATTERN ".DS_Store" EXCLUDE
+                       PATTERN "config-${PYTHON_VERSION}m/*.a" EXCLUDE  # static lib
+                       PATTERN "lib2to3" EXCLUDE                   # ./lib2to3
+                       PATTERN "tkinter" EXCLUDE                   # ./tkinter
+                       PATTERN "lib-dynload/_tkinter.*" EXCLUDE    # ./lib-dynload/_tkinter.co
+                       PATTERN "idlelib" EXCLUDE                   # ./idlelib
+                       PATTERN "test" EXCLUDE                      # ./test
+                       PATTERN "turtledemo" EXCLUDE                # ./turtledemo
+                       PATTERN "turtle.py" EXCLUDE                 # ./turtle.py
                )
        endmacro()
 
        set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/blender.app)
 
        # setup Info.plist
-       execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
+       execute_process(COMMAND date "+%Y-%m-%d"
+                       OUTPUT_VARIABLE BLENDER_DATE
+                       OUTPUT_STRIP_TRAILING_WHITESPACE)
 
        set_target_properties(blender PROPERTIES
                MACOSX_BUNDLE_INFO_PLIST ${OSX_APP_SOURCEDIR}/Contents/Info.plist
-               MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
-               MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
+               MACOSX_BUNDLE_SHORT_VERSION_STRING "${BLENDER_VERSION}${BLENDER_VERSION_CHAR}"
+               MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION}${BLENDER_VERSION_CHAR} ${BLENDER_DATE}")
 
+       # Gather the date in finder-style
+       execute_process(COMMAND date "+%m/%d/%Y/%H:%M"
+       OUTPUT_VARIABLE SETFILE_DATE
+       OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+       # Give the bundle actual creation/modification date
+       execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE}
+                       ${EXECUTABLE_OUTPUT_PATH}/blender.app)
 
-       # install release and app files
        install(
-               FILES ${BLENDER_TEXT_FILES}
-               DESTINATION ${TARGETDIR}
+               TARGETS blender
+               DESTINATION "."
        )
 
+       # install release and app files
+       set(BLENDER_TEXT_FILES_DESTINATION ".")
+
        install(
                FILES ${OSX_APP_SOURCEDIR}/Contents/PkgInfo
-               DESTINATION ${TARGETDIR}/blender.app/Contents
+               DESTINATION blender.app/Contents
        )
 
        install_dir(
                ${OSX_APP_SOURCEDIR}/Contents/Resources
-               \${TARGETDIR}/blender.app/Contents/
+               blender.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 ${TARGETDIR}/blender.app/Contents/MacOS
+                       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
-                       DESTINATION ${TARGETDIR}/blender.app/Contents/MacOS
+                       DESTINATION blender.app/Contents/MacOS
                )
        endif()
 
        # python
        if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
-               # the python zip is first extract as part of the build process,
-               # and then later installed as part of make install. this is much
-               # quicker, and means we can easily exclude files on copy
-               # Not needed for PYTHON_MODULE or WEB_PLUGIN due uses  Pyhon framework
-               add_custom_target(
-                       extractpyzip
-                       DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/python)
-
-               set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
-
-               add_custom_command(
-                       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
-                       COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
-                       COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
-                       COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
-                       DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
-
-               add_dependencies(blender extractpyzip)
-
-               # copy extracted python files
+               # Copy the python libs into the install directory
                install_dir(
-                       ${CMAKE_CURRENT_BINARY_DIR}/python
-                       \${TARGETDIR_VER}
+                       ${PYTHON_LIBPATH}
+                       ${TARGETDIR_VER}/python/lib
                )
-               # copy site-packages files
-               install_dir(
-                       ${LIBDIR}/release/site-packages
-                       ${CMAKE_CURRENT_BINARY_DIR}/python/lib/python${PYTHON_VERSION}/site-packages
+
+               install(DIRECTORY ${LIBDIR}/python/bin
+                       DESTINATION ${TARGETDIR_VER}/python
+                       USE_SOURCE_PERMISSIONS
                )
 
+               # Needed for distutils/pip
+               # get the last part of the include dir, will be 'python{version}{abiflag}',
+               get_filename_component(_py_inc_suffix ${PYTHON_INCLUDE_DIR} NAME)
+               install(
+                       FILES ${PYTHON_INCLUDE_DIR}/pyconfig.h
+                       DESTINATION ${TARGETDIR_VER}/python/include/${_py_inc_suffix}
+               )
+               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)
                set(OSX_APP_PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/blenderplayer.app)
                set(PLAYER_SOURCEINFO ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Info.plist)
-               set(PLAYER_TARGETDIR_VER ${TARGETDIR}/blenderplayer.app/Contents/MacOS/${BLENDER_VERSION})
+               set(PLAYER_TARGETDIR_VER blenderplayer.app/Contents/Resources/${BLENDER_VERSION})
 
 
                # important to make a clean  install each time else old scripts get loaded.
@@ -910,29 +965,33 @@ elseif(APPLE)
                        "file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})"
                )
 
+               # Give the bundle actual creation/modification date
+               execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE}
+                               ${EXECUTABLE_OUTPUT_PATH}/blenderplayer.app)
+
                install(
                        FILES ${OSX_APP_PLAYER_SOURCEDIR}/Contents/PkgInfo
-                       DESTINATION ${TARGETDIR}/blenderplayer.app/Contents
+                       DESTINATION blenderplayer.app/Contents
                )
 
                install_dir(
                        ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Resources
-                       \${TARGETDIR}/blenderplayer.app/Contents/
+                       blenderplayer.app/Contents/
                )
 
+               if(WITH_OPENMP AND OPENMP_CUSTOM)
+                       install(
+                               FILES ${LIBDIR}/openmp/lib/libomp.dylib
+                               DESTINATION blenderplayer.app/Contents/Resources/lib
+                       )
+               endif()
+
                # python
                if(WITH_PYTHON AND NOT WITH_PYTHON_FRAMEWORK)
-                       add_custom_command(
-                               OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
-                               COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
-                               COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
-                               COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
-                               DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
-
-                       # copy extracted python files
+                       # Copy the python libs into the install directory
                        install_dir(
-                               ${CMAKE_CURRENT_BINARY_DIR}/python
-                               \${PLAYER_TARGETDIR_VER}
+                               ${PYTHON_LIBPATH}
+                               ${PLAYER_TARGETDIR_VER}/python/lib
                        )
                endif()
 
@@ -943,12 +1002,33 @@ endif()
 # -----------------------------------------------------------------------------
 # Generic Install, for all targets
 
+if(DEFINED BLENDER_TEXT_FILES_DESTINATION)
 
+       install(
+               CODE
+               "
+               file(READ \"${CMAKE_SOURCE_DIR}/release/text/readme.html\" DATA_SRC)
+               string(REGEX REPLACE \"BLENDER_VERSION\" \"${BLENDER_VERSION}\" DATA_DST \"\${DATA_SRC}\")
+               file(WRITE \"${CMAKE_BINARY_DIR}/release/text/readme.html\" \"\${DATA_DST}\")
+               unset(DATA_SRC)
+               unset(DATA_DST)
+               "
+       )
+       list(APPEND BLENDER_TEXT_FILES
+               ${CMAKE_BINARY_DIR}/release/text/readme.html
+       )
+
+       install(
+               FILES ${BLENDER_TEXT_FILES}
+               DESTINATION "${BLENDER_TEXT_FILES_DESTINATION}"
+       )
+endif()
 
 # install more files specified elsewhere
 delayed_do_install(${TARGETDIR_VER})
 
 unset(BLENDER_TEXT_FILES)
+unset(BLENDER_TEXT_FILES_DESTINATION)
 
 
 # -----------------------------------------------------------------------------
@@ -957,7 +1037,6 @@ unset(BLENDER_TEXT_FILES)
 add_dependencies(blender makesdna)
 
 setup_blender_sorted_libs()
-
 target_link_libraries(blender ${BLENDER_SORTED_LIBS})
 
 setup_liblinks(blender)
@@ -966,13 +1045,14 @@ setup_liblinks(blender)
 # Setup launcher
 
 if(WIN32 AND NOT WITH_PYTHON_MODULE)
-       set(LAUNCHER_SRC
-               creator_launch_win.c
-               ../icons/winblender.rc
+       install(
+               TARGETS blender
+               COMPONENT Blender
+               DESTINATION "."
+       )
+       set_target_properties(
+               blender
+               PROPERTIES
+                       VS_USER_PROPS "blender.Cpp.user.props"
        )
-       add_executable(blender-launcher ${LAUNCHER_SRC})
-       target_link_libraries(blender-launcher bf_intern_utfconv ${PLATFORM_LINKLIBS})
-
-       set_target_properties(blender PROPERTIES OUTPUT_NAME blender-app)
-       set_target_properties(blender-launcher PROPERTIES OUTPUT_NAME blender)
 endif()