[iOS] Removed support for examples, it was too much trouble and not as robust as true iOS App Xcode projects

This commit is contained in:
Laurent Gomila 2013-09-11 23:15:08 +02:00 committed by Jonathan De Wachter
parent 8f459cd1af
commit c35b48bcea
8 changed files with 18 additions and 74 deletions

View File

@ -28,15 +28,18 @@ set(VERSION_PATCH 0)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# add an option for choosing the build type (shared or static) # add an option for choosing the build type (shared or static)
if(IOS) if(NOT IOS)
set(BUILD_SHARED_LIBS_DEFAULT FALSE) sfml_set_option(BUILD_SHARED_LIBS TRUE BOOL "TRUE to build SFML as shared libraries, FALSE to build it as static libraries")
else() else()
set(BUILD_SHARED_LIBS_DEFAULT TRUE) set(BUILD_SHARED_LIBS FALSE)
endif() endif()
sfml_set_option(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_DEFAULT} BOOL "TRUE to build SFML as shared libraries, FALSE to build it as static libraries")
# add an option for building the examples # add an option for building the examples
sfml_set_option(SFML_BUILD_EXAMPLES FALSE BOOL "TRUE to build the SFML examples, FALSE to ignore them") if(NOT IOS)
sfml_set_option(SFML_BUILD_EXAMPLES FALSE BOOL "TRUE to build the SFML examples, FALSE to ignore them")
else()
set(SFML_BUILD_EXAMPLES FALSE)
endif()
# add an option for building the API documentation # add an option for building the API documentation
sfml_set_option(SFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it") sfml_set_option(SFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it")

View File

@ -216,11 +216,6 @@ macro(sfml_add_example target)
if(THIS_GUI_APP AND SFML_OS_WINDOWS) if(THIS_GUI_APP AND SFML_OS_WINDOWS)
add_executable(${target} WIN32 ${THIS_SOURCES}) add_executable(${target} WIN32 ${THIS_SOURCES})
target_link_libraries(${target} sfml-main) target_link_libraries(${target} sfml-main)
elseif(IOS)
add_executable(${target} MACOSX_BUNDLE ${THIS_SOURCES})
if(THIS_GUI_APP)
target_link_libraries(${target} sfml-main)
endif()
else() else()
add_executable(${target} ${THIS_SOURCES}) add_executable(${target} ${THIS_SOURCES})
endif() endif()
@ -245,32 +240,11 @@ macro(sfml_add_example target)
target_link_libraries(${target} ${THIS_DEPENDS}) target_link_libraries(${target} ${THIS_DEPENDS})
endif() endif()
# enable automatic reference counting on iOS
if (IOS)
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
endif()
# set mandatory bundle settings on iOS
if(IOS)
set_target_properties(${target} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER "com.sfml.${target}"
MACOSX_BUNDLE_BUNDLE_NAME "${target}"
MACOSX_BUNDLE_BUNDLE_EXECUTABLE_NAME "${target}"
)
endif()
# add the install rule # add the install rule
install(TARGETS ${target} install(TARGETS ${target}
RUNTIME DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples RUNTIME DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples
BUNDLE DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples) BUNDLE DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples)
# fix install rules broken in CMake (see http://public.kitware.com/Bug/view.php?id=12506)
if(IOS)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}\$ENV{EFFECTIVE_PLATFORM_NAME}/${target}.app
DESTINATION ${INSTALL_MISC_DIR}/examples/${target}
COMPONENT examples)
endif()
# install the example's source code # install the example's source code
install(FILES ${THIS_SOURCES} install(FILES ${THIS_SOURCES}
DESTINATION ${INSTALL_MISC_DIR}/examples/${target} DESTINATION ${INSTALL_MISC_DIR}/examples/${target}

View File

@ -2,16 +2,12 @@
# add the examples subdirectories # add the examples subdirectories
add_subdirectory(ftp) add_subdirectory(ftp)
add_subdirectory(opengl) add_subdirectory(opengl)
if(NOT IOS) add_subdirectory(pong)
add_subdirectory(pong)
endif()
add_subdirectory(shader) add_subdirectory(shader)
add_subdirectory(sockets) add_subdirectory(sockets)
if(NOT IOS) add_subdirectory(sound)
add_subdirectory(sound) add_subdirectory(sound_capture)
add_subdirectory(sound_capture) add_subdirectory(voip)
add_subdirectory(voip)
endif()
add_subdirectory(window) add_subdirectory(window)
if(SFML_OS_WINDOWS) if(SFML_OS_WINDOWS)
add_subdirectory(win32) add_subdirectory(win32)

View File

@ -5,11 +5,9 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/opengl)
set(SRC ${SRCROOT}/OpenGL.cpp) set(SRC ${SRCROOT}/OpenGL.cpp)
# find OpenGL and GLU # find OpenGL and GLU
if(NOT IOS) find_package(OpenGL REQUIRED)
find_package(OpenGL REQUIRED) include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${OPENGL_INCLUDE_DIR}) set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES})
set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES})
endif()
# define the opengl target # define the opengl target
sfml_add_example(opengl GUI_APP sfml_add_example(opengl GUI_APP

View File

@ -4,19 +4,6 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp> #include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp> #include <SFML/OpenGL.hpp>
#include <SFML/Main.hpp>
// Some platform-specific stuff
#ifdef SFML_OPENGL_ES
#define glClearDepth glClearDepthf
#define glFrustum glFrustumf
#define gluBuild2DMipmaps(target, internalFormat, width, height, format, type, pixels) \
glTexImage2D(target, 0, internalFormat, width, height, 0, format, type, pixels); \
glGenerateMipmapOES(GL_TEXTURE_2D);
#endif
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -3,8 +3,6 @@
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include "Effect.hpp" #include "Effect.hpp"
#include <SFML/Graphics.hpp>
#include <SFML/Main.hpp>
#include <vector> #include <vector>
#include <cmath> #include <cmath>

View File

@ -5,11 +5,9 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/window)
set(SRC ${SRCROOT}/Window.cpp) set(SRC ${SRCROOT}/Window.cpp)
# find OpenGL and GLU # find OpenGL and GLU
if(NOT IOS) find_package(OpenGL REQUIRED)
find_package(OpenGL REQUIRED) include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${OPENGL_INCLUDE_DIR}) set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES})
set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES})
endif()
# define the window target # define the window target
sfml_add_example(window GUI_APP sfml_add_example(window GUI_APP

View File

@ -3,16 +3,6 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Window.hpp> #include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp> #include <SFML/OpenGL.hpp>
#include <SFML/Main.hpp>
// Some platform-specific stuff
#ifdef SFML_OPENGL_ES
#define glClearDepth glClearDepthf
#define glFrustum glFrustumf
#endif
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////