diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-18 09:06:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-18 09:06:53 +0400 |
commit | 5600d214f1f2f05e98fd6f4d5f86bdff01e8b3f8 (patch) | |
tree | dc35ebf81c9d424e9136e754d71e86146273d9d2 /source/creator | |
parent | 8a8566c8949f851cda3644073d1bff60b43b5abd (diff) | |
parent | c6c6a3578beae28a6c6c0164757ebbb694e7f816 (diff) |
svn merge ^/trunk/blender -r41939:41954
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/CMakeLists.txt | 181 |
1 files changed, 85 insertions, 96 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 5f6b6255b68..d0bbd9db45a 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -233,10 +233,6 @@ else() set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}) endif() - -# ----------------------------------------------------------------------------- -# Install Targets - set(BLENDER_TEXT_FILES ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt @@ -244,8 +240,11 @@ set(BLENDER_TEXT_FILES ${CMAKE_SOURCE_DIR}/release/text/readme.html ) -if(UNIX AND NOT APPLE) +# ----------------------------------------------------------------------------- +# Platform Spesific Var: TARGETDIR_VER + +if(UNIX AND NOT APPLE) if(WITH_INSTALL_PORTABLE) set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION}) else() @@ -256,18 +255,71 @@ if(UNIX AND NOT APPLE) endif() endif() - # important to make a clean install each time - # else old scripts get loaded. +elseif(WIN32) + set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION}) + +elseif(APPLE) + set(TARGETDIR_VER ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION}) + +endif() + + +# ----------------------------------------------------------------------------- +# Install Targets (Generic, All Platforms) + + +# important to make a clean install each time, else old scripts get loaded. +install( + CODE + "file(REMOVE_RECURSE ${TARGETDIR_VER})" +) + +if(WITH_PYTHON) + # install(CODE "message(\"copying blender scripts...\")") + + # exclude addons_contrib if release + if("${BLENDER_VERSION_CYCLE}" STREQUAL "release") + set(ADDON_EXCLUDE_CONDITIONAL "addons_contrib/*") + else() + set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*") # dummy, wont do anything + endif() + install( - CODE - "file(REMOVE_RECURSE ${TARGETDIR_VER})" + DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts + DESTINATION ${TARGETDIR_VER} + PATTERN ".svn" EXCLUDE + PATTERN "__pycache__" EXCLUDE + PATTERN "${ADDON_EXCLUDE_CONDITIONAL}" EXCLUDE ) + + unset(ADDON_EXCLUDE_CONDITIONAL) +endif() +# localization +if(WITH_INTERNATIONAL) + install( + DIRECTORY + ${CMAKE_SOURCE_DIR}/release/datafiles/locale + ${CMAKE_SOURCE_DIR}/release/datafiles/fonts + DESTINATION ${TARGETDIR_VER}/datafiles + PATTERN ".svn" EXCLUDE + ) +endif() + +# helpful tip when using make +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 & scripts to ${TARGETDIR_VER}' ) +endif() + + +# ----------------------------------------------------------------------------- +# Install Targets (Platform Specific) + +if(UNIX AND NOT APPLE) # there are a few differences between portable and system install if(WITH_INSTALL_PORTABLE) @@ -348,16 +400,6 @@ if(UNIX AND NOT APPLE) ) endif() - if(WITH_INTERNATIONAL) - install( - DIRECTORY - ${CMAKE_SOURCE_DIR}/release/datafiles/locale - ${CMAKE_SOURCE_DIR}/release/datafiles/fonts - DESTINATION ${TARGETDIR_VER}/datafiles - PATTERN ".svn" EXCLUDE - ) - endif() - # plugins in blender 2.5 don't work at the moment. # # install( @@ -367,14 +409,6 @@ if(UNIX AND NOT APPLE) # ) if(WITH_PYTHON) - # install(CODE "message(\"copying blender scripts...\")") - install( - DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts - DESTINATION ${TARGETDIR_VER} - PATTERN ".svn" EXCLUDE - PATTERN "__pycache__" EXCLUDE - ) - if(WITH_PYTHON_INSTALL) # Copy the systems python into the install directory # Scons copy in tools/Blender.py @@ -403,27 +437,12 @@ if(UNIX AND NOT APPLE) endif() elseif(WIN32) - set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION}) - - install( # same as linux!, deduplicate - CODE - "file(REMOVE_RECURSE ${TARGETDIR_VER})" - ) - - install( # same as linux!, deduplicate + install( FILES ${BLENDER_TEXT_FILES} DESTINATION ${TARGETDIR} ) - if(WITH_INTERNATIONAL) # same as linux!, deduplicate - install( - DIRECTORY - ${CMAKE_SOURCE_DIR}/release/datafiles/locale - ${CMAKE_SOURCE_DIR}/release/datafiles/fonts - DESTINATION ${TARGETDIR_VER}/datafiles - PATTERN ".svn" EXCLUDE - ) - + if(WITH_INTERNATIONAL) install( FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll DESTINATION ${TARGETDIR} @@ -446,13 +465,6 @@ elseif(WIN32) # ) if(WITH_PYTHON) - # install(CODE "message(\"copying blender scripts...\")") - install( # same as linux!, deduplicate - DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts - DESTINATION ${TARGETDIR_VER} - PATTERN ".svn" EXCLUDE - PATTERN "__pycache__" EXCLUDE - ) install( FILES ${LIBDIR}/python/lib/python32.dll @@ -584,29 +596,6 @@ elseif(WIN32) endif() elseif(APPLE) - set(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app) - set(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist) - set(TARGETDIR_VER ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION}) - - # setup Info.plist - execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) - - set_target_properties(blender PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${SOURCEINFO} - MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION} - MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}") - - # important to make a clean install each time else old scripts get loaded. - install( - CODE - "file(REMOVE_RECURSE ${TARGETDIR_VER})" - ) - - # 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 & scripts to ${TARGETDIR_VER}' - ) # handy install macro to exclude files, we use \$ escape for the "to" # argument when calling so ${BUILD_TYPE} does not get expanded @@ -625,6 +614,17 @@ elseif(APPLE) ) endmacro() + set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app) + + # setup Info.plist + 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}") + + # install release and app files install( FILES ${BLENDER_TEXT_FILES} @@ -632,26 +632,15 @@ elseif(APPLE) ) install( - FILES ${SOURCEDIR}/Contents/PkgInfo + FILES ${OSX_APP_SOURCEDIR}/Contents/PkgInfo DESTINATION ${TARGETDIR}/blender.app/Contents ) install_dir( - ${SOURCEDIR}/Contents/Resources + ${OSX_APP_SOURCEDIR}/Contents/Resources \${TARGETDIR}/blender.app/Contents/ ) - # localization - if(WITH_INTERNATIONAL) - install( - DIRECTORY - ${CMAKE_SOURCE_DIR}/release/datafiles/locale - ${CMAKE_SOURCE_DIR}/release/datafiles/fonts - DESTINATION ${TARGETDIR_VER}/datafiles - PATTERN ".svn" EXCLUDE - ) - endif() - # python if(WITH_PYTHON) # the python zip is first extract as part of the build process, @@ -678,18 +667,13 @@ elseif(APPLE) \${TARGETDIR_VER} ) - # copy scripts - install_dir( - ${CMAKE_SOURCE_DIR}/release/scripts - \${TARGETDIR_VER} - ) 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(PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app) - set(PLAYER_SOURCEINFO ${PLAYER_SOURCEDIR}/Contents/Info.plist) + set(OSX_APP_PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app) + set(PLAYER_SOURCEINFO ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Info.plist) set(PLAYER_TARGETDIR_VER ${TARGETDIR}/blenderplayer.app/Contents/MacOS/${BLENDER_VERSION}) @@ -700,12 +684,12 @@ elseif(APPLE) ) install( - FILES ${PLAYER_SOURCEDIR}/Contents/PkgInfo + FILES ${OSX_APP_PLAYER_SOURCEDIR}/Contents/PkgInfo DESTINATION ${TARGETDIR}/blenderplayer.app/Contents ) install_dir( - ${PLAYER_SOURCEDIR}/Contents/Resources + ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Resources \${TARGETDIR}/blenderplayer.app/Contents/ ) @@ -728,6 +712,11 @@ elseif(APPLE) endif() endif() +# ----------------------------------------------------------------------------- +# Generic Install, for all targets + + + # install more files specified elsewhere delayed_do_install(${TARGETDIR_VER}) |