Generate an .app bundle for OSX

Add missing SDLMain and icon/resource files to generated .xcodeproj

Now builds on Lion in XCode4 with the 10.6 SDK using LLVM-GCC4.2.

Also tested on WinXP in VS 9 2008 Professional, I don't appear to have
broken anything there, stuff like MACOSX_BUNDLE_INFO_PLIST is
effectively ignored.
This commit is contained in:
spiral 2011-12-28 16:36:02 +00:00 committed by Daniel Gibson
parent 0d01f4f90b
commit 4740b5b2be

View file

@ -616,6 +616,13 @@ set(src_stub_util sys/stub/util_stub.cpp)
set(src_sys_dedicated sys/linux/dedicated.cpp)
if (APPLE)
set(OSX_RESOURCE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/sys/osx/Doom3.icns"
"${CMAKE_CURRENT_SOURCE_DIR}/sys/osx/Doom 3.rsrc"
)
set_source_files_properties(${OSX_RESOURCE_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(src_sys_base
sys/cpu.cpp
sys/threads.cpp
@ -631,6 +638,8 @@ if (APPLE)
sys/glimp_ati_fragment_shader.cpp
sys/osx/DOOMController.mm
sys/osx/macosx_misc.mm
sys/osx/SDLMain.m
${OSX_RESOURCE_FILES}
)
elseif (WIN32)
set(src_sys_base
@ -676,7 +685,7 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT MING
endif()
if (CORE)
add_executable(doom3 WIN32
add_executable(doom3 WIN32 MACOSX_BUNDLE
${src_core}
${src_sys_base}
${src_sys_core}
@ -684,6 +693,7 @@ if (CORE)
set_target_properties(doom3 PROPERTIES COMPILE_DEFINITIONS "__DOOM_DLL__")
set_target_properties(doom3 PROPERTIES LINK_FLAGS "${ldflags}")
set_target_properties(doom3 PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/sys/osx/Info.plist)
target_link_libraries(doom3
idlib
@ -700,7 +710,7 @@ if (CORE)
endif()
if (DEDICATED)
add_executable(doom3ded WIN32
add_executable(doom3ded WIN32 MACOSX_BUNDLE
${src_core}
${src_stub_openal}
${src_stub_gl}