set(OPENGL_glu_LIBRARY "-lglu32" CACHE STRING "GLU library for Win32" FORCE)
endif(MINGW)
+if(APPLE)
+ set(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING
+ "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value" FORCE)
+ set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk" CACHE PATH
+ "The product will be built against the headers and libraries located inside the indicated SDK." FORCE)
+endif(APPLE)
+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(LUGARU_SRCS
if(CMAKE_CROSSCOMPILING)
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
COMMAND i686-pc-mingw32-windres
- -I${SRCDIR}/res
+ -I${SRCDIR}/win-res
-o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
- -i${SRCDIR}/res/Lugaru.rc
- DEPENDS ${SRCDIR}/res/Lugaru.rc
+ -i${SRCDIR}/win-res/Lugaru.rc
+ DEPENDS ${SRCDIR}/win-res/Lugaru.rc
)
endif(CMAKE_CROSSCOMPILING)
if(NOT CMAKE_CROSSCOMPILING)
if(MSVC)
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
COMMAND rc
- -I${SRCDIR}/res
+ -I${SRCDIR}/win-res
-fo${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
- ${SRCDIR}/res/Lugaru.rc
- DEPENDS ${SRCDIR}/res/Lugaru.rc
+ ${SRCDIR}/win-res/Lugaru.rc
+ DEPENDS ${SRCDIR}/win-res/Lugaru.rc
)
endif(MSVC)
if(MINGW)
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
COMMAND windres
- -I${SRCDIR}/res
+ -I${SRCDIR}/win-res
-o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
- -i${SRCDIR}/res/Lugaru.rc
- DEPENDS ${SRCDIR}/res/Lugaru.rc
+ -i${SRCDIR}/win-res/Lugaru.rc
+ DEPENDS ${SRCDIR}/win-res/Lugaru.rc
)
endif(MINGW)
endif(NOT CMAKE_CROSSCOMPILING)
set(LUGARU_H
${LUGARU_H}
${SRCDIR}/WinDefs.h
- ${SRCDIR}/res/resource.h)
+ ${SRCDIR}/win-res/resource.h)
endif(WIN32)
if (APPLE)
)
endif (NOT OGGVORBIS_FOUND)
+if(APPLE)
+ # Save our sanity; Set all available libraries to internal by default
+ set(LUGARU_FORCE_INTERNAL_SDL True)
+ set(LUGARU_FORCE_INTERNAL_GLU True)
+ set(LUGARU_FORCE_INTERNAL_JPEG True)
+ set(LUGARU_FORCE_INTERNAL_PNG True)
+ set(LUGARU_FORCE_INTERNAL_VORBIS True)
+ set(LUGARU_FORCE_INTERNAL_ZLIB True)
+endif(APPLE)
+
include_directories(
${OPENAL_INCLUDE_DIR}
${JPEG_INCLUDE_DIR}
endif(WIN32)
# Install target
+if(APPLE)
+ set(APPS_ROOT "${CMAKE_INSTALL_PREFIX}/Lugaru.app")
+ set(APPS_BIN "${APPS_ROOT}/Contents/MacOS")
+ set(APPS_DATA "${APPS_ROOT}/Contents/Resources")
+endif(APPLE)
+
if(WIN32)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru.exe DESTINATION ${CMAKE_INSTALL_PREFIX})
if(MSVC80)
install(FILES ${OPENALDIR}/lib/win32/mingw/OpenAL32.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
endif(MINGW)
else(WIN32)
+ if(APPLE)
+ set(CMAKE_INSTALL_PREFIX "${APPS_BIN}")
+ install(FILES ${SRCDIR}/mac-res/lugaru.icns DESTINATION ${APPS_DATA})
+ install(FILES ${SRCDIR}/mac-res/Info.plist DESTINATION ${APPS_ROOT}/Contents)
+ endif(APPLE)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_PREFIX})
if(APPLE AND LUGARU_HAS_INTERNAL_SDL)
install(FILES ${SDLDIR}/lib/macosx/libSDL-1.2.0.dylib DESTINATION ${CMAKE_INSTALL_PREFIX})
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//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>lugaru</string>
+ <key>CFBundleIconFile</key>
+ <string>lugaru.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.wolfire.Lugaru</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Lugaru: The Rabbit's Foot</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.1</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.5.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
+++ /dev/null
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_LUGARU ICON "lugaru.ico"
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
+++ /dev/null
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by Lugaru.rc
-//
-#define IDI_LUGARU 104
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 105
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1001
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
--- /dev/null
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_LUGARU ICON "lugaru.ico"
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
--- /dev/null
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by Lugaru.rc
+//
+#define IDI_LUGARU 104
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 105
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif