fixed cmake for build on all plaforms include android

deque
root 11 years ago
parent dbf5613d8c
commit 16aafc26bc

@ -54,6 +54,10 @@ endif(EXISTS ${PROJECT_SOURCE_DIR}/.git)
# Macros # Macros
include(OpenMWMacros) include(OpenMWMacros)
if (ANDROID)
set(CMAKE_FIND_ROOT_PATH ${OPENMW_DEPENDENCIES_DIR} "${CMAKE_FIND_ROOT_PATH}")
endif (ANDROID)
# doxygen main page # doxygen main page
configure_file ("${OpenMW_SOURCE_DIR}/docs/mainpage.hpp.cmake" "${OpenMW_SOURCE_DIR}/docs/mainpage.hpp") configure_file ("${OpenMW_SOURCE_DIR}/docs/mainpage.hpp.cmake" "${OpenMW_SOURCE_DIR}/docs/mainpage.hpp")
@ -233,7 +237,12 @@ if(OGRE_STATIC)
list(APPEND OGRE_STATIC_PLUGINS ${Cg_LIBRARIES}) list(APPEND OGRE_STATIC_PLUGINS ${Cg_LIBRARIES})
endif(Cg_FOUND) endif(Cg_FOUND)
add_static_ogre_plugin(RenderSystem_GL) if (ANDROID)
add_static_ogre_plugin(RenderSystem_GLES2)
endif (ANDROID)
if (NOT ANDROID)
add_static_ogre_plugin(RenderSystem_GL)
endif ()
if(WIN32) if(WIN32)
add_static_ogre_plugin(RenderSystem_Direct3D9) add_static_ogre_plugin(RenderSystem_Direct3D9)
endif(WIN32) endif(WIN32)

@ -1,11 +1,25 @@
# local files # local files
if (ANDROID)
set(GAME
main.cpp
SDL_android_main.c
engine.cpp
)
endif (ANDROID)
if (NOT ANDROID)
set(GAME set(GAME
main.cpp main.cpp
engine.cpp engine.cpp
) )
if(NOT WIN32) endif ()
if(NOT WIN32 AND NOT ANDROID)
set(GAME ${GAME} crashcatcher.cpp) set(GAME ${GAME} crashcatcher.cpp)
endif() endif()
set(GAME_HEADER set(GAME_HEADER
engine.hpp engine.hpp
) )
@ -82,19 +96,36 @@ add_openmw_dir (mwbase
) )
# Main executable # Main executable
if (ANDROID)
set(BOOST_COMPONENTS system filesystem program_options thread wave atomic)
endif (ANDROID)
if (NOT ANDROID)
set(BOOST_COMPONENTS system filesystem program_options thread wave) set(BOOST_COMPONENTS system filesystem program_options thread wave)
endif ()
if(WIN32) if(WIN32)
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} locale) set(BOOST_COMPONENTS ${BOOST_COMPONENTS} locale)
endif(WIN32) endif(WIN32)
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
if (NOT ANDROID)
add_executable(openmw add_executable(openmw
${OPENMW_LIBS} ${OPENMW_LIBS_HEADER} ${OPENMW_LIBS} ${OPENMW_LIBS_HEADER}
${OPENMW_FILES} ${OPENMW_FILES}
${GAME} ${GAME_HEADER} ${GAME} ${GAME_HEADER}
${APPLE_BUNDLE_RESOURCES} ${APPLE_BUNDLE_RESOURCES}
) )
endif ()
if (ANDROID)
add_library(openmw SHARED
${OPENMW_LIBS} ${OPENMW_LIBS_HEADER}
${OPENMW_FILES}
${GAME} ${GAME_HEADER}
${APPLE_BUNDLE_RESOURCES}
)
endif (ANDROID)
# Sound stuff - here so CMake doesn't stupidly recompile EVERYTHING # Sound stuff - here so CMake doesn't stupidly recompile EVERYTHING
# when we change the backend. # when we change the backend.
@ -116,6 +147,47 @@ target_link_libraries(openmw
components components
) )
if (ANDROID)
target_link_libraries(openmw
${OGRE_STATIC_PLUGINS}
)
target_link_libraries(openmw
EGL
android
log
dl
)
target_link_libraries(openmw
boost_atomic
boost_chrono
boost_date_time
boost_filesystem
boost_program_options
boost_system
boost_thread
boost_wave
)
target_link_libraries(openmw
FreeImage
freetype
)
target_link_libraries(openmw
OgreMainStatic
)
target_link_libraries(openmw
MyGUI.OgrePlatform
MyGUIEngineStatic
Plugin_StrangeButtonStatic
cpufeatures
BulletCollision
BulletDynamics
LinearMath
)
endif (ANDROID)
if (USE_SYSTEM_TINYXML) if (USE_SYSTEM_TINYXML)
target_link_libraries(openmw ${TINYXML_LIBRARIES}) target_link_libraries(openmw ${TINYXML_LIBRARIES})
endif() endif()

