CMakeLists.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. cmake_minimum_required (VERSION 2.9)
  2. project (incavead)
  3. SET(CMAKE_BUILD_TYPE "Release")
  4. SET(CMAKE_CXX_FLAGS "-Wall -std=c++11 -O4 -pthread -flto")
  5. # -ftime-report -fmem-report
  6. SET(CMAKE_EXE_LINKER_FLAGS "-flto")
  7. SET(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
  8. SET(INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dist)
  9. include_directories(../libmaudit)
  10. find_program(RAGEL ragel)
  11. if(NOT RAGEL)
  12. message("ragel NOT found")
  13. add_executable(incavead configparser.cc incavead.cc)
  14. else(NOT RAGEL)
  15. message("ragel found")
  16. add_custom_command(
  17. OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/configparser.h
  18. COMMAND ${RAGEL} -s -T0 -o configparser.h configparser.rl
  19. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/configparser.rl
  20. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  21. )
  22. #add_custom_target(configparserh DEPENDS configparser.h)
  23. #set_source_files_properties(configparser.h PROPERTIES GENERATED TRUE )
  24. add_executable(incavead configparser.cc incavead.cc ${CMAKE_CURRENT_SOURCE_DIR}/configparser.h)
  25. endif(NOT RAGEL)
  26. if(WIN32)
  27. target_link_libraries(incavead -mwindows m ws2_32)
  28. else(WIN32)
  29. target_link_libraries(incavead m)
  30. endif(WIN32)
  31. add_executable(highscore util/highscore.cc)
  32. add_executable(victory util/victory.cc)
  33. add_executable(printmap util/printmap.cc)
  34. install(TARGETS incavead highscore victory DESTINATION games/incavead)
  35. install(FILES
  36. data/celauto.cfg
  37. data/constants.cfg
  38. data/damage.cfg
  39. data/designs.cfg
  40. data/game.cfg
  41. data/howto.cfg
  42. data/levelskins.cfg
  43. data/species.cfg
  44. data/stats.cfg
  45. data/strings.cfg
  46. data/terrain.cfg
  47. data/vaults.cfg
  48. DESTINATION games/incavead)