CMakeLists.txt 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. # Include directories.
  2. include_directories(
  3. ${VGears_INCLUDE_DIRS}
  4. ${VGears_SOURCE_DIR}/V-Gears/include
  5. ${VGears_SOURCE_DIR}/SupportedGames/FinalFantasy7/include
  6. ${CMAKE_CURRENT_SOURCE_DIR}/include
  7. ${CMAKE_CURRENT_SOURCE_DIR}
  8. ${ZLIB_INCLUDE_DIRS}
  9. )
  10. # Define headers and source files for the installer.
  11. set(HEADER_FILES
  12. include/common/FontFile.h
  13. include/VGearsUtility.h
  14. include/common/Logger.h
  15. include/common/Surface.h
  16. include/common/TimToVram.h
  17. include/common/BinGZipFile.h
  18. include/common/OgreBase.h
  19. include/common/OgreGenUtilites.h
  20. include/common/Vram.h
  21. include/common/DrawSkeleton.h
  22. include/common/Logger.h
  23. include/decompiler/sudm.h
  24. include/decompiler/LuaLanguage.h
  25. include/decompiler/CodeGenerator.h
  26. include/decompiler/ControlFlow.h
  27. include/decompiler/Disassembler.h
  28. include/decompiler/Engine.h
  29. include/decompiler/Graph.h
  30. include/decompiler/Function.h
  31. include/decompiler/instruction/Instruction.h
  32. include/decompiler/instruction/BinaryOpInstruction.h
  33. include/decompiler/instruction/BinaryOpStackInstruction.h
  34. include/decompiler/instruction/BoolNegateInstruction.h
  35. include/decompiler/instruction/BoolNegateStackInstruction.h
  36. include/decompiler/instruction/CallInstruction.h
  37. include/decompiler/instruction/CondJumpInstruction.h
  38. include/decompiler/instruction/DupInstruction.h
  39. include/decompiler/instruction/DupStackInstruction.h
  40. include/decompiler/instruction/JumpInstruction.h
  41. include/decompiler/instruction/KernelCallInstruction.h
  42. include/decompiler/instruction/KernelCallStackInstruction.h
  43. include/decompiler/instruction/LoadInstruction.h
  44. include/decompiler/instruction/ReturnInstruction.h
  45. include/decompiler/instruction/StackInstruction.h
  46. include/decompiler/instruction/StoreInstruction.h
  47. include/decompiler/instruction/UnaryOpInstruction.h
  48. include/decompiler/instruction/UnaryOpPostfixStackInstruction.h
  49. include/decompiler/instruction/UnaryOpPrefixStackInstruction.h
  50. include/decompiler/instruction/UncondJumpInstruction.h
  51. include/decompiler/ObjectFactory.h
  52. include/decompiler/refcounted.h
  53. include/decompiler/simple_disassembler.h
  54. include/decompiler/stack.h
  55. include/decompiler/unknown_opcode_exception.h
  56. include/decompiler/value.h
  57. include/decompiler/wrongtype.h
  58. include/decompiler/field/instruction/FieldBackgroundInstruction.h
  59. include/decompiler/field/instruction/FieldCameraInstruction.h
  60. include/decompiler/field/instruction/FieldCondJumpInstruction.h
  61. include/decompiler/field/instruction/FieldControlFlowInstruction.h
  62. include/decompiler/field/instruction/FieldMathInstruction.h
  63. include/decompiler/field/instruction/FieldMediaInstruction.h
  64. include/decompiler/field/instruction/FieldModelInstruction.h
  65. include/decompiler/field/instruction/FieldModuleInstruction.h
  66. include/decompiler/field/instruction/FieldNoOperationInstruction.h
  67. include/decompiler/field/instruction/FieldPartyInstruction.h
  68. include/decompiler/field/instruction/FieldUncategorizedInstruction.h
  69. include/decompiler/field/instruction/FieldUncondJumpInstruction.h
  70. include/decompiler/field/instruction/FieldWalkmeshInstruction.h
  71. include/decompiler/field/instruction/FieldWindowInstruction.h
  72. include/decompiler/field/FieldDisassembler.h
  73. include/decompiler/field/FieldEngine.h
  74. include/decompiler/field/FieldCodeGenerator.h
  75. include/decompiler/world/instruction/WorldBinaryEqualStackInstruction.h
  76. include/decompiler/world/instruction/WorldCondJumpInstruction.h
  77. include/decompiler/world/instruction/WorldKernelCallInstruction.h
  78. include/decompiler/world/instruction/WorldLoadBankInstruction.h
  79. include/decompiler/world/instruction/WorldLoadInstruction.h
  80. include/decompiler/world/instruction/WorldNoOutputInstruction.h
  81. include/decompiler/world/instruction/WorldStackInstruction.h
  82. include/decompiler/world/instruction/WorldStoreInstruction.h
  83. include/decompiler/world/instruction/WorldSubStackInstruction.h
  84. include/decompiler/world/instruction/WorldUncondJumpInstruction.h
  85. include/decompiler/world/WorldCodeGenerator.h
  86. include/decompiler/world/WorldDisassembler.h
  87. include/decompiler/world/WorldEngine.h
  88. include/common/scummsys.h
  89. include/common/BinaryReader.h
  90. include/common/Lzs.h
  91. )
  92. set(SOURCE_FILES
  93. src/common/Logger.cpp
  94. src/common/BinGZipFile.cpp
  95. src/common/DrawSkeleton.cpp
  96. src/common/Surface.cpp
  97. src/common/OgreGenUtilites.cpp
  98. src/common/FontFile.cpp
  99. src/common/TimToVram.cpp
  100. src/common/Vram.cpp
  101. src/common/OgreBase.cpp
  102. src/VGearsUtility.cpp
  103. src/decompiler/sudm.cpp
  104. src/decompiler/LuaLanguage.cpp
  105. src/decompiler/CodeGenerator.cpp
  106. src/decompiler/ControlFlow.cpp
  107. src/decompiler/Disassembler.cpp
  108. src/decompiler/Engine.cpp
  109. src/decompiler/Graph.cpp
  110. src/decompiler/instruction/Instruction.cpp
  111. src/decompiler/instruction/BinaryOpStackInstruction.cpp
  112. src/decompiler/instruction/BoolNegateStackInstruction.cpp
  113. src/decompiler/instruction/CallInstruction.cpp
  114. src/decompiler/instruction/CondJumpInstruction.cpp
  115. src/decompiler/instruction/DupStackInstruction.cpp
  116. src/decompiler/instruction/KernelCallInstruction.cpp
  117. src/decompiler/instruction/KernelCallStackInstruction.cpp
  118. src/decompiler/instruction/LoadInstruction.cpp
  119. src/decompiler/instruction/ReturnInstruction.cpp
  120. src/decompiler/instruction/StackInstruction.cpp
  121. src/decompiler/instruction/StoreInstruction.cpp
  122. src/decompiler/instruction/UnaryOpPostfixStackInstruction.cpp
  123. src/decompiler/instruction/UnaryOpPrefixStackInstruction.cpp
  124. src/decompiler/instruction/UncondJumpInstruction.cpp
  125. src/decompiler/simple_disassembler.cpp
  126. src/decompiler/unknown_opcode_exception.cpp
  127. src/decompiler/value.cpp
  128. src/decompiler/field/instruction/FieldBackgroundInstruction.cpp
  129. src/decompiler/field/instruction/FieldCameraInstruction.cpp
  130. src/decompiler/field/instruction/FieldCondJumpInstruction.cpp
  131. src/decompiler/field/instruction/FieldControlFlowInstruction.cpp
  132. src/decompiler/field/instruction/FieldMathInstruction.cpp
  133. src/decompiler/field/instruction/FieldMediaInstruction.cpp
  134. src/decompiler/field/instruction/FieldModelInstruction.cpp
  135. src/decompiler/field/instruction/FieldModuleInstruction.cpp
  136. src/decompiler/field/instruction/FieldNoOperationInstruction.cpp
  137. src/decompiler/field/instruction/FieldPartyInstruction.cpp
  138. src/decompiler/field/instruction/FieldUncategorizedInstruction.cpp
  139. src/decompiler/field/instruction/FieldUncondJumpInstruction.cpp
  140. src/decompiler/field/instruction/FieldWalkmeshInstruction.cpp
  141. src/decompiler/field/instruction/FieldWindowInstruction.cpp
  142. src/decompiler/field/FieldDisassembler.cpp
  143. src/decompiler/field/FieldEngine.cpp
  144. src/decompiler/field/FieldCodeGenerator.cpp
  145. src/decompiler/world/instruction/WorldBinaryEqualStackInstruction.cpp
  146. src/decompiler/world/instruction/WorldCondJumpInstruction.cpp
  147. src/decompiler/world/instruction/WorldKernelCallInstruction.cpp
  148. src/decompiler/world/instruction/WorldLoadBankInstruction.cpp
  149. src/decompiler/world/instruction/WorldLoadInstruction.cpp
  150. src/decompiler/world/instruction/WorldNoOutputInstruction.cpp
  151. src/decompiler/world/instruction/WorldStackInstruction.cpp
  152. src/decompiler/world/instruction/WorldStoreInstruction.cpp
  153. src/decompiler/world/instruction/WorldSubStackInstruction.cpp
  154. src/decompiler/world/instruction/WorldUncondJumpInstruction.cpp
  155. src/decompiler/world/WorldCodeGenerator.cpp
  156. src/decompiler/world/WorldDisassembler.cpp
  157. src/decompiler/world/WorldEngine.cpp
  158. )
  159. # For SUDM. TODO: Add elses.
  160. if (UNIX)
  161. add_definitions(-DPOSIX)
  162. endif()
  163. add_library(Utility STATIC
  164. ${HEADER_FILES}
  165. ${SOURCE_FILES}
  166. )
  167. target_link_libraries(Utility
  168. ${OGRE_LIBRARIES}
  169. ${OIS_LIBRARIES}
  170. ${ZLIB_LIBRARIES}
  171. )
  172. SET_PROPERTY(TARGET Utility PROPERTY FOLDER "utilities")
  173. # DEBUG, no optimizations
  174. #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -rdynamic -O0")
  175. find_package ( Qt5Widgets REQUIRED )
  176. include_directories (
  177. ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
  178. ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}
  179. )
  180. set ( v-gears-launcher_HDRS
  181. include/mainwindow.h
  182. include/ff7DataInstaller.h
  183. include/ff7FieldTextWriter.h
  184. )
  185. set(v-gears-launcher_SRCS
  186. src/main.cpp
  187. src/mainwindow.cpp
  188. src/ff7DataInstaller.cpp
  189. src/ff7FieldTextWriter.cpp
  190. )
  191. set(v-gears-launcher_UIS
  192. src/mainwindow.ui
  193. )
  194. QT5_WRAP_UI(UIS ${v-gears-launcher_UIS})
  195. message(UIS: ${UIS})
  196. set(v-gears-launcher_MOCS
  197. include/mainwindow.h
  198. )
  199. QT5_WRAP_CPP(MOCS ${v-gears-launcher_MOCS})
  200. add_definitions(-DVGEARS_ADD_MANAGERS)
  201. add_executable (v-gears-launcher ${v-gears-launcher_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS})
  202. SET_PROPERTY(TARGET v-gears-launcher PROPERTY FOLDER "utilities")
  203. if (APPLE)
  204. target_link_libraries(v-gears-launcher "-framework CoreFoundation -framework Cocoa -framework IOKit")
  205. endif()
  206. if(WIN32)
  207. set_target_properties(v-gears-launcher PROPERTIES WIN32_EXECUTABLE ON)
  208. if (MSVC)
  209. set_target_properties(v-gears-launcher PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE")
  210. endif()
  211. endif()
  212. set(LIBRARIES
  213. Utility
  214. V-Gears
  215. v-gears-data
  216. #Sudm_Lib
  217. )
  218. find_package(Qt5 COMPONENTS Widgets REQUIRED)
  219. find_package(Qt5 COMPONENTS Core REQUIRED)
  220. target_link_libraries ( v-gears-launcher Qt5::Widgets Qt5::Core ${LIBRARIES} )
  221. if(WIN32 OR APPLE)
  222. install(TARGETS v-gears-launcher DESTINATION .)
  223. else()
  224. install(TARGETS v-gears-launcher RUNTIME DESTINATION bin)
  225. endif()