@ -127,7 +127,7 @@ endif ()
set(OGRE_COMPONENTS Paging Terrain set(OGRE_COMPONENTS Paging Terrain
Plugin_BSPSceneManager Plugin_CgProgramManager Plugin_OctreeSceneManager Plugin_BSPSceneManager Plugin_CgProgramManager Plugin_OctreeSceneManager
Plugin_OctreeZone Plugin_PCZSceneManager Plugin_ParticleFX Plugin_OctreeZone Plugin_PCZSceneManager Plugin_ParticleFX
RenderSystem_Direct3D10 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GLES) RenderSystem_Direct3D10 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GLES2)
set(OGRE_RESET_VARS set(OGRE_RESET_VARS
OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR
OGRE_LIBRARY_FWK OGRE_LIBRARY_REL OGRE_LIBRARY_DBG OGRE_LIBRARY_FWK OGRE_LIBRARY_REL OGRE_LIBRARY_DBG
@ -234,10 +234,10 @@ if (OGRE_STATIC)
find_package(FreeImage QUIET) find_package(FreeImage QUIET)
find_package(Freetype QUIET) find_package(Freetype QUIET)
find_package(OpenGL QUIET) find_package(OpenGL QUIET)
find_package(OpenGLES QUIET) find_package(OpenGLES2 QUIET)
find_package(ZLIB QUIET) find_package(ZLIB QUIET)
find_package(ZZip QUIET) find_package(ZZip QUIET)
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE OR NOT ANDROID)
find_package(X11 QUIET) find_package(X11 QUIET)
find_library(XAW_LIBRARY NAMES Xaw Xaw7 PATHS ${DEP_LIB_SEARCH_DIR} ${X11_LIB_SEARCH_PATH}) find_library(XAW_LIBRARY NAMES Xaw Xaw7 PATHS ${DEP_LIB_SEARCH_DIR} ${X11_LIB_SEARCH_PATH})
if (NOT XAW_LIBRARY OR NOT X11_Xt_FOUND) if (NOT XAW_LIBRARY OR NOT X11_Xt_FOUND)
@ -258,11 +258,19 @@ if (OGRE_STATIC)
endif () endif ()
endif () endif ()
if (ANDROID)
set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_LIBRARY_FWK} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES}
${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES}
${Cocoa_LIBRARIES} ${Carbon_LIBRARIES})
endif (ANDROID)
if (NOT ANDROID)
set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_LIBRARY_FWK} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES} set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_LIBRARY_FWK} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES}
${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES} ${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES}
${X11_LIBRARIES} ${X11_Xt_LIBRARIES} ${XAW_LIBRARY} ${X11_Xrandr_LIB}
${Cocoa_LIBRARIES} ${Carbon_LIBRARIES})
${X11_LIBRARIES} ${X11_Xt_LIBRARIES} ${XAW_LIBRARY} ${X11_Xrandr_LIB}
${Cocoa_LIBRARIES} ${Carbon_LIBRARIES})
endif()
if (NOT ZLIB_FOUND OR NOT ZZip_FOUND) if (NOT ZLIB_FOUND OR NOT ZZip_FOUND)
set(OGRE_DEPS_FOUND FALSE) set(OGRE_DEPS_FOUND FALSE)
endif () endif ()
@ -272,7 +280,7 @@ if (OGRE_STATIC)
if (NOT FREETYPE_FOUND) if (NOT FREETYPE_FOUND)
set(OGRE_DEPS_FOUND FALSE) set(OGRE_DEPS_FOUND FALSE)
endif () endif ()
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE AND NOT ANDROID)
if (NOT X11_FOUND) if (NOT X11_FOUND)
set(OGRE_DEPS_FOUND FALSE) set(OGRE_DEPS_FOUND FALSE)
endif () endif ()
@ -486,7 +494,7 @@ ogre_find_plugin(Plugin_CgProgramManager OgreCgProgram.h PlugIns/CgProgramManage
ogre_find_plugin(Plugin_OctreeSceneManager OgreOctreeSceneManager.h PlugIns/OctreeSceneManager/include) ogre_find_plugin(Plugin_OctreeSceneManager OgreOctreeSceneManager.h PlugIns/OctreeSceneManager/include)
ogre_find_plugin(Plugin_ParticleFX OgreParticleFXPrerequisites.h PlugIns/ParticleFX/include) ogre_find_plugin(Plugin_ParticleFX OgreParticleFXPrerequisites.h PlugIns/ParticleFX/include)
ogre_find_plugin(RenderSystem_GL OgreGLRenderSystem.h RenderSystems/GL/include) ogre_find_plugin(RenderSystem_GL OgreGLRenderSystem.h RenderSystems/GL/include)
ogre_find_plugin(RenderSystem_GLES OgreGLESRenderSystem.h RenderSystems/GLES/include) ogre_find_plugin(RenderSystem_GLES2 OgreGLES2RenderSystem.h RenderSystems/GLES2/include)
ogre_find_plugin(RenderSystem_Direct3D9 OgreD3D9RenderSystem.h RenderSystems/Direct3D9/include) ogre_find_plugin(RenderSystem_Direct3D9 OgreD3D9RenderSystem.h RenderSystems/Direct3D9/include)
ogre_find_plugin(RenderSystem_Direct3D10 OgreD3D10RenderSystem.h RenderSystems/Direct3D10/include) ogre_find_plugin(RenderSystem_Direct3D10 OgreD3D10RenderSystem.h RenderSystems/Direct3D10/include)
ogre_find_plugin(RenderSystem_Direct3D11 OgreD3D11RenderSystem.h RenderSystems/Direct3D11/include) ogre_find_plugin(RenderSystem_Direct3D11 OgreD3D11RenderSystem.h RenderSystems/Direct3D11/include)
@ -528,8 +536,8 @@ if (OGRE_STATIC)
set(OGRE_RenderSystem_GL_LIBRARIES ${OGRE_RenderSystem_GL_LIBRARIES} set(OGRE_RenderSystem_GL_LIBRARIES ${OGRE_RenderSystem_GL_LIBRARIES}
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
) )
set(OGRE_RenderSystem_GLES_LIBRARIES ${OGRE_RenderSystem_GLES_LIBRARIES} set(OGRE_RenderSystem_GLES2_LIBRARIES ${OGRE_RenderSystem_GLES2_LIBRARIES}
${OPENGLES_LIBRARIES} ${OPENGLES2_LIBRARIES}
) )
set(OGRE_Plugin_CgProgramManager_LIBRARIES ${OGRE_Plugin_CgProgramManager_LIBRARIES} set(OGRE_Plugin_CgProgramManager_LIBRARIES ${OGRE_Plugin_CgProgramManager_LIBRARIES}
${Cg_LIBRARIES} ${Cg_LIBRARIES}

Loading…
Cancel
Save