CMake: Proper bundle for blender binary for Mac OS X and just keep blenderplayer...
authorJacques Beuarain <jacques.beaurain@gmail.com>
Wed, 6 Dec 2006 00:28:13 +0000 (00:28 +0000)
committerJacques Beuarain <jacques.beaurain@gmail.com>
Wed, 6 Dec 2006 00:28:13 +0000 (00:28 +0000)
blenderplayer/CMakeLists.txt
source/creator/CMakeLists.txt

index 73f850b1953ac951421d59fc6f43596e1a9ea28f..3648ea46150b469dd330666bb009eced5c0007df 100644 (file)
@@ -27,6 +27,8 @@
 #
 # ***** END GPL/BL DUAL LICENSE BLOCK *****
 
+MESSAGE(STATUS "Configuring blenderplayer")
+
 SETUP_LIBDIRS()
 
 FILE(APPEND ../source/blender/makesdna/intern/dna.c "")
@@ -36,9 +38,9 @@ IF(WITH_QUICKTIME)
 ENDIF(WITH_QUICKTIME)
 
 IF(WIN32)
-  ADD_EXECUTABLE(blenderplayer ${EXETYPE} ../source/blender/makesdna/intern/dna.c ../source/icons/winblender.rc)
+  ADD_EXECUTABLE(blenderplayer ${EXETYPE} ../source/blender/makesdna/intern/dna.c ../source/icons/winplayer.rc)
 ELSE(WIN32)
-  ADD_EXECUTABLE(blenderplayer ${EXETYPE} ../source/blender/makesdna/intern/dna.c)
+  ADD_EXECUTABLE(blenderplayer ../source/blender/makesdna/intern/dna.c)
 ENDIF(WIN32)
 
 ADD_DEPENDENCIES(blenderplayer makesdna)
@@ -115,4 +117,3 @@ ELSE(UNIX)
   TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_LINK_LIBS})
 ENDIF(UNIX)
 
-MESSAGE(STATUS "Configuring blenderplayer")
index 887e664a9407a3417373206cbbccd3d675ceee61..05b221c1dff056427ecc62ee7cdc3cac4afbd433 100644 (file)
@@ -49,12 +49,41 @@ IF(WITH_QUICKTIME)
   ADD_DEFINITIONS(-DWITH_QUICKTIME)
 ENDIF(WITH_QUICKTIME)
 
+MESSAGE(STATUS "Configuring blender")
+
 IF(WIN32)
   ADD_EXECUTABLE(blender ${EXETYPE} creator.c ../blender/makesdna/intern/dna.c ../icons/winblender.rc)
 ELSE(WIN32)
   ADD_EXECUTABLE(blender ${EXETYPE} creator.c ../blender/makesdna/intern/dna.c)
 ENDIF(WIN32)
 
+IF(APPLE)
+  SET(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
+  SET(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist)
+  SET(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/blender.app)
+  SET(TARGETINFO ${TARGETDIR}/Contents/Info.plist)
+
+  ADD_CUSTOM_COMMAND(TARGET blender
+    POST_BUILD
+    MAIN_DEPENDENCY blender
+    COMMAND cp -R ${SOURCEINFO} ${TARGETDIR}/Contents/
+    COMMAND cp -R ${SOURCEDIR}/Contents/PkgInfo ${TARGETDIR}/Contents/
+    COMMAND cp -R ${SOURCEDIR}/Contents/Resources ${TARGETDIR}/Contents/
+    COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO}
+    COMMAND rm -Rf ${TARGETDIR}/Contents/MacOS/.blender
+    COMMAND mkdir ${TARGETDIR}/Contents/MacOS/.blender/
+    COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/Contents/MacOS/.blender/
+    COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/Contents/MacOS/.blender/
+    COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/Contents/Resources/
+    COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/Contents/MacOS/.blender/
+    COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/Contents/Resources/
+    COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/Contents/MacOS/.blender/
+    COMMAND find ${TARGETDIR} -name CVS -prune -exec rm -rf {} "\;"
+    COMMAND find ${TARGETDIR} -name CVS.sandboxinfo -prune -exec rm -rf {} "\;"
+    COMMAND find ${TARGETDIR} -name .DS_Store -prune -exec rm -rf {} "\;"
+  )
+ENDIF(APPLE)
+
 ADD_DEPENDENCIES(blender makesdna)
 
 SETUP_LIBLINKS(blender)
@@ -143,4 +172,3 @@ ELSE(UNIX)
   TARGET_LINK_LIBRARIES(blender ${BLENDER_LINK_LIBS})
 ENDIF(UNIX)
 
-MESSAGE(STATUS "Configuring blender")