CMakeLists.txt 7.6 KB

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