First tries w/ CMake on OS X
authorChristoph Sommer <mail@christoph-sommer.de>
Sun, 25 Nov 2007 11:52:35 +0000 (11:52 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Sun, 25 Nov 2007 11:52:35 +0000 (11:52 +0000)
SVN-Revision: 5189

CMakeLists.txt
data/images/engine/icons/supertux.icns [new file with mode: 0644]
tools/darwin/info.plist [new file with mode: 0644]

index 10dbd5a..a47a0b2 100644 (file)
@@ -64,7 +64,7 @@ MARK_AS_ADVANCED(
        APPDATADIR
 )
 OPTION(ENABLE_BINRELOC "Enable autopackage's BINRELOC features" OFF)
-SET(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "APPDATADIR for autopackage's BINRELOC features")
+SET(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/games" CACHE STRING "APPDATADIR for autopackage's BINRELOC features")
 
 ## Check endianess
 
@@ -304,7 +304,6 @@ IF(WIN32 AND NOT UNIX)
   SET(INSTALL_SUBDIR_BIN ".")
   SET(INSTALL_SUBDIR_SHARE "data/")
   SET(INSTALL_SUBDIR_DOC ".")
-  SET(INSTALL_SUBDIR_ICONS ".")
 
   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/SDL.dll DESTINATION ${INSTALL_SUBDIR_BIN})
   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/SDL_image.dll DESTINATION ${INSTALL_SUBDIR_BIN})
@@ -315,20 +314,36 @@ IF(WIN32 AND NOT UNIX)
   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/wrap_oal.dll DESTINATION ${INSTALL_SUBDIR_BIN})
   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/libcurl-4.dll DESTINATION ${INSTALL_SUBDIR_BIN})
 
+  INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.ico DESTINATION ".")
+
 ELSE(WIN32 AND NOT UNIX)
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+
+  SET(INSTALL_SUBDIR_BIN "SuperTux.app/Contents/MacOS/")
+  SET(INSTALL_SUBDIR_SHARE "SuperTux.app/Contents/Resources/data/")
+  SET(INSTALL_SUBDIR_DOC "SuperTux.app/Contents/Resources/")
+
+  INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/tools/darwin/info.plist DESTINATION "SuperTux.app/Contents/")
+
+  INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.icns DESTINATION "SuperTux.app/Contents/Resources/")
+
+ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 
   SET(INSTALL_SUBDIR_BIN "games/")
   SET(INSTALL_SUBDIR_SHARE "share/games/supertux2/")
   SET(INSTALL_SUBDIR_DOC "share/doc/supertux2/")
-  SET(INSTALL_SUBDIR_ICONS "share/pixmaps/")
 
-  INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/supertux2.desktop DESTINATION share/applications)
+  INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/supertux2.desktop DESTINATION "share/applications")
+
+  INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.xpm DESTINATION "share/pixmaps/")
 
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 ENDIF(WIN32 AND NOT UNIX)
 
 INSTALL(TARGETS supertux2 DESTINATION ${INSTALL_SUBDIR_BIN})
-INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.xpm DESTINATION ${INSTALL_SUBDIR_ICONS})
+
 INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/INSTALL ${SUPERTUX_SOURCE_DIR}/README ${SUPERTUX_SOURCE_DIR}/COPYING ${SUPERTUX_SOURCE_DIR}/WHATSNEW.txt DESTINATION ${INSTALL_SUBDIR_DOC})
+
 INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/credits.txt ${SUPERTUX_SOURCE_DIR}/data/camera.cfg DESTINATION ${INSTALL_SUBDIR_SHARE})
 INSTALL(DIRECTORY data/images DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
 INSTALL(DIRECTORY data/levels DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
@@ -344,8 +359,12 @@ INSTALL(DIRECTORY data/locale DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn"
 INCLUDE(InstallRequiredSystemLibraries)
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SuperTux")
 SET(CPACK_PACKAGE_VENDOR "SuperTux Devel Team")
-SET(CPACK_PACKAGE_DESCRIPTION_FILE "${SUPERTUX_SOURCE_DIR}/README")
-SET(CPACK_RESOURCE_FILE_LICENSE "${SUPERTUX_SOURCE_DIR}/COPYING")
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+  # The OS X PackageMaker doesn't seem to like files with no extension
+ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+  SET(CPACK_PACKAGE_DESCRIPTION_FILE "${SUPERTUX_SOURCE_DIR}/README")
+  SET(CPACK_RESOURCE_FILE_LICENSE "${SUPERTUX_SOURCE_DIR}/COPYING")
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 SET(CPACK_PACKAGE_VERSION_MAJOR "0")
 SET(CPACK_PACKAGE_VERSION_MINOR "3")
 SET(CPACK_PACKAGE_VERSION_PATCH "1-SVN")
diff --git a/data/images/engine/icons/supertux.icns b/data/images/engine/icons/supertux.icns
new file mode 100644 (file)
index 0000000..81a50c3
Binary files /dev/null and b/data/images/engine/icons/supertux.icns differ
diff --git a/tools/darwin/info.plist b/tools/darwin/info.plist
new file mode 100644 (file)
index 0000000..61f7c01
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>English</string>
+       <key>CFBundleExecutable</key>
+       <string>supertux2</string>
+       <key>CFBundleIconFile</key>
+       <string>supertux</string>
+       <key>CFBundleIdentifier</key>
+       <string>de.berlios.supertux</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>SuperTux</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
+       <key>CFBundleSignature</key>
+       <string>STUX</string>
+       <key>CFBundleVersion</key>
+       <string>0.3.1-SVN</string>
+       <key>NSMainNibFile</key>
+       <string>SDLMain</string>
+       <key>NSPrincipalClass</key>
+       <string>NSApplication</string>
+</dict>
+</plist>