update to build system excluding parts of the python bundle.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 26 May 2011 11:45:25 +0000 (11:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 26 May 2011 11:45:25 +0000 (11:45 +0000)
build_files/scons/tools/Blender.py
source/creator/CMakeLists.txt

index 4bfa1851acb1853998ffb659496eed0f7632527b..8dbed82ed84a54de44a9ec6d639a9011c5d71797 100644 (file)
@@ -449,10 +449,16 @@ def WinPyBundle(target=None, source=None, env=None):
     shutil.rmtree(py_target, False, printexception)
     exclude_re=[re.compile('.*/test/.*'),
                 re.compile('^config/.*'),
+                re.compile('^config-*/.*'),
                 re.compile('^distutils/.*'),
                 re.compile('^idlelib/.*'),
                 re.compile('^lib2to3/.*'),
-                re.compile('^tkinter/.*')]
+                re.compile('^tkinter/.*'),
+                re.compile('^_tkinter_d.pyd'),
+                re.compile('^turtledemo'),
+                re.compile('^turtle.py'),
+                ]
+
     print "Unpacking '" + py_tar + "' to '" + py_target + "'"
     untar_pybundle(py_tar,py_target,exclude_re)
 
@@ -569,17 +575,17 @@ def UnixPyBundle(target=None, source=None, env=None):
     run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target)))
     run("rm -rf '%s/distutils'" % py_target)
     run("rm -rf '%s/lib2to3'" % py_target)
-    run("rm -rf '%s/idlelib'" % py_target)
-    run("rm -rf '%s/tkinter'" % py_target)
     run("rm -rf '%s/config'" % py_target)
-
+    run("rm -rf '%s/config-*'" % py_target)
     run("rm -rf '%s/site-packages'" % py_target)
     run("mkdir '%s/site-packages'" % py_target)    # python needs it.'
-
+    run("rm -rf '%s/idlelib'" % py_target)
+    run("rm -rf '%s/tkinter'" % py_target)
+    run("rm -rf '%s/turtledemo'" % py_target)
+    run("rm -r '%s/turtle.py'" % py_target)
     run("rm -f '%s/lib-dynload/_tkinter.so'" % py_target)
+
     run("find '%s' -type d -name 'test' -prune -exec rm -rf {} ';'" % py_target)
-    run("find '%s' -type d -name 'config-*' -prune -exec rm -rf {} ';'" % py_target)
-    run("find '%s' -type d -name 'turtledemo' -prune -exec rm -rf {} ';'" % py_target)
     run("find '%s' -type d -name '__pycache__' -exec rm -rf {} ';'" % py_target)
     run("find '%s' -name '*.py[co]' -exec rm -rf {} ';'" % py_target)
     run("find '%s' -name '*.so' -exec strip -s {} ';'" % py_target)
index 06b8d4dececc5017ab7d9c08c32e3e2dfe6550da..289a625ac59f5cdec447a3fdabe6a214e89d2034 100644 (file)
@@ -193,8 +193,8 @@ if(WITH_PYTHON_MODULE)
                PROPERTIES
                                PREFIX ""
                                OUTPUT_NAME bpy
-                               LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
-                               RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/  # only needed on windows
+                               LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
+                               RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin  # only needed on windows
        )
        
        if(WIN32)
@@ -270,7 +270,7 @@ if(UNIX AND NOT APPLE)
                )
 
                install(
-                       DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/
+                       DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
                        DESTINATION ${TARGETDIR}
                        PATTERN ".svn" EXCLUDE
                )
@@ -317,7 +317,7 @@ 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 ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
                        PATTERN ".svn" EXCLUDE
                        PATTERN "*.svg" EXCLUDE
                )
@@ -334,7 +334,7 @@ if(UNIX AND NOT APPLE)
                        DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
                )
                install(
-                       DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/
+                       DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
                        DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
                        PATTERN ".svn" EXCLUDE
                )
@@ -353,7 +353,7 @@ if(UNIX AND NOT APPLE)
 
                install(
                        DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
-                       DESTINATION ${TARGETDIR_VER}/datafiles/
+                       DESTINATION ${TARGETDIR_VER}/datafiles
                        PATTERN ".svn" EXCLUDE
                )
        endif()
@@ -362,7 +362,7 @@ if(UNIX AND NOT APPLE)
                #
                # install(
                #       DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins
-               #       DESTINATION ${TARGETDIR_VER}/
+               #       DESTINATION ${TARGETDIR_VER}
                #       PATTERN ".svn" EXCLUDE
                # )
 
