CMakeLists.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. set(CMAKE_AUTOMOC ON)
  2. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  3. set(SRCS
  4. config/controller_config.cpp
  5. config/controller_config_util.cpp
  6. config.cpp
  7. debugger/callstack.cpp
  8. debugger/disassembler.cpp
  9. debugger/graphics.cpp
  10. debugger/graphics_breakpoint_observer.cpp
  11. debugger/graphics_breakpoints.cpp
  12. debugger/graphics_cmdlists.cpp
  13. debugger/graphics_framebuffer.cpp
  14. debugger/graphics_vertex_shader.cpp
  15. debugger/profiler.cpp
  16. debugger/ramview.cpp
  17. debugger/registers.cpp
  18. util/spinbox.cpp
  19. bootmanager.cpp
  20. hotkeys.cpp
  21. main.cpp
  22. citra-qt.rc
  23. )
  24. set(HEADERS
  25. config/controller_config.h
  26. config/controller_config_util.h
  27. config.h
  28. debugger/callstack.h
  29. debugger/disassembler.h
  30. debugger/graphics.h
  31. debugger/graphics_breakpoint_observer.h
  32. debugger/graphics_breakpoints.h
  33. debugger/graphics_breakpoints_p.h
  34. debugger/graphics_cmdlists.h
  35. debugger/graphics_framebuffer.h
  36. debugger/graphics_vertex_shader.h
  37. debugger/profiler.h
  38. debugger/ramview.h
  39. debugger/registers.h
  40. util/spinbox.h
  41. bootmanager.h
  42. hotkeys.h
  43. main.h
  44. version.h
  45. )
  46. set(UIS
  47. config/controller_config.ui
  48. debugger/callstack.ui
  49. debugger/disassembler.ui
  50. debugger/profiler.ui
  51. debugger/registers.ui
  52. hotkeys.ui
  53. main.ui
  54. )
  55. create_directory_groups(${SRCS} ${HEADERS} ${UIS})
  56. if (Qt5_FOUND)
  57. qt5_wrap_ui(UI_HDRS ${UIS})
  58. else()
  59. qt4_wrap_ui(UI_HDRS ${UIS})
  60. endif()
  61. if (APPLE)
  62. add_executable(citra-qt MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS})
  63. else()
  64. add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS})
  65. endif()
  66. target_link_libraries(citra-qt core common video_core qhexedit)
  67. target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS})
  68. target_link_libraries(citra-qt ${PLATFORM_LIBRARIES})
  69. #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir})
  70. if (Qt5_FOUND AND MSVC)
  71. set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin")
  72. set(Qt5_PLATFORMS_DIR "${Qt5_DIR}/../../../plugins/platforms/")
  73. set(Qt5_DLLS
  74. icudt*.dll
  75. icuin*.dll
  76. icuuc*.dll
  77. Qt5Core$<$<CONFIG:Debug>:d>.*
  78. Qt5Gui$<$<CONFIG:Debug>:d>.*
  79. Qt5OpenGL$<$<CONFIG:Debug>:d>.*
  80. Qt5Widgets$<$<CONFIG:Debug>:d>.*
  81. )
  82. set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
  83. set(PLATFORMS ${DLL_DEST}platforms/)
  84. # windows commandline expects the / to be \ so switch them
  85. string(REPLACE "/" "\\" Qt5_DLL_DIR ${Qt5_DLL_DIR})
  86. string(REPLACE "/" "\\" Qt5_PLATFORMS_DIR ${Qt5_PLATFORMS_DIR})
  87. string(REPLACE "/" "\\" DLL_DEST ${DLL_DEST})
  88. string(REPLACE "/" "\\" PLATFORMS ${PLATFORMS})
  89. # /NJH /NJS /NDL /NFL /NC /NS /NP - Silence any output
  90. # cmake adds an extra check for command success which doesn't work too well with robocopy
  91. # so trick it into thinking the command was successful with the || cmd /c "exit /b 0"
  92. add_custom_command(TARGET citra-qt POST_BUILD
  93. COMMAND robocopy ${Qt5_DLL_DIR} ${DLL_DEST} ${Qt5_DLLS} /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0"
  94. COMMAND if not exist ${PLATFORMS} mkdir ${PLATFORMS} 2> nul
  95. COMMAND robocopy ${Qt5_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.* /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0"
  96. )
  97. unset(Qt5_DLLS)
  98. unset(Qt5_DLL_DIR)
  99. unset(Qt5_PLATFORMS_DIR)
  100. unset(DLL_DEST)
  101. unset(PLATFORMS)
  102. endif()