No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
  2. PROJECT(otclient)
  3. SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
  4. # find needed packages
  5. SET(Boost_USE_STATIC_LIBS ON)
  6. FIND_PACKAGE(Boost REQUIRED)
  7. FIND_PACKAGE(OpenGL REQUIRED)
  8. FIND_PACKAGE(Lua51 REQUIRED)
  9. FIND_PACKAGE(YamlCpp REQUIRED)
  10. FIND_PACKAGE(PhysFS REQUIRED)
  11. FIND_PACKAGE(PNG REQUIRED)
  12. # choose a default build type if not specified
  13. IF(NOT CMAKE_BUILD_TYPE)
  14. SET(CMAKE_BUILD_TYPE RelWithDebInfo)
  15. ENDIF(NOT CMAKE_BUILD_TYPE)
  16. MESSAGE(STATUS "BUILD TYPE: " ${CMAKE_BUILD_TYPE})
  17. # setup compiler options
  18. IF(CMAKE_COMPILER_IS_GNUCXX)
  19. SET(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter")
  20. SET(CMAKE_CXX_FLAGS_DEBUG "-O1 -g -ggdb -fno-inline")
  21. SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wl,-s")
  22. SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
  23. SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,--as-needed")
  24. ENDIF(CMAKE_COMPILER_IS_GNUCXX)
  25. INCLUDE_DIRECTORIES(
  26. ${Boost_INCLUDE_DIRS}
  27. ${LUA_INCLUDE_DIRS}
  28. ${YAMLCPP_INCLUDE_DIRS}
  29. ${PHYSFS_INCLUDE_DIRS}
  30. ${PNG_INCLUDE_DIRS})
  31. LINK_DIRECTORIES(
  32. ${Boost_LIBRARY_DIRS}
  33. ${LUA_LIBRARY_DIRS}
  34. ${PHYSFS_LIBRARY_DIRS}
  35. ${YAMLCPP_LIBRARY_DIRS}
  36. ${PNG_LIBRARY_DIRS})
  37. # setup definitions
  38. ADD_DEFINITIONS(-D_REENTRANT)
  39. IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
  40. ADD_DEFINITIONS(-D_DEBUG)
  41. ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
  42. SET(SOURCES
  43. # game sources
  44. src/main.cpp
  45. src/menustate.cpp
  46. # framework sources
  47. src/framework/framebuffer.cpp
  48. src/framework/textureloader.cpp
  49. src/framework/texture.cpp
  50. src/framework/texturemanager.cpp
  51. src/framework/configmanager.cpp
  52. src/framework/resourcemanager.cpp
  53. src/framework/engine.cpp
  54. src/framework/graphics.cpp
  55. src/framework/logger.cpp
  56. src/framework/util.cpp)
  57. IF(WIN32)
  58. SET(SOURCES ${SOURCES} src/framework/win32platform.cpp)
  59. ELSE(WIN32)
  60. SET(SOURCES ${SOURCES} src/framework/x11platform.cpp)
  61. ENDIF(WIN32)
  62. # target executable
  63. ADD_EXECUTABLE(otclient ${SOURCES})
  64. # target link libraries
  65. TARGET_LINK_LIBRARIES(otclient
  66. ${Boost_LIBRARIES}
  67. ${OPENGL_LIBRARY}
  68. ${LUA51_LIBRARY}
  69. ${YAMLCPP_LIBRARY}
  70. ${PHYSFS_LIBRARY}
  71. ${PNG_LIBRARY})