CMakeLists.txt.legacy 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
  2. CMAKE_POLICY(VERSION 2.6)
  3. PROJECT(MANAPLUS)
  4. IF (NOT VERSION)
  5. SET(VERSION 1.0.0)
  6. ENDIF()
  7. STRING(REPLACE "." " " _VERSION ${VERSION})
  8. SEPARATE_ARGUMENTS(_VERSION)
  9. LIST(LENGTH _VERSION _LEN)
  10. IF(NOT _LEN EQUAL 4 AND NOT _LEN EQUAL 3)
  11. MESSAGE(FATAL_ERROR "Version needs to be in the form MAJOR.MINOR.RELEASE[.BUILD]")
  12. ENDIF()
  13. LIST(GET _VERSION 0 VER_MAJOR)
  14. LIST(GET _VERSION 1 VER_MINOR)
  15. LIST(GET _VERSION 2 VER_RELEASE)
  16. IF(_LEN EQUAL 4)
  17. LIST(GET _VERSION 3 VER_BUILD)
  18. ELSE()
  19. SET(VER_BUILD 0)
  20. ENDIF()
  21. # where to look for cmake modules
  22. SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules)
  23. FIND_PACKAGE(Gettext)
  24. OPTION(WITH_OPENGL "Enable OpenGL support" ON)
  25. OPTION(ENABLE_NLS "Enable building of tranlations" ON)
  26. OPTION(ENABLE_TMWA "Enable tmwA support" ON)
  27. IF (WIN32)
  28. SET(PKG_DATADIR ".")
  29. SET(PKG_BINDIR ".")
  30. SET(LOCALEDIR ".")
  31. CONFIGURE_FILE(src/winver.h.in src/winver.h)
  32. ELSE (WIN32)
  33. IF (NOT OSX AND NOT BEOS)
  34. OPTION(USE_X11 "Use X11 Clipboard functionality" ON)
  35. ENDIF ()
  36. SET(PKG_DATADIR ${CMAKE_INSTALL_PREFIX}/share/manaplus)
  37. SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
  38. SET(PKG_BINDIR ${CMAKE_INSTALL_PREFIX}/bin)
  39. ENDIF (WIN32)
  40. ADD_SUBDIRECTORY(data)
  41. ADD_SUBDIRECTORY(src)
  42. IF (GETTEXT_FOUND AND ENABLE_NLS)
  43. ADD_SUBDIRECTORY(po)
  44. ENDIF()
  45. If(UNIX)
  46. INSTALL(FILES manaplus.desktop DESTINATION share/applications)
  47. INSTALL(FILES manaplustest.desktop DESTINATION share/applications)
  48. INSTALL(FILES manaplus.appdata.xml DESTINATION share/appdata)
  49. ENDIF()
  50. SET(CPACK_PACKAGE_NAME "manaplus")
  51. SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ManaPlus")
  52. SET(CPACK_PACKAGE_VENDOR "ManaPlus Development Team")
  53. SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
  54. SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
  55. SET(CPACK_PACKAGE_INSTALL_DIRECTORY "ManaPlus")
  56. SET(CPACK_PACKAGE_VERSION_MAJOR ${VER_MAJOR})
  57. SET(CPACK_PACKAGE_VERSION_MINOR ${VER_MINOR})
  58. SET(CPACK_PACKAGE_VERSION_PATCH ${VER_RELEASE})
  59. IF(WIN32)
  60. SET(CPACK_NSIS_DISPLAY_NAME "ManaPlus")
  61. SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/icons/manaplus.ico")
  62. SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/packaging/windows/setup_welcome.bmp")
  63. SET(CPACK_NSIS_URL_INFO_ABOUT "http://manaplus.org")
  64. ENDIF()
  65. INCLUDE(CPack)