@@ -370,7 +370,7 @@ if(UNIX AND NOT APPLE)
                # install(CODE "message(\"copying blender scripts...\")")
                install(
                        DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts
-                       DESTINATION ${TARGETDIR_VER}/
+                       DESTINATION ${TARGETDIR_VER}
                        PATTERN ".svn" EXCLUDE
                        PATTERN "__pycache__" EXCLUDE
                )
@@ -381,9 +381,9 @@ if(UNIX AND NOT APPLE)
                        # install(CODE "message(\"copying a subset of the systems python...\")")
                        install(
                                DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION}
-                               DESTINATION ${TARGETDIR_VER}/python/lib/
+                               DESTINATION ${TARGETDIR_VER}/python/lib
                                PATTERN ".svn" EXCLUDE
-                               PATTERN "__pycache__" EXCLUDE               # ./distutils
+                               PATTERN "__pycache__" EXCLUDE               # * any cache *
                                PATTERN "distutils" EXCLUDE                 # ./distutils
                                PATTERN "lib2to3" EXCLUDE                   # ./lib2to3
                                PATTERN "config" EXCLUDE                    # ./config
@@ -391,8 +391,10 @@ if(UNIX AND NOT APPLE)
                                PATTERN "site-packages/*" EXCLUDE           # ./site-packages/*
                                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
                        )
 
                        # # doesnt work, todo
@@ -409,8 +411,8 @@ elseif(WIN32)
        )
 
        install(  # same as linux!, deduplicate
-               DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/
-               DESTINATION ${TARGETDIR}/
+               DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
+               DESTINATION ${TARGETDIR}
                PATTERN ".svn" EXCLUDE
        )
 
@@ -426,25 +428,25 @@ elseif(WIN32)
                )
                install(
                        DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
-                       DESTINATION ${TARGETDIR_VER}/datafiles/
+                       DESTINATION ${TARGETDIR_VER}/datafiles
                        PATTERN ".svn" EXCLUDE
                )
 
                if(NOT CMAKE_CL_64)
                        install(
                                FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll
-                               DESTINATION ${TARGETDIR}/
+                               DESTINATION ${TARGETDIR}
                        )
 
                        install(
                                FILES ${LIBDIR}/iconv/lib/iconv.dll
-                               DESTINATION ${TARGETDIR}/
+                               DESTINATION ${TARGETDIR}
                        )
                endif()
        endif()
 
        install( # same as linux!, deduplicate
-               DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale/
+               DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
                DESTINATION ${TARGETDIR_VER}/datafiles/locale
                PATTERN ".svn" EXCLUDE
        )
@@ -453,7 +455,7 @@ elseif(WIN32)
        #
        # install(
        #       DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins
-       #       DESTINATION ${TARGETDIR_VER}/
+       #       DESTINATION ${TARGETDIR_VER}
        #       PATTERN ".svn" EXCLUDE
        # )
 
@@ -461,19 +463,19 @@ elseif(WIN32)
                # install(CODE "message(\"copying blender scripts...\")")
                install(  # same as linux!, deduplicate
                        DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts
-                       DESTINATION ${TARGETDIR_VER}/
+                       DESTINATION ${TARGETDIR_VER}
                        PATTERN ".svn" EXCLUDE
                        PATTERN "__pycache__" EXCLUDE
                )
 
                # TODO, multiple targets?
-               install(FILES ${LIBDIR}/python/lib/python32.dll DESTINATION ${TARGETDIR}/ CONFIGURATIONS Release)
-               install(FILES ${LIBDIR}/python/lib/python32.dll DESTINATION ${TARGETDIR}/ CONFIGURATIONS RelWithDebInfo)
-               install(FILES ${LIBDIR}/python/lib/python32.dll DESTINATION ${TARGETDIR}/ CONFIGURATIONS MinSizeRel)
+               install(FILES ${LIBDIR}/python/lib/python32.dll DESTINATION ${TARGETDIR} CONFIGURATIONS Release)
+               install(FILES ${LIBDIR}/python/lib/python32.dll DESTINATION ${TARGETDIR} CONFIGURATIONS RelWithDebInfo)
+               install(FILES ${LIBDIR}/python/lib/python32.dll DESTINATION ${TARGETDIR} CONFIGURATIONS MinSizeRel)
 
                install(
                        FILES ${LIBDIR}/python/lib/python32_d.dll
-                       DESTINATION ${TARGETDIR}/
+                       DESTINATION ${TARGETDIR}
                        CONFIGURATIONS Debug
                )
 
