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.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. # find sources
  43. SET(SOURCES
  44. src/menustate.cpp
  45. src/framebuffer.cpp
  46. src/textureloader.cpp
  47. src/texture.cpp
  48. src/texturemanager.cpp
  49. src/configmanager.cpp
  50. src/resourcemanager.cpp
  51. src/main.cpp
  52. src/engine.cpp
  53. src/graphics.cpp
  54. src/logger.cpp
  55. src/util.cpp)
  56. IF(WIN32)
  57. SET(SOURCES ${SOURCES} src/win32platform.cpp)
  58. ELSE(WIN32)
  59. SET(SOURCES ${SOURCES} src/x11platform.cpp)
  60. ENDIF(WIN32)
  61. # target executable
  62. ADD_EXECUTABLE(otclient ${SOURCES})
  63. # target link libraries
  64. TARGET_LINK_LIBRARIES(otclient
  65. ${Boost_LIBRARIES}
  66. ${OPENGL_LIBRARY}
  67. ${LUA51_LIBRARY}
  68. ${YAMLCPP_LIBRARY}
  69. ${PHYSFS_LIBRARY}
  70. ${PNG_LIBRARY})