From: <el...@us...> - 2010-08-28 00:05:22
|
Revision: 13656 http://alleg.svn.sourceforge.net/alleg/?rev=13656&view=rev Author: elias Date: 2010-08-28 00:05:16 +0000 (Sat, 28 Aug 2010) Log Message: ----------- Fixed bug in IPhone Joystick shitdown code. Made IPhone port easier to compile despite cmake. Modified Paths: -------------- allegro/branches/4.9/CMakeLists.txt allegro/branches/4.9/README_iphone.txt allegro/branches/4.9/addons/ttf/CMakeLists.txt allegro/branches/4.9/cmake/Common.cmake allegro/branches/4.9/cmake/Toolchain-iphone.cmake allegro/branches/4.9/examples/CMakeLists.txt allegro/branches/4.9/src/iphone/iphone_joystick.m Modified: allegro/branches/4.9/CMakeLists.txt =================================================================== --- allegro/branches/4.9/CMakeLists.txt 2010-08-27 22:44:32 UTC (rev 13655) +++ allegro/branches/4.9/CMakeLists.txt 2010-08-28 00:05:16 UTC (rev 13656) @@ -268,7 +268,6 @@ set(WANT_X11 off) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") set(CMAKE_EXE_LINKER_FLAGS "-framework CoreGraphics -framework QuartzCore -framework UIKit -framework Foundation -framework CoreFoundation") - SET (CMAKE_OSX_ARCHITECTURES "armv7") endif(IPHONE) if(BORLAND) Modified: allegro/branches/4.9/README_iphone.txt =================================================================== --- allegro/branches/4.9/README_iphone.txt 2010-08-27 22:44:32 UTC (rev 13655) +++ allegro/branches/4.9/README_iphone.txt 2010-08-28 00:05:16 UTC (rev 13656) @@ -6,11 +6,19 @@ The accelerometer axes are reported as joystick axes. +Dependencies +------------ +For most things no additional dependencies besides the IPhone SDK +are needed. + +allegro5.org has pre-compiled IPhone versions of Freetype (.ttf +support), Vorbis (.ogg support) and Physfs (.zip) support. + Building -------- -In theory, byou uild like this: +In theory, you build like this: mkdir build cd build @@ -18,13 +26,15 @@ xcodebuild However, many things cannot be set up by cmake, so you have to do them -by hand: +by hand. (An Xcode project named ALLEGRO should be in your build folder +which you can open by double clicking.) Here's a list of things to +adjust: - Set per-project XCode options (like ipad/iphone target). Some things are right now set per-target from cmake so to change those you need to edit the CMakeLists.txt. - Here are some things you want to change. To do so, right-click + Here are some settings you want to change. To do so, right-click the ALLEGRO on top of the list to the left, then select "Get Info" and go to the "Build" tab. Then set them to whatever values you have there in your own IPhone projects. @@ -44,11 +54,15 @@ And cmake should pick it up if they use the standard names. -- Attach resources to a bundle. So for the demos and examples you need +- Attach resources to a bundle. For the demos and examples you need to add the data folder by hand to get them transferred to the device. The easiest way to do that is to add whatever data folder - is expected to the project as a folder reference (so it appears - blue instead of yellow). + is expected (examples/data or demos/*/data usually) to the project + as a folder reference (so it appears blue instead of yellow). - Then right click -> Get Info -> Targets. And check the targets which - need it. + Then right click the data folder and in Get Info -> Targets check the + targets which need it. + +- To make an application work as IPad application, make it the current + target then use Project->Upgrade Current Target for IPad and + rebuild. Modified: allegro/branches/4.9/addons/ttf/CMakeLists.txt =================================================================== --- allegro/branches/4.9/addons/ttf/CMakeLists.txt 2010-08-27 22:44:32 UTC (rev 13655) +++ allegro/branches/4.9/addons/ttf/CMakeLists.txt 2010-08-28 00:05:16 UTC (rev 13656) @@ -15,9 +15,9 @@ # FREETYPE_LIBRARIES should include zlib automatically if statically linking, # but it doesn't. find_package(ZLIB) -if(ZLIB_FOUND) +if(ZLIB_FOUND AND NOT IPHONE) list(APPEND FREETYPE_LIBRARIES ${ZLIB_LIBRARIES}) -endif(ZLIB_FOUND) +endif() add_our_library(allegro_ttf "${TTF_SOURCES};${TTF_INCLUDE_FILES}" Modified: allegro/branches/4.9/cmake/Common.cmake =================================================================== --- allegro/branches/4.9/cmake/Common.cmake 2010-08-27 22:44:32 UTC (rev 13655) +++ allegro/branches/4.9/cmake/Common.cmake 2010-08-28 00:05:16 UTC (rev 13656) @@ -170,6 +170,16 @@ # FIXME:We want those as project attributes, not target attributes, but I don't know how set_target_properties(${nm} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") set_target_properties(${nm} PROPERTIES XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1/2") + + # We have to add an icon to every executable on IPhone else + # cmake won't create a resource copy build phase for us. + # And re-creating those by hand would be a major pain. + set_target_properties(${nm} PROPERTIES MACOSX_BUNDLE_ICON_FILE icon.png) + + set_source_files_properties("${CMAKE_SOURCE_DIR}/misc/icon.png" PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources" + ) + endif(IPHONE) endfunction(fix_executable) @@ -201,6 +211,11 @@ if(NOT srcs) set(srcs "${nm}.c") endif(NOT srcs) + + if(IPHONE) + set(EXECUTABLE_TYPE MACOSX_BUNDLE) + set(srcs ${srcs} "${CMAKE_SOURCE_DIR}/misc/icon.png") + endif(IPHONE) add_executable(${nm} ${EXECUTABLE_TYPE} ${srcs}) target_link_libraries(${nm} ${libs}) @@ -220,6 +235,8 @@ set_target_properties(${nm} PROPERTIES LINK_FLAGS "-Wl,-subsystem,windows") endif(NOT CMAKE_BUILD_TYPE STREQUAL Debug) endif(MINGW) + + fix_executable(${nm}) endfunction(add_our_executable) # Recreate data directory for out-of-source builds. Modified: allegro/branches/4.9/cmake/Toolchain-iphone.cmake =================================================================== --- allegro/branches/4.9/cmake/Toolchain-iphone.cmake 2010-08-27 22:44:32 UTC (rev 13655) +++ allegro/branches/4.9/cmake/Toolchain-iphone.cmake 2010-08-28 00:05:16 UTC (rev 13656) @@ -4,4 +4,3 @@ SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer") SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk") SET (CMAKE_OSX_SYSROOT "${SDKROOT}") -SET (CMAKE_OSX_ARCHITECTURES "armv6;armv7") Modified: allegro/branches/4.9/examples/CMakeLists.txt =================================================================== --- allegro/branches/4.9/examples/CMakeLists.txt 2010-08-27 22:44:32 UTC (rev 13655) +++ allegro/branches/4.9/examples/CMakeLists.txt 2010-08-28 00:05:16 UTC (rev 13656) @@ -141,12 +141,12 @@ example(ex_d3d ex_d3d.cpp ${D3DX9}) endif(D3DX9) -if(SUPPORT_OPENGL) +if(SUPPORT_OPENGL AND NOT IPHONE) example(ex_gldepth ${FONT} ${IMAGE}) example(ex_glext) example(ex_opengl) example(ex_opengl_pixel_shader ${IMAGE}) -endif(SUPPORT_OPENGL) +endif(SUPPORT_OPENGL AND NOT IPHONE) example(ex_font ${FONT} ${IMAGE}) example(ex_font_justify ex_font_justify.cpp ${NIHGUI} ${IMAGE} ${TTF}) Modified: allegro/branches/4.9/src/iphone/iphone_joystick.m =================================================================== --- allegro/branches/4.9/src/iphone/iphone_joystick.m 2010-08-27 22:44:32 UTC (rev 13655) +++ allegro/branches/4.9/src/iphone/iphone_joystick.m 2010-08-28 00:05:16 UTC (rev 13656) @@ -21,6 +21,8 @@ static void ijoy_exit_joystick(void) { + _al_iphone_accelerometer_control(0); + initialized = false; } static bool ijoy_reconfigure_joysticks(void) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |