CMakeLists.txt 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. # Include directories.
  2. include_directories(
  3. ${VGears_INCLUDE_DIRS}
  4. ${VGears_SOURCE_DIR}/src
  5. ${CMAKE_CURRENT_SOURCE_DIR}/src
  6. ${CMAKE_CURRENT_SOURCE_DIR}
  7. ${ZLIB_INCLUDE_DIRS}
  8. )
  9. # Define headers and source files for the installer.
  10. set(HEADER_FILES
  11. include/common/FontFile.h
  12. include/VGearsUtility.h
  13. include/common/Logger.h
  14. include/common/Surface.h
  15. include/common/TimToVram.h
  16. include/common/BinGZipFile.h
  17. include/common/OgreBase.h
  18. include/common/OgreGenUtilites.h
  19. include/common/Vram.h
  20. include/common/DrawSkeleton.h
  21. include/common/Logger.h
  22. include/decompiler/ScriptFormatter.h
  23. include/decompiler/LuaLanguage.h
  24. include/decompiler/CodeGenerator.h
  25. include/decompiler/ControlFlow.h
  26. include/decompiler/Disassembler.h
  27. include/decompiler/Decompiler.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/Stack.h
  54. include/decompiler/DecompilerException.h
  55. include/decompiler/Value.h
  56. include/decompiler/field/instruction/FieldBackgroundInstruction.h
  57. include/decompiler/field/instruction/FieldCameraInstruction.h
  58. include/decompiler/field/instruction/FieldCondJumpInstruction.h
  59. include/decompiler/field/instruction/FieldControlFlowInstruction.h
  60. include/decompiler/field/instruction/FieldMathInstruction.h
  61. include/decompiler/field/instruction/FieldMediaInstruction.h
  62. include/decompiler/field/instruction/FieldModelInstruction.h
  63. include/decompiler/field/instruction/FieldModuleInstruction.h
  64. include/decompiler/field/instruction/FieldNoOperationInstruction.h
  65. include/decompiler/field/instruction/FieldPartyInstruction.h
  66. include/decompiler/field/instruction/FieldUncategorizedInstruction.h
  67. include/decompiler/field/instruction/FieldUncondJumpInstruction.h
  68. include/decompiler/field/instruction/FieldWalkmeshInstruction.h
  69. include/decompiler/field/instruction/FieldWindowInstruction.h
  70. include/decompiler/field/FieldDisassembler.h
  71. include/decompiler/field/FieldEngine.h
  72. include/decompiler/field/FieldCodeGenerator.h
  73. include/decompiler/field/FieldDecompiler.h
  74. include/decompiler/field/FieldScriptFormatter.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. include/ModelsAndAnimationsDb.h
  92. include/ScopedLgp.h
  93. include/TexFile.h
  94. include/SpawnPointDb.h
  95. include/KernelDataInstaller.h
  96. include/MediaDataInstaller.h
  97. include/FieldDataInstaller.h
  98. )
  99. set(SOURCE_FILES
  100. src/common/Logger.cpp
  101. src/common/BinGZipFile.cpp
  102. src/common/DrawSkeleton.cpp
  103. src/common/Surface.cpp
  104. src/common/OgreGenUtilites.cpp
  105. src/common/FontFile.cpp
  106. src/common/TimToVram.cpp
  107. src/common/Vram.cpp
  108. src/common/OgreBase.cpp
  109. src/VGearsUtility.cpp
  110. src/decompiler/ScriptFormatter.cpp
  111. src/decompiler/LuaLanguage.cpp
  112. src/decompiler/CodeGenerator.cpp
  113. src/decompiler/ControlFlow.cpp
  114. src/decompiler/Disassembler.cpp
  115. src/decompiler/Engine.cpp
  116. src/decompiler/Graph.cpp
  117. src/decompiler/instruction/Instruction.cpp
  118. src/decompiler/instruction/BinaryOpStackInstruction.cpp
  119. src/decompiler/instruction/BoolNegateStackInstruction.cpp
  120. src/decompiler/instruction/CallInstruction.cpp
  121. src/decompiler/instruction/CondJumpInstruction.cpp
  122. src/decompiler/instruction/DupStackInstruction.cpp
  123. src/decompiler/instruction/KernelCallInstruction.cpp
  124. src/decompiler/instruction/KernelCallStackInstruction.cpp
  125. src/decompiler/instruction/LoadInstruction.cpp
  126. src/decompiler/instruction/ReturnInstruction.cpp
  127. src/decompiler/instruction/StackInstruction.cpp
  128. src/decompiler/instruction/StoreInstruction.cpp
  129. src/decompiler/instruction/UnaryOpPostfixStackInstruction.cpp
  130. src/decompiler/instruction/UnaryOpPrefixStackInstruction.cpp
  131. src/decompiler/instruction/UncondJumpInstruction.cpp
  132. src/decompiler/DecompilerException.cpp
  133. src/decompiler/Value.cpp
  134. src/decompiler/field/instruction/FieldBackgroundInstruction.cpp
  135. src/decompiler/field/instruction/FieldCameraInstruction.cpp
  136. src/decompiler/field/instruction/FieldCondJumpInstruction.cpp
  137. src/decompiler/field/instruction/FieldControlFlowInstruction.cpp
  138. src/decompiler/field/instruction/FieldMathInstruction.cpp
  139. src/decompiler/field/instruction/FieldMediaInstruction.cpp
  140. src/decompiler/field/instruction/FieldModelInstruction.cpp
  141. src/decompiler/field/instruction/FieldModuleInstruction.cpp
  142. src/decompiler/field/instruction/FieldNoOperationInstruction.cpp
  143. src/decompiler/field/instruction/FieldPartyInstruction.cpp
  144. src/decompiler/field/instruction/FieldUncategorizedInstruction.cpp
  145. src/decompiler/field/instruction/FieldUncondJumpInstruction.cpp
  146. src/decompiler/field/instruction/FieldWalkmeshInstruction.cpp
  147. src/decompiler/field/instruction/FieldWindowInstruction.cpp
  148. src/decompiler/field/FieldDisassembler.cpp
  149. src/decompiler/field/FieldEngine.cpp
  150. src/decompiler/field/FieldCodeGenerator.cpp
  151. src/decompiler/field/FieldDecompiler.cpp
  152. src/decompiler/field/FieldScriptFormatter.cpp
  153. src/decompiler/world/instruction/WorldBinaryEqualStackInstruction.cpp
  154. src/decompiler/world/instruction/WorldCondJumpInstruction.cpp
  155. src/decompiler/world/instruction/WorldKernelCallInstruction.cpp
  156. src/decompiler/world/instruction/WorldLoadBankInstruction.cpp
  157. src/decompiler/world/instruction/WorldLoadInstruction.cpp
  158. src/decompiler/world/instruction/WorldNoOutputInstruction.cpp
  159. src/decompiler/world/instruction/WorldStackInstruction.cpp
  160. src/decompiler/world/instruction/WorldStoreInstruction.cpp
  161. src/decompiler/world/instruction/WorldSubStackInstruction.cpp
  162. src/decompiler/world/instruction/WorldUncondJumpInstruction.cpp
  163. src/decompiler/world/WorldCodeGenerator.cpp
  164. src/decompiler/world/WorldDisassembler.cpp
  165. src/decompiler/world/WorldEngine.cpp
  166. src/ModelsAndAnimationsDb.cpp
  167. src/ScopedLgp.cpp
  168. src/TexFile.cpp
  169. src/KernelDataInstaller.cpp
  170. src/MediaDataInstaller.cpp
  171. src/FieldDataInstaller.cpp
  172. )
  173. # For SUDM. TODO: Add elses.
  174. if (UNIX)
  175. add_definitions(-DPOSIX)
  176. endif()
  177. add_library(Utility STATIC
  178. ${HEADER_FILES}
  179. ${SOURCE_FILES}
  180. )
  181. target_link_libraries(Utility
  182. ${OGRE_LIBRARIES}
  183. ${OIS_LIBRARIES}
  184. ${ZLIB_LIBRARIES}
  185. )
  186. SET_PROPERTY(TARGET Utility PROPERTY FOLDER "utilities")
  187. # DEBUG, no optimizations
  188. #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -rdynamic -O0")
  189. find_package ( Qt5Widgets REQUIRED )
  190. include_directories (
  191. ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
  192. ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}
  193. )
  194. set ( v-gears-launcher_HDRS
  195. include/MainWindow.h
  196. include/DataInstaller.h
  197. include/FieldTextWriter.h
  198. )
  199. set(v-gears-launcher_SRCS
  200. src/main.cpp
  201. src/MainWindow.cpp
  202. src/DataInstaller.cpp
  203. src/FieldTextWriter.cpp
  204. )
  205. set(v-gears-launcher_UIS
  206. src/MainWindow.ui
  207. )
  208. QT5_WRAP_UI(UIS ${v-gears-launcher_UIS})
  209. message(UIS: ${UIS})
  210. set(v-gears-launcher_MOCS
  211. include/MainWindow.h
  212. )
  213. QT5_WRAP_CPP(MOCS ${v-gears-launcher_MOCS})
  214. add_definitions(-DVGEARS_ADD_MANAGERS)
  215. add_executable (v-gears-launcher ${v-gears-launcher_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS})
  216. SET_PROPERTY(TARGET v-gears-launcher PROPERTY FOLDER "utilities")
  217. if (APPLE)
  218. target_link_libraries(v-gears-launcher "-framework CoreFoundation -framework Cocoa -framework IOKit")
  219. endif()
  220. if(WIN32)
  221. set_target_properties(v-gears-launcher PROPERTIES WIN32_EXECUTABLE ON)
  222. if (MSVC)
  223. set_target_properties(v-gears-launcher PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE")
  224. endif()
  225. endif()
  226. set(LIBRARIES
  227. Utility
  228. V-Gears
  229. v-gears-data
  230. #Sudm_Lib
  231. )
  232. find_package(Qt5 COMPONENTS Widgets REQUIRED)
  233. find_package(Qt5 COMPONENTS Core REQUIRED)
  234. target_link_libraries ( v-gears-launcher Qt5::Widgets Qt5::Core ${LIBRARIES} )
  235. if(WIN32 OR APPLE)
  236. install(TARGETS v-gears-launcher DESTINATION .)
  237. else()
  238. install(TARGETS v-gears-launcher RUNTIME DESTINATION bin)
  239. endif()