CMakeLists.txt 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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/decompiler_codegen.h
  25. include/decompiler/control_flow.h
  26. include/decompiler/decompiler_disassembler.h
  27. include/decompiler/decompiler_engine.h
  28. include/decompiler/graph.h
  29. include/decompiler/instruction.h
  30. include/decompiler/objectFactory.h
  31. include/decompiler/refcounted.h
  32. include/decompiler/simple_disassembler.h
  33. include/decompiler/stack.h
  34. include/decompiler/unknown_opcode_exception.h
  35. include/decompiler/value.h
  36. include/decompiler/wrongtype.h
  37. include/decompiler/field/instruction/FieldBackgroundInstruction.h
  38. include/decompiler/field/instruction/FieldCameraInstruction.h
  39. include/decompiler/field/instruction/FieldCondJumpInstruction.h
  40. include/decompiler/field/instruction/FieldControlFlowInstruction.h
  41. include/decompiler/field/instruction/FieldMathInstruction.h
  42. include/decompiler/field/instruction/FieldMediaInstruction.h
  43. include/decompiler/field/instruction/FieldModelInstruction.h
  44. include/decompiler/field/instruction/FieldModuleInstruction.h
  45. include/decompiler/field/instruction/FieldNoOperationInstruction.h
  46. include/decompiler/field/instruction/FieldPartyInstruction.h
  47. include/decompiler/field/instruction/FieldUncategorizedInstruction.h
  48. include/decompiler/field/instruction/FieldUncondJumpInstruction.h
  49. include/decompiler/field/instruction/FieldWalkmeshInstruction.h
  50. include/decompiler/field/instruction/FieldWindowInstruction.h
  51. include/decompiler/field/FieldDisassembler.h
  52. include/decompiler/field/FieldEngine.h
  53. include/decompiler/field/FieldCodeGenerator.h
  54. include/decompiler/world/instruction/WorldBinaryEqualStackInstruction.h
  55. include/decompiler/world/instruction/WorldCondJumpInstruction.h
  56. include/decompiler/world/instruction/WorldKernelCallInstruction.h
  57. include/decompiler/world/instruction/WorldLoadBankInstruction.h
  58. include/decompiler/world/instruction/WorldLoadInstruction.h
  59. include/decompiler/world/instruction/WorldNoOutputInstruction.h
  60. include/decompiler/world/instruction/WorldStackInstruction.h
  61. include/decompiler/world/instruction/WorldStoreInstruction.h
  62. include/decompiler/world/instruction/WorldSubStackInstruction.h
  63. include/decompiler/world/instruction/WorldUncondJumpInstruction.h
  64. include/decompiler/world/WorldCodeGenerator.h
  65. include/decompiler/world/WorldDisassembler.h
  66. include/decompiler/world/WorldEngine.h
  67. include/common/scummsys.h
  68. include/common/BinaryReader.h
  69. include/common/Lzs.h
  70. )
  71. set(SOURCE_FILES
  72. src/common/Logger.cpp
  73. src/common/BinGZipFile.cpp
  74. src/common/DrawSkeleton.cpp
  75. src/common/Surface.cpp
  76. src/common/OgreGenUtilites.cpp
  77. src/common/FontFile.cpp
  78. src/common/TimToVram.cpp
  79. src/common/Vram.cpp
  80. src/common/OgreBase.cpp
  81. src/VGearsUtility.cpp
  82. src/decompiler/sudm.cpp
  83. src/decompiler/decompiler_codegen.cpp
  84. src/decompiler/control_flow.cpp
  85. src/decompiler/decompiler_disassembler.cpp
  86. src/decompiler/graph.cpp
  87. src/decompiler/instruction.cpp
  88. src/decompiler/simple_disassembler.cpp
  89. src/decompiler/unknown_opcode_exception.cpp
  90. src/decompiler/value.cpp
  91. src/decompiler/field/instruction/FieldBackgroundInstruction.cpp
  92. src/decompiler/field/instruction/FieldCameraInstruction.cpp
  93. src/decompiler/field/instruction/FieldCondJumpInstruction.cpp
  94. src/decompiler/field/instruction/FieldControlFlowInstruction.cpp
  95. src/decompiler/field/instruction/FieldMathInstruction.cpp
  96. src/decompiler/field/instruction/FieldMediaInstruction.cpp
  97. src/decompiler/field/instruction/FieldModelInstruction.cpp
  98. src/decompiler/field/instruction/FieldModuleInstruction.cpp
  99. src/decompiler/field/instruction/FieldNoOperationInstruction.cpp
  100. src/decompiler/field/instruction/FieldPartyInstruction.cpp
  101. src/decompiler/field/instruction/FieldUncategorizedInstruction.cpp
  102. src/decompiler/field/instruction/FieldUncondJumpInstruction.cpp
  103. src/decompiler/field/instruction/FieldWalkmeshInstruction.cpp
  104. src/decompiler/field/instruction/FieldWindowInstruction.cpp
  105. src/decompiler/field/FieldDisassembler.cpp
  106. src/decompiler/field/FieldEngine.cpp
  107. src/decompiler/field/FieldCodeGenerator.cpp
  108. src/decompiler/world/instruction/WorldBinaryEqualStackInstruction.cpp
  109. src/decompiler/world/instruction/WorldCondJumpInstruction.cpp
  110. src/decompiler/world/instruction/WorldKernelCallInstruction.cpp
  111. src/decompiler/world/instruction/WorldLoadBankInstruction.cpp
  112. src/decompiler/world/instruction/WorldLoadInstruction.cpp
  113. src/decompiler/world/instruction/WorldNoOutputInstruction.cpp
  114. src/decompiler/world/instruction/WorldStackInstruction.cpp
  115. src/decompiler/world/instruction/WorldStoreInstruction.cpp
  116. src/decompiler/world/instruction/WorldSubStackInstruction.cpp
  117. src/decompiler/world/instruction/WorldUncondJumpInstruction.cpp
  118. src/decompiler/world/WorldCodeGenerator.cpp
  119. src/decompiler/world/WorldDisassembler.cpp
  120. src/decompiler/world/WorldEngine.cpp
  121. )
  122. # For SUDM. TODO: Add elses.
  123. if (UNIX)
  124. add_definitions(-DPOSIX)
  125. endif()
  126. add_library(Utility STATIC
  127. ${HEADER_FILES}
  128. ${SOURCE_FILES}
  129. )
  130. target_link_libraries(Utility
  131. ${OGRE_LIBRARIES}
  132. ${OIS_LIBRARIES}
  133. ${ZLIB_LIBRARIES}
  134. )
  135. SET_PROPERTY(TARGET Utility PROPERTY FOLDER "utilities")
  136. # DEBUG, no optimizations
  137. #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -rdynamic -O0")
  138. find_package ( Qt5Widgets REQUIRED )
  139. include_directories (
  140. ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
  141. ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}
  142. )
  143. set ( v-gears-launcher_HDRS
  144. include/mainwindow.h
  145. include/ff7DataInstaller.h
  146. include/ff7FieldTextWriter.h
  147. )
  148. set(v-gears-launcher_SRCS
  149. src/main.cpp
  150. src/mainwindow.cpp
  151. src/ff7DataInstaller.cpp
  152. src/ff7FieldTextWriter.cpp
  153. )
  154. set(v-gears-launcher_UIS
  155. src/mainwindow.ui
  156. )
  157. QT5_WRAP_UI(UIS ${v-gears-launcher_UIS})
  158. message(UIS: ${UIS})
  159. set(v-gears-launcher_MOCS
  160. include/mainwindow.h
  161. )
  162. QT5_WRAP_CPP(MOCS ${v-gears-launcher_MOCS})
  163. add_definitions(-DVGEARS_ADD_MANAGERS)
  164. add_executable (v-gears-launcher ${v-gears-launcher_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS})
  165. SET_PROPERTY(TARGET v-gears-launcher PROPERTY FOLDER "utilities")
  166. if (APPLE)
  167. target_link_libraries(v-gears-launcher "-framework CoreFoundation -framework Cocoa -framework IOKit")
  168. endif()
  169. if(WIN32)
  170. set_target_properties(v-gears-launcher PROPERTIES WIN32_EXECUTABLE ON)
  171. if (MSVC)
  172. set_target_properties(v-gears-launcher PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE")
  173. endif()
  174. endif()
  175. set(LIBRARIES
  176. Utility
  177. V-Gears
  178. v-gears-data
  179. #Sudm_Lib
  180. )
  181. find_package(Qt5 COMPONENTS Widgets REQUIRED)
  182. find_package(Qt5 COMPONENTS Core REQUIRED)
  183. target_link_libraries ( v-gears-launcher Qt5::Widgets Qt5::Core ${LIBRARIES} )
  184. if(WIN32 OR APPLE)
  185. install(TARGETS v-gears-launcher DESTINATION .)
  186. else()
  187. install(TARGETS v-gears-launcher RUNTIME DESTINATION bin)
  188. endif()