From: Neal Gompa Date: Sun, 16 May 2010 02:15:57 +0000 (-0500) Subject: Made massive change to CMake scripts. Hopefully now CMake scripts will produce workin... X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=commitdiff_plain;h=19c46ec32d17761dae92c26428102ff58983c31e Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index cdc4e15..aafeabb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,14 @@ if(MINGW) 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 @@ -117,29 +125,29 @@ if(WIN32) 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) @@ -152,7 +160,7 @@ if(WIN32) set(LUGARU_H ${LUGARU_H} ${SRCDIR}/WinDefs.h - ${SRCDIR}/res/resource.h) + ${SRCDIR}/win-res/resource.h) endif(WIN32) if (APPLE) @@ -457,6 +465,16 @@ if (NOT OGGVORBIS_FOUND) ) 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} @@ -488,6 +506,12 @@ else(WIN32) 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) @@ -503,6 +527,11 @@ if(WIN32) 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}) diff --git a/Source/mac-res/Info.plist b/Source/mac-res/Info.plist new file mode 100644 index 0000000..dccd26b --- /dev/null +++ b/Source/mac-res/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + lugaru + CFBundleIconFile + lugaru.icns + CFBundleIdentifier + com.wolfire.Lugaru + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Lugaru: The Rabbit's Foot + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleShortVersionString + 1.1 + LSMinimumSystemVersion + 10.5.0 + CFBundleVersion + 1 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/Source/mac-res/lugaru.icns b/Source/mac-res/lugaru.icns new file mode 100644 index 0000000..b3c918a Binary files /dev/null and b/Source/mac-res/lugaru.icns differ diff --git a/Source/res/Lugaru.aps b/Source/res/Lugaru.aps deleted file mode 100644 index 91455a8..0000000 Binary files a/Source/res/Lugaru.aps and /dev/null differ diff --git a/Source/res/Lugaru.png b/Source/res/Lugaru.png deleted file mode 100644 index 1db3a89..0000000 Binary files a/Source/res/Lugaru.png and /dev/null differ diff --git a/Source/res/Lugaru.psd b/Source/res/Lugaru.psd deleted file mode 100644 index e3802af..0000000 Binary files a/Source/res/Lugaru.psd and /dev/null differ diff --git a/Source/res/Lugaru.rc b/Source/res/Lugaru.rc deleted file mode 100644 index dd30038..0000000 --- a/Source/res/Lugaru.rc +++ /dev/null @@ -1,72 +0,0 @@ -// 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 - diff --git a/Source/res/Untitled-1.jpg b/Source/res/Untitled-1.jpg deleted file mode 100644 index 8622136..0000000 Binary files a/Source/res/Untitled-1.jpg and /dev/null differ diff --git a/Source/res/icon1.ico b/Source/res/icon1.ico deleted file mode 100644 index 9d0e916..0000000 Binary files a/Source/res/icon1.ico and /dev/null differ diff --git a/Source/res/icon2.ico b/Source/res/icon2.ico deleted file mode 100644 index 659202e..0000000 Binary files a/Source/res/icon2.ico and /dev/null differ diff --git a/Source/res/lugaru.ico b/Source/res/lugaru.ico deleted file mode 100644 index 5a2895e..0000000 Binary files a/Source/res/lugaru.ico and /dev/null differ diff --git a/Source/res/resource.h b/Source/res/resource.h deleted file mode 100644 index b07c562..0000000 --- a/Source/res/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{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 diff --git a/Source/win-res/Lugaru.aps b/Source/win-res/Lugaru.aps new file mode 100644 index 0000000..91455a8 Binary files /dev/null and b/Source/win-res/Lugaru.aps differ diff --git a/Source/win-res/Lugaru.png b/Source/win-res/Lugaru.png new file mode 100644 index 0000000..1db3a89 Binary files /dev/null and b/Source/win-res/Lugaru.png differ diff --git a/Source/win-res/Lugaru.psd b/Source/win-res/Lugaru.psd new file mode 100644 index 0000000..e3802af Binary files /dev/null and b/Source/win-res/Lugaru.psd differ diff --git a/Source/win-res/Lugaru.rc b/Source/win-res/Lugaru.rc new file mode 100644 index 0000000..dd30038 --- /dev/null +++ b/Source/win-res/Lugaru.rc @@ -0,0 +1,72 @@ +// 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 + diff --git a/Source/win-res/Untitled-1.jpg b/Source/win-res/Untitled-1.jpg new file mode 100644 index 0000000..8622136 Binary files /dev/null and b/Source/win-res/Untitled-1.jpg differ diff --git a/Source/win-res/icon1.ico b/Source/win-res/icon1.ico new file mode 100644 index 0000000..9d0e916 Binary files /dev/null and b/Source/win-res/icon1.ico differ diff --git a/Source/win-res/icon2.ico b/Source/win-res/icon2.ico new file mode 100644 index 0000000..659202e Binary files /dev/null and b/Source/win-res/icon2.ico differ diff --git a/Source/win-res/lugaru.ico b/Source/win-res/lugaru.ico new file mode 100644 index 0000000..5a2895e Binary files /dev/null and b/Source/win-res/lugaru.ico differ diff --git a/Source/win-res/resource.h b/Source/win-res/resource.h new file mode 100644 index 0000000..b07c562 --- /dev/null +++ b/Source/win-res/resource.h @@ -0,0 +1,16 @@ +//{{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