forked from bartvdbraak/blender
OSX: fix player bundle_creation
This commit is contained in:
parent
768806adc0
commit
7ba71fff8c
@ -63,8 +63,18 @@ if(WIN32 AND NOT UNIX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc)
|
add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc)
|
||||||
|
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
add_executable(blenderplayer MACOSX_BUNDLE ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
|
add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
|
||||||
|
# setup Info.plist
|
||||||
|
execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
set(PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
|
||||||
|
set(PLAYER_SOURCEINFO ${PLAYER_SOURCEDIR}/Contents/Info.plist)
|
||||||
|
set_target_properties(blenderplayer PROPERTIES
|
||||||
|
MACOSX_BUNDLE_INFO_PLIST ${PLAYER_SOURCEINFO}
|
||||||
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
|
||||||
|
MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
|
||||||
|
|
||||||
else()
|
else()
|
||||||
add_executable(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
|
add_executable(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
|
||||||
endif()
|
endif()
|
||||||
|
@ -713,40 +713,66 @@ elseif(APPLE)
|
|||||||
# install blenderplayer bundle - copy of blender.app above. re-using macros et al
|
# 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
|
# note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
|
||||||
if(WITH_GAMEENGINE AND WITH_PLAYER)
|
if(WITH_GAMEENGINE AND WITH_PLAYER)
|
||||||
set(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
|
set(PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
|
||||||
set(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist)
|
set(PLAYER_SOURCEINFO ${PLAYER_SOURCEDIR}/Contents/Info.plist)
|
||||||
set(TARGETDIR_VER ${TARGETDIR}/blenderplayer.app/Contents/MacOS/${BLENDER_VERSION})
|
set(PLAYER_TARGETDIR_VER ${TARGETDIR}/blenderplayer.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.
|
# important to make a clean install each time else old scripts get loaded.
|
||||||
install(
|
install(
|
||||||
CODE
|
CODE
|
||||||
"file(REMOVE_RECURSE ${TARGETDIR_VER})"
|
"file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})"
|
||||||
)
|
)
|
||||||
|
|
||||||
# message after building.
|
|
||||||
add_custom_command(
|
# handy install macro to exclude files, we use \$ escape for the "to"
|
||||||
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
|
# argument when calling so ${BUILD_TYPE} does not get expanded
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files & scripts to ${TARGETDIR_VER}'
|
macro(install_dir from to)
|
||||||
|
install(
|
||||||
|
DIRECTORY ${from}
|
||||||
|
DESTINATION ${to}
|
||||||
|
PATTERN ".svn" EXCLUDE
|
||||||
|
PATTERN "*.pyc" EXCLUDE
|
||||||
|
PATTERN "*.pyo" EXCLUDE
|
||||||
|
PATTERN "*.orig" EXCLUDE
|
||||||
|
PATTERN "*.rej" EXCLUDE
|
||||||
|
PATTERN "__pycache__" EXCLUDE
|
||||||
|
PATTERN "__MACOSX" EXCLUDE
|
||||||
|
PATTERN ".DS_Store" EXCLUDE
|
||||||
)
|
)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
install(
|
install(
|
||||||
FILES ${SOURCEDIR}/Contents/PkgInfo
|
FILES ${PLAYER_SOURCEDIR}/Contents/PkgInfo
|
||||||
DESTINATION ${TARGETDIR}/blenderplayer.app/Contents
|
DESTINATION ${TARGETDIR}/blenderplayer.app/Contents
|
||||||
)
|
)
|
||||||
|
|
||||||
install_dir(
|
install_dir(
|
||||||
${SOURCEDIR}/Contents/Resources
|
${PLAYER_SOURCEDIR}/Contents/Resources
|
||||||
\${TARGETDIR}/blenderplayer.app/Contents/
|
\${TARGETDIR}/blenderplayer.app/Contents/
|
||||||
)
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf
|
||||||
|
DESTINATION ${PLAYER_TARGETDIR_VER}
|
||||||
|
)
|
||||||
|
|
||||||
|
# localization
|
||||||
|
if(WITH_INTERNATIONAL)
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages
|
||||||
|
DESTINATION ${PLAYER_TARGETDIR_VER}/datafiles
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
DIRECTORY
|
||||||
|
${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
|
||||||
|
${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
|
||||||
|
DESTINATION ${PLAYER_TARGETDIR_VER}/datafiles
|
||||||
|
PATTERN ".svn" EXCLUDE
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# python
|
# python
|
||||||
if(WITH_PYTHON)
|
if(WITH_PYTHON)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
@ -759,7 +785,7 @@ elseif(APPLE)
|
|||||||
# copy extracted python files
|
# copy extracted python files
|
||||||
install_dir(
|
install_dir(
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/python
|
${CMAKE_CURRENT_BINARY_DIR}/python
|
||||||
\${TARGETDIR_VER}
|
\${PLAYER_TARGETDIR_VER}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user