2012-07-14 03:10:24 +02:00
|
|
|
# framework flags
|
|
|
|
# FRAMEWORK_SOUND
|
|
|
|
# FRAMEWORK_GRAPHICS
|
|
|
|
# FRAMEWORK_NET
|
|
|
|
# FRAMEWORK_XML
|
|
|
|
|
2012-07-28 05:54:47 +02:00
|
|
|
# CMAKE_CURRENT_LIST_DIR cmake 2.6 compatibility
|
2012-07-14 03:10:24 +02:00
|
|
|
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6)
|
|
|
|
get_filename_component(CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
|
|
|
endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6)
|
2011-12-29 23:50:36 +01:00
|
|
|
|
2011-12-05 07:44:03 +01:00
|
|
|
# add framework cmake modules
|
2012-07-14 03:10:24 +02:00
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake;${CMAKE_MODULE_PATH}")
|
2011-12-05 07:44:03 +01:00
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
set(framework_LIBRARIES "")
|
|
|
|
set(framework_DEFINITIONS "")
|
|
|
|
set(framework_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/..")
|
|
|
|
set(framework_SOURCES ${framework_SOURCES}
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/const.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/global.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/pch.h
|
2011-12-05 07:44:03 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luafunctions.cpp
|
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/util/color.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/util/color.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/util/crypt.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/util/crypt.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/util/databuffer.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/util/matrix.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/util/point.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/util/rect.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/util/size.h
|
|
|
|
|
|
|
|
# stdext
|
2012-08-01 09:49:09 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/any.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/boolean.h
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/cast.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/compiler.h
|
2012-08-01 09:49:09 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/demangle.cpp
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/demangle.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/dumper.h
|
2012-08-01 09:49:09 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/dynamic_storage.h
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/exception.h
|
2012-08-01 09:49:09 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/format.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/math.cpp
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/math.h
|
2012-08-07 03:11:42 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/net.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/net.h
|
2012-08-01 09:49:09 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/packed_any.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/packed_storage.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/packed_vector.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/shared_object.h
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/stdext.h
|
2012-08-01 09:49:09 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/string.cpp
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/string.h
|
2012-08-01 09:49:09 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/time.cpp
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/time.h
|
2012-08-01 09:49:09 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/traits.h
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/stdext/types.h
|
|
|
|
|
2012-06-12 18:50:43 +02:00
|
|
|
# core
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/application.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/application.h
|
2012-06-01 21:39:09 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/adaptativeframecounter.cpp
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/adaptativeframecounter.h
|
2012-06-24 15:05:44 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/binarytree.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/binarytree.h
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/clock.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/clock.h
|
2011-12-05 07:44:03 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/configmanager.cpp
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/configmanager.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/declarations.h
|
2012-06-22 01:58:18 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/event.cpp
|
2012-07-12 05:55:18 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/event.h
|
2011-12-05 07:44:03 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/eventdispatcher.cpp
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/eventdispatcher.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/filestream.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/filestream.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/inputevent.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/logger.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/logger.h
|
2011-12-05 07:44:03 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/module.cpp
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/module.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/modulemanager.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/modulemanager.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/resourcemanager.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/resourcemanager.h
|
2012-06-22 01:58:18 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/scheduledevent.cpp
|
2012-07-12 05:55:18 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/scheduledevent.h
|
2011-12-28 20:38:29 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/timer.cpp
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/timer.h
|
2011-12-05 07:44:03 +01:00
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
# luaengine
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/declarations.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/luabinder.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/luaexception.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/luaexception.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/luainterface.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/luainterface.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/luaobject.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/luaobject.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/luavaluecasts.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/luavaluecasts.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/lbitlib.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/luaengine/lbitlib.h
|
2012-06-12 18:50:43 +02:00
|
|
|
|
|
|
|
# otml
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/declarations.h
|
2011-12-05 07:44:03 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otmldocument.cpp
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otmldocument.h
|
2011-12-05 07:44:03 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otmlemitter.cpp
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otmlemitter.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otmlexception.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otmlexception.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otml.h
|
2011-12-05 07:44:03 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otmlnode.cpp
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otmlnode.h
|
2011-12-05 07:44:03 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otmlparser.cpp
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/otml/otmlparser.h
|
2011-12-05 07:44:03 +01:00
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
# crash handler
|
2012-06-12 18:50:43 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/platform/crashhandler.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/platform/unixcrashhandler.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/platform/win32crashhandler.cpp
|
2012-07-14 03:10:24 +02:00
|
|
|
)
|
2012-06-12 18:50:43 +02:00
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
# some build options
|
|
|
|
option(CRASH_HANDLER "Generate crash reports" ON)
|
|
|
|
option(LUAJIT "Use lua jit" OFF)
|
|
|
|
option(USE_STATIC_LIBS "Don't use shared libraries (dlls)" ON)
|
2012-07-14 19:17:03 +02:00
|
|
|
set(BUILD_COMMIT "devel" CACHE "Git commit string (intended for releases)" STRING)
|
2012-07-14 03:10:24 +02:00
|
|
|
set(BUILD_REVISION "0" CACHE "Git revision string (intended for releases)" STRING)
|
|
|
|
|
|
|
|
# default build type
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
|
|
|
endif()
|
|
|
|
|
2012-07-29 22:17:48 +02:00
|
|
|
if(WIN32)
|
|
|
|
set(CPP2011_FLAGS "-std=gnu++0x")
|
|
|
|
else()
|
|
|
|
set(CPP2011_FLAGS "-std=c++0x")
|
|
|
|
endif()
|
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
# gcc compile flags
|
|
|
|
set(WARNS_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-unused-variable")
|
2012-07-29 22:17:48 +02:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNS_FLAGS} ${ARCH_FLAGS} ${CPP2011_FLAGS} -pipe")
|
2012-07-28 21:02:05 +02:00
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -g -fno-omit-frame-pointer")
|
2012-07-14 03:10:24 +02:00
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
2012-07-29 12:32:44 +02:00
|
|
|
set(CMAKE_CXX_FLAGS_PERFORMANCE "-Ofast -mmmx -msse -msse2")
|
2012-07-14 03:10:24 +02:00
|
|
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os")
|
|
|
|
|
|
|
|
# process options
|
|
|
|
if(USE_STATIC_LIBS)
|
2012-08-03 12:13:46 +02:00
|
|
|
if(NOT APPLE)
|
|
|
|
set(CMAKE_CXX_LINK_FLAGS "-static-libgcc -static-libstdc++")
|
|
|
|
endif()
|
2012-07-14 03:10:24 +02:00
|
|
|
message(STATUS "Link to static libraries: ON")
|
|
|
|
else()
|
|
|
|
message(STATUS "Link to static libraries: OFF")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
|
|
|
|
add_definitions(-D"BUILD_TYPE=\\\"${CMAKE_BUILD_TYPE}\\\"")
|
|
|
|
message(STATUS "Build commit: ${BUILD_COMMIT}")
|
|
|
|
add_definitions(-D"BUILD_COMMIT=\\\"${BUILD_COMMIT}\\\"")
|
|
|
|
message(STATUS "Build revision: ${BUILD_REVISION}")
|
|
|
|
add_definitions(-D"BUILD_REVISION=\\\"${BUILD_REVISION}\\\"")
|
|
|
|
|
|
|
|
# find boost
|
2012-08-04 17:58:56 +02:00
|
|
|
set(REQUIRED_BOOST_COMPONENTS system filesystem)
|
2012-07-14 03:10:24 +02:00
|
|
|
if(WIN32)
|
|
|
|
set(Boost_THREADAPI win32)
|
2012-08-04 17:58:56 +02:00
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DBOOST_THREAD_USE_LIB) # fix boost thread linkage
|
|
|
|
set(REQUIRED_BOOST_COMPONENTS ${REQUIRED_BOOST_COMPONENTS} thread chrono) # mingw32 does not have std::thread
|
2012-07-14 03:10:24 +02:00
|
|
|
endif()
|
|
|
|
set(Boost_USE_MULTITHREADED ON)
|
2012-08-18 19:08:05 +02:00
|
|
|
set(Boost_USE_STATIC_LIBS ${USE_STATIC_LIBS})
|
2012-08-18 20:53:04 +02:00
|
|
|
find_package(Boost 1.46.0 COMPONENTS ${REQUIRED_BOOST_COMPONENTS} REQUIRED)
|
2012-07-14 03:10:24 +02:00
|
|
|
|
|
|
|
#find lua
|
|
|
|
if(LUAJIT)
|
|
|
|
find_package(LuaJIT REQUIRED)
|
|
|
|
set(LUA_INCLUDE_DIR ${LUAJIT_INCLUDE_DIR})
|
|
|
|
set(LUA_LIBRARY ${LUAJIT_LIBRARY})
|
|
|
|
else()
|
|
|
|
find_package(Lua REQUIRED)
|
|
|
|
endif()
|
|
|
|
message(STATUS "LuaJIT: " ${LUAJIT})
|
|
|
|
|
|
|
|
find_package(PhysFS REQUIRED)
|
2012-08-03 18:01:45 +02:00
|
|
|
find_package(OpenSSL REQUIRED)
|
2012-07-14 03:10:24 +02:00
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES}
|
|
|
|
${Boost_LIBRARIES}
|
|
|
|
${LUA_LIBRARY}
|
|
|
|
${PHYSFS_LIBRARY}
|
2012-08-03 18:01:45 +02:00
|
|
|
${OPENSSL_LIBRARIES}
|
2012-07-14 03:10:24 +02:00
|
|
|
${ZLIB_LIBRARY}
|
|
|
|
)
|
2012-06-12 18:50:43 +02:00
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS}
|
|
|
|
${Boost_INCLUDE_DIRS}
|
|
|
|
${OPENGL_INCLUDE_DIR}
|
|
|
|
${LUA_INCLUDE_DIR}
|
|
|
|
${PHYSFS_INCLUDE_DIR}
|
2012-08-03 18:01:45 +02:00
|
|
|
${OpenSSL_INCLUDE_DIR}
|
2012-07-14 03:10:24 +02:00
|
|
|
${ZLIB_INCLUDE_DIR}
|
2011-12-15 19:20:09 +01:00
|
|
|
)
|
2012-07-14 03:10:24 +02:00
|
|
|
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
|
|
|
message(STATUS "Debug information: ON")
|
|
|
|
else()
|
|
|
|
message(STATUS "Debug information: OFF")
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DNDEBUG) # NDEBUG disable asserts
|
|
|
|
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,--as-needed -Wl,-s") # strip all debug information
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CRASH_HANDLER)
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DCRASH_HANDLER)
|
|
|
|
message(STATUS "Crash handler: ON")
|
|
|
|
if(WIN32)
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} imagehlp)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(STATUS "Crash handler: OFF")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthreads")
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -D_WIN32_WINNT=0x0501)
|
2012-07-28 08:24:40 +02:00
|
|
|
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,--large-address-aware") # strip all debug information
|
2012-08-03 12:13:46 +02:00
|
|
|
elseif(APPLE)
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -D_REENTRANT) # enable thread safe code
|
2012-07-14 03:10:24 +02:00
|
|
|
else()
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
2012-08-03 12:13:46 +02:00
|
|
|
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -rdynamic") # rdynamic is needed by backtrace.h used in crash handler
|
2012-07-14 03:10:24 +02:00
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} dl)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(FRAMEWORK_GRAPHICS)
|
|
|
|
set(OPENGLES "OFF" CACHE "Use OpenGL ES 1.0 or 2.0 (for mobiles devices)" STRING)
|
|
|
|
if(OPENGLES STREQUAL "2.0")
|
|
|
|
find_package(OpenGLES2 REQUIRED)
|
|
|
|
find_package(EGL REQUIRED)
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DOPENGL_ES=2)
|
|
|
|
set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${EGL_INCLUDE_DIR} ${OPENGLES2_INCLUDE_DIR})
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} ${EGL_LIBRARY} ${OPENGLES2_LIBRARY})
|
|
|
|
ELSEif(OPENGLES STREQUAL "1.0")
|
|
|
|
find_package(OpenGLES1 REQUIRED)
|
|
|
|
find_package(EGL REQUIRED)
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DOPENGL_ES=1)
|
|
|
|
set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${EGL_INCLUDE_DIR} ${OPENGLES1_INCLUDE_DIR})
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} ${EGL_LIBRARY} ${OPENGLES1_LIBRARY})
|
|
|
|
else()
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
find_package(GLEW REQUIRED)
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
message(STATUS "OpenGL ES: " ${OPENGLES})
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
option(WINDOWS_CONSOLE "Enables console window on Windows platform" OFF)
|
|
|
|
if(WINDOWS_CONSOLE)
|
|
|
|
message(STATUS "Windows console: ON")
|
|
|
|
else()
|
|
|
|
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -mwindows")
|
|
|
|
message(STATUS "Windows console: OFF")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} X11)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(framework_SOURCES ${framework_SOURCES}
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/animatedtexture.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/animatedtexture.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/cachedtext.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/cachedtext.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/coordsbuffer.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/coordsbuffer.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/declarations.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/bitmapfont.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/bitmapfont.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/fontmanager.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/fontmanager.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/framebuffer.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/framebuffer.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/framebuffermanager.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/framebuffermanager.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/glutil.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/graphics.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/graphics.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/hardwarebuffer.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/hardwarebuffer.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/image.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/image.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/painter.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/painter.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl1.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl1.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl2.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl2.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl2_shadersources.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/paintershaderprogram.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/paintershaderprogram.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particleaffector.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particleaffector.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particle.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particleemitter.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particleemitter.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particleeffect.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particleeffect.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particle.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particlemanager.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particlemanager.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particlesystem.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/particlesystem.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/shader.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/shader.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/shaderprogram.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/shaderprogram.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/texture.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/texture.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/texturemanager.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/texturemanager.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/vertexarray.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/apngloader.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/graphics/apngloader.h
|
|
|
|
|
|
|
|
# ui
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/declarations.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uianchorlayout.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uianchorlayout.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiboxlayout.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiboxlayout.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uigridlayout.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uigridlayout.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/ui.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uihorizontallayout.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uihorizontallayout.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uilayout.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uilayout.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uimanager.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uimanager.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiparticles.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiparticles.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uirichtext.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uirichtext.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uitextedit.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uitextedit.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uitranslator.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uitranslator.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiverticallayout.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiverticallayout.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiwidgetbasestyle.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiwidget.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiwidget.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiwidgetimage.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui/uiwidgettext.cpp
|
|
|
|
|
|
|
|
# platform window
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/platform/platformwindow.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/platform/platformwindow.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/platform/win32window.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/platform/win32window.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/platform/x11window.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/platform/x11window.h
|
|
|
|
|
2012-08-10 21:26:39 +02:00
|
|
|
# window input
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/input/mouse.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/input/mouse.h
|
2012-07-14 03:10:24 +02:00
|
|
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/graphicalapplication.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/graphicalapplication.h
|
|
|
|
)
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DFW_GRAPHICS)
|
|
|
|
else()
|
|
|
|
set(framework_SOURCES ${framework_SOURCES}
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/consoleapplication.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/core/consoleapplication.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(FRAMEWORK_SOUND)
|
|
|
|
find_package(OpenAL REQUIRED)
|
|
|
|
find_package(VorbisFile REQUIRED)
|
|
|
|
find_package(Vorbis REQUIRED)
|
|
|
|
find_package(Ogg REQUIRED)
|
|
|
|
|
|
|
|
set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIR} ${VORBISFILE_INCLUDE_DIR})
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} ${OPENAL_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} winmm)
|
|
|
|
else()
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} rt)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(framework_SOURCES ${framework_SOURCES}
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/combinedsoundsource.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/combinedsoundsource.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/declarations.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/oggsoundfile.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/oggsoundfile.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/soundbuffer.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/soundbuffer.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/soundfile.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/soundfile.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/soundmanager.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/soundmanager.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/soundsource.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/soundsource.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/streamsoundsource.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sound/streamsoundsource.h
|
|
|
|
)
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DFW_SOUND)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(FRAMEWORK_NET)
|
|
|
|
if(WIN32)
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} ws2_32 mswsock)
|
|
|
|
endif()
|
|
|
|
set(framework_SOURCES ${framework_SOURCES}
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/connection.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/connection.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/declarations.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/inputmessage.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/inputmessage.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/outputmessage.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/outputmessage.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/protocol.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/protocol.h
|
2012-08-22 10:51:31 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/protocolhttp.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/protocolhttp.h
|
2012-07-14 03:10:24 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/server.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/net/server.h
|
|
|
|
)
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DFW_NET)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(FRAMEWORK_XML)
|
|
|
|
set(framework_SOURCES ${framework_SOURCES}
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/xml/tinyxml.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/xml/tinyxml.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/xml/tinystr.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/xml/tinystr.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/xml/tinyxmlerror.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/xml/tinyxmlparser.cpp
|
|
|
|
)
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DFW_XML)
|
|
|
|
endif()
|
|
|
|
|
2012-08-02 03:56:08 +02:00
|
|
|
if(FRAMEWORK_SQL)
|
2012-08-04 17:35:39 +02:00
|
|
|
find_package(MySQL REQUIRED)
|
2012-08-02 03:56:08 +02:00
|
|
|
|
|
|
|
set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${MYSQL_INCLUDE_DIR})
|
|
|
|
set(framework_LIBRARIES ${framework_LIBRARIES} ${MYSQL_LIBRARY})
|
|
|
|
|
|
|
|
set(framework_SOURCES ${framework_SOURCES}
|
2012-08-02 13:36:21 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sql/declarations.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sql/database.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sql/database.h
|
2012-08-02 03:56:08 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sql/mysql.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sql/mysql.h
|
|
|
|
)
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DFW_SQL)
|
|
|
|
endif()
|
|
|
|
|
2012-08-18 19:08:05 +02:00
|
|
|
if(FRAMEWORK_GIT)
|
|
|
|
find_package(Git2 REQUIRED)
|
|
|
|
|
|
|
|
set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${GIT2_INCLUDE_DIR})
|
|
|
|
set(framework_LIBRARIES ${GIT2_LIBRARY} ${framework_LIBRARIES})
|
|
|
|
|
|
|
|
set(framework_SOURCES ${framework_SOURCES}
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/git/declarations.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/git/gitrepository.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/git/gitrepository.cpp
|
|
|
|
)
|
|
|
|
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DFW_GIT)
|
|
|
|
endif()
|
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
include_directories(${framework_INCLUDE_DIRS})
|
|
|
|
add_definitions(${framework_DEFINITIONS})
|