@@ -485,8 +487,8 @@ elseif(WIN32)
                                CODE
                                "
                                message(\"creating ${TARGETDIR_VER}/python/lib\")
-                               file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python/\")
-                               file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python/lib/\")
+                               file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python\")
+                               file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python/lib\")
                                message(\"done creating dir\")
                                "
                        )
@@ -494,7 +496,7 @@ elseif(WIN32)
                        install(
                                CODE
                                "
-                               execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib/\"
+                               execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
                                        \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32.tar.gz\")
                                "
                                CONFIGURATIONS Release
@@ -502,7 +504,7 @@ elseif(WIN32)
                        install(
                                CODE
                                "
-                               execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib/\"
+                               execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
                                        \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32.tar.gz\")
                                "
                                CONFIGURATIONS RelWithDebInfo
@@ -510,7 +512,7 @@ elseif(WIN32)
                        install(
                                CODE
                                "
-                               execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib/\"
+                               execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
                                        \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32.tar.gz\")
                                "
                                CONFIGURATIONS MinSizeRel
@@ -518,7 +520,7 @@ elseif(WIN32)
                        install(
                                CODE
                                "
-                               execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib/\"
+                               execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
                                        \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32_d.tar.gz\")
                                "
                                CONFIGURATIONS Debug
@@ -533,26 +535,26 @@ elseif(WIN32)
                # gettext and png are statically linked on win64
                install(
                        FILES ${LIBDIR}/zlib/lib/zlib.dll
-                       DESTINATION ${TARGETDIR}/
+                       DESTINATION ${TARGETDIR}
                )
        else()
                install(
                        FILES
                        ${LIBDIR}/png/lib/libpng.dll
                        ${LIBDIR}/zlib/lib/zlib.dll
-                       DESTINATION ${TARGETDIR}/
+                       DESTINATION ${TARGETDIR}
                )
        endif()
 
        if(MSVC)
                install(
                        FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll
-                       DESTINATION ${TARGETDIR}/
+                       DESTINATION ${TARGETDIR}
                )
        else()
                install(
                        FILES ${LIBDIR}/pthreads/lib/pthreadGC2.dll
-                       DESTINATION ${TARGETDIR}/
+                       DESTINATION ${TARGETDIR}
                )
        endif()
 
@@ -564,7 +566,7 @@ elseif(WIN32)
                        ${LIBDIR}/ffmpeg/lib/avdevice-52.dll
                        ${LIBDIR}/ffmpeg/lib/avutil-50.dll
                        ${LIBDIR}/ffmpeg/lib/swscale-0.dll
-                       DESTINATION ${TARGETDIR}/
+                       DESTINATION ${TARGETDIR}
                )
 
        endif()
@@ -573,7 +575,7 @@ elseif(WIN32)
                install(
                        FILES
                        ${LIBDIR}/sndfile/lib/libsndfile-1.dll
-                       DESTINATION ${TARGETDIR}/
+                       DESTINATION ${TARGETDIR}
                )
        endif()
 
@@ -582,7 +584,7 @@ elseif(WIN32)
                        FILES
                        ${LIBDIR}/openal/lib/OpenAL32.dll
                        ${LIBDIR}/openal/lib/wrap_oal.dll
-                       DESTINATION ${TARGETDIR}/
+                       DESTINATION ${TARGETDIR}
                )
        endif()
 
@@ -591,7 +593,7 @@ elseif(WIN32)
                        install(
                                FILES
                                ${LIBDIR}/sdl/lib/SDL.dll
-                               DESTINATION ${TARGETDIR}/
+                               DESTINATION ${TARGETDIR}
                        )
                endif()
        endif()
@@ -600,13 +602,13 @@ elseif(WIN32)
                install(
                        FILES
                        ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
-                       DESTINATION ${TARGETDIR}/
+                       DESTINATION ${TARGETDIR}
                )
        else()
                install(
                        FILES
                        ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
-                       DESTINATION ${TARGETDIR}/
+                       DESTINATION ${TARGETDIR}
                )
        endif()
 
@@ -660,7 +662,7 @@ elseif(APPLE)
 
        install(
                FILES ${SOURCEDIR}/Contents/PkgInfo
-               DESTINATION ${TARGETDIR}/blender.app/Contents/
+               DESTINATION ${TARGETDIR}/blender.app/Contents
        )
 
        install_dir(