CMakeLists.txt 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/include ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/lib)
  2. include_directories(${SDL2_INCLUDE_DIR} ${SDL2_IMAGE_INCLUDE_DIR} ${SDL2_MIXER_INCLUDE_DIR} ${SDL2_TTF_INCLUDE_DIR})
  3. include_directories(${Boost_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ${FFMPEG_INCLUDE_DIRS})
  4. set(client_SRCS
  5. StdInc.cpp
  6. ../CCallback.cpp
  7. battle/CBattleAnimations.cpp
  8. battle/CBattleInterfaceClasses.cpp
  9. battle/CBattleInterface.cpp
  10. battle/CCreatureAnimation.cpp
  11. gui/CAnimation.cpp
  12. gui/CCursorHandler.cpp
  13. gui/CGuiHandler.cpp
  14. gui/CIntObject.cpp
  15. gui/Fonts.cpp
  16. gui/Geometries.cpp
  17. gui/SDL_Extensions.cpp
  18. widgets/AdventureMapClasses.cpp
  19. widgets/Buttons.cpp
  20. widgets/CArtifactHolder.cpp
  21. widgets/CComponent.cpp
  22. widgets/CGarrisonInt.cpp
  23. widgets/Images.cpp
  24. widgets/MiscWidgets.cpp
  25. widgets/ObjectLists.cpp
  26. widgets/TextControls.cpp
  27. windows/CAdvmapInterface.cpp
  28. windows/CCastleInterface.cpp
  29. windows/CCreatureWindow.cpp
  30. windows/CHeroWindow.cpp
  31. windows/CKingdomInterface.cpp
  32. windows/CQuestLog.cpp
  33. windows/CSpellWindow.cpp
  34. windows/CTradeWindow.cpp
  35. windows/CWindowObject.cpp
  36. windows/GUIClasses.cpp
  37. windows/InfoWindows.cpp
  38. CBitmapHandler.cpp
  39. CDefHandler.cpp
  40. CGameInfo.cpp
  41. Client.cpp
  42. CMessage.cpp
  43. CMT.cpp
  44. CMusicHandler.cpp
  45. CPlayerInterface.cpp
  46. CPreGame.cpp
  47. CVideoHandler.cpp
  48. Graphics.cpp
  49. mapHandler.cpp
  50. NetPacksClient.cpp
  51. SDLRWwrapper.cpp
  52. )
  53. set(client_HEADERS
  54. StdInc.h
  55. battle/CBattleAnimations.h
  56. battle/CBattleInterfaceClasses.h
  57. battle/CBattleInterface.h
  58. battle/CCreatureAnimation.h
  59. gui/CAnimation.h
  60. gui/CCursorHandler.h
  61. gui/CGuiHandler.h
  62. gui/CIntObject.h
  63. gui/Fonts.h
  64. gui/Geometries.h
  65. gui/SDL_Compat.h
  66. gui/SDL_Extensions.h
  67. gui/SDL_Pixels.h
  68. widgets/AdventureMapClasses.h
  69. widgets/Buttons.h
  70. widgets/CArtifactHolder.h
  71. widgets/CComponent.h
  72. widgets/CGarrisonInt.h
  73. widgets/Images.h
  74. widgets/MiscWidgets.h
  75. widgets/ObjectLists.h
  76. widgets/TextControls.h
  77. windows/CAdvmapInterface.h
  78. windows/CCastleInterface.h
  79. windows/CCreatureWindow.h
  80. windows/CHeroWindow.h
  81. windows/CKingdomInterface.h
  82. windows/CQuestLog.h
  83. windows/CSpellWindow.h
  84. windows/CTradeWindow.h
  85. windows/CWindowObject.h
  86. windows/GUIClasses.h
  87. windows/InfoWindows.h
  88. CBitmapHandler.h
  89. CDefHandler.h
  90. CGameInfo.h
  91. Client.h
  92. CMessage.h
  93. CMT.h
  94. CMusicHandler.h
  95. CPlayerInterface.h
  96. CPreGame.h
  97. CVideoHandler.h
  98. Graphics.h
  99. mapHandler.h
  100. resource.h
  101. SDLMain.h
  102. SDLRWwrapper.h
  103. )
  104. assign_source_group(${client_SRCS} ${client_HEADERS} VCMI_client.rc)
  105. if(ANDROID) # android needs client/server to be libraries, not executables, so we can't reuse the build part of this script
  106. return()
  107. endif()
  108. if(APPLE)
  109. set(client_SRCS ${client_SRCS} SDLMain.m)
  110. elseif(WIN32)
  111. set(client_ICON "VCMI_client.rc")
  112. endif()
  113. if(ENABLE_DEBUG_CONSOLE)
  114. add_executable(vcmiclient ${client_SRCS} ${client_HEADERS} ${client_ICON})
  115. else()
  116. add_executable(vcmiclient WIN32 ${client_SRCS} ${client_HEADERS} ${client_ICON})
  117. endif(ENABLE_DEBUG_CONSOLE)
  118. if(WIN32)
  119. set_target_properties(vcmiclient
  120. PROPERTIES
  121. OUTPUT_NAME "VCMI_client"
  122. PROJECT_LABEL "VCMI_client"
  123. )
  124. if(NOT ENABLE_DEBUG_CONSOLE)
  125. target_link_libraries(vcmiclient ${SDLMAIN_LIBRARY})
  126. endif()
  127. endif()
  128. target_link_libraries(vcmiclient vcmi ${Boost_LIBRARIES}
  129. ${SDL2_LIBRARY} ${SDL2_IMAGE_LIBRARY} ${SDL2_MIXER_LIBRARY} ${SDL2_TTF_LIBRARY}
  130. ${ZLIB_LIBRARIES} ${FFMPEG_LIBRARIES} ${FFMPEG_EXTRA_LINKING_OPTIONS} ${SYSTEM_LIBS}
  131. )
  132. vcmi_set_output_dir(vcmiclient "")
  133. set_target_properties(vcmiclient PROPERTIES ${PCH_PROPERTIES})
  134. cotire(vcmiclient)
  135. install(TARGETS vcmiclient DESTINATION ${BIN_DIR})
  136. #install icons and desktop file on Linux
  137. if(NOT WIN32 AND NOT APPLE)
  138. #FIXME: move to client makefile?
  139. install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.64x64.png" DESTINATION share/icons/hicolor/64x64/apps RENAME vcmiclient.png)
  140. install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.48x48.png" DESTINATION share/icons/hicolor/48x48/apps RENAME vcmiclient.png)
  141. install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.32x32.png" DESTINATION share/icons/hicolor/32x32/apps RENAME vcmiclient.png)
  142. install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.256x256.png" DESTINATION share/icons/hicolor/256x256/apps RENAME vcmiclient.png)
  143. install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.desktop" DESTINATION share/applications)
  144. endif()