CMakeLists.txt 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. # Find packages required for the istaller.
  2. find_package(Qt5Widgets REQUIRED)
  3. find_package(ZLIB REQUIRED)
  4. find_package(Qt5 COMPONENTS Widgets REQUIRED)
  5. find_package(Qt5 COMPONENTS Core REQUIRED)
  6. # Source files for the installer.
  7. set(INSTALLER_SOURCE_FILES
  8. main.cpp
  9. BattleDataInstaller.cpp
  10. DataInstaller.cpp
  11. FieldDataInstaller.cpp
  12. FieldTextWriter.cpp
  13. KernelDataInstaller.cpp
  14. MainWindow.cpp
  15. MediaDataInstaller.cpp
  16. ModelsAndAnimationsDb.cpp
  17. ScopedLgp.cpp
  18. TexFile.cpp
  19. VGearsUtility.cpp
  20. WorldInstaller.cpp
  21. common/BinGZipFile.cpp
  22. common/DrawSkeleton.cpp
  23. common/FontFile.cpp
  24. common/Logger.cpp
  25. common/OgreBase.cpp
  26. common/OgreGenUtilites.cpp
  27. common/Surface.cpp
  28. common/TimToVram.cpp
  29. common/Vram.cpp
  30. data/AbFile.cpp
  31. data/BattleSceneFile.cpp
  32. data/DaFile.cpp
  33. data/WorldMapWalkmesh.cpp
  34. decompiler/CodeGenerator.cpp
  35. decompiler/ControlFlow.cpp
  36. decompiler/DecompilerException.cpp
  37. decompiler/Disassembler.cpp
  38. decompiler/Engine.cpp
  39. decompiler/field/FieldCodeGenerator.cpp
  40. decompiler/field/FieldDecompiler.cpp
  41. decompiler/field/FieldDisassembler.cpp
  42. decompiler/field/FieldEngine.cpp
  43. decompiler/field/FieldScriptFormatter.cpp
  44. decompiler/field/instruction/FieldBackgroundInstruction.cpp
  45. decompiler/field/instruction/FieldCameraInstruction.cpp
  46. decompiler/field/instruction/FieldCondJumpInstruction.cpp
  47. decompiler/field/instruction/FieldControlFlowInstruction.cpp
  48. decompiler/field/instruction/FieldMathInstruction.cpp
  49. decompiler/field/instruction/FieldMediaInstruction.cpp
  50. decompiler/field/instruction/FieldModelInstruction.cpp
  51. decompiler/field/instruction/FieldModuleInstruction.cpp
  52. decompiler/field/instruction/FieldNoOperationInstruction.cpp
  53. decompiler/field/instruction/FieldPartyInstruction.cpp
  54. decompiler/field/instruction/FieldUncategorizedInstruction.cpp
  55. decompiler/field/instruction/FieldUncondJumpInstruction.cpp
  56. decompiler/field/instruction/FieldWalkmeshInstruction.cpp
  57. decompiler/field/instruction/FieldWindowInstruction.cpp
  58. decompiler/Graph.cpp
  59. decompiler/instruction/BinaryOpStackInstruction.cpp
  60. decompiler/instruction/BoolNegateStackInstruction.cpp
  61. decompiler/instruction/CallInstruction.cpp
  62. decompiler/instruction/CondJumpInstruction.cpp
  63. decompiler/instruction/DupStackInstruction.cpp
  64. decompiler/instruction/Instruction.cpp
  65. decompiler/instruction/KernelCallInstruction.cpp
  66. decompiler/instruction/KernelCallStackInstruction.cpp
  67. decompiler/instruction/LoadInstruction.cpp
  68. decompiler/instruction/ReturnInstruction.cpp
  69. decompiler/instruction/StackInstruction.cpp
  70. decompiler/instruction/StoreInstruction.cpp
  71. decompiler/instruction/UnaryOpPostfixStackInstruction.cpp
  72. decompiler/instruction/UnaryOpPrefixStackInstruction.cpp
  73. decompiler/instruction/UncondJumpInstruction.cpp
  74. decompiler/LuaLanguage.cpp
  75. decompiler/ScriptFormatter.cpp
  76. decompiler/Value.cpp
  77. decompiler/world/instruction/WorldBinaryEqualStackInstruction.cpp
  78. decompiler/world/instruction/WorldCondJumpInstruction.cpp
  79. decompiler/world/instruction/WorldKernelCallInstruction.cpp
  80. decompiler/world/instruction/WorldLoadBankInstruction.cpp
  81. decompiler/world/instruction/WorldLoadInstruction.cpp
  82. decompiler/world/instruction/WorldNoOutputInstruction.cpp
  83. decompiler/world/instruction/WorldStackInstruction.cpp
  84. decompiler/world/instruction/WorldStoreInstruction.cpp
  85. decompiler/world/instruction/WorldSubStackInstruction.cpp
  86. decompiler/world/instruction/WorldUncondJumpInstruction.cpp
  87. decompiler/world/WorldCodeGenerator.cpp
  88. decompiler/world/WorldDisassembler.cpp
  89. decompiler/world/WorldEngine.cpp
  90. )
  91. # Included directories for the installer.
  92. include_directories (
  93. ${CMAKE_SOURCE_DIR}/src
  94. ${CMAKE_CURRENT_SOURCE_DIR}
  95. ${CMAKE_CURRENT_BINARY_DIR}
  96. ${ZLIB_INCLUDE_DIRS}
  97. ${OGRE_INCLUDE_DIRS}
  98. ${QT_QTCORE_INCLUDE_DIR}
  99. ${QT_QTGUI_INCLUDE_DIR}
  100. ${QT_QTCORE_INCLUDE_DIR}
  101. ${QT_QTGUI_INCLUDE_DIR}
  102. )
  103. # Generate QT UIs.
  104. set(v-gears-installer_UIS MainWindow.ui)
  105. QT5_WRAP_UI(UIS ${v-gears-installer_UIS})
  106. set(v-gears-installer_MOCS MainWindow.h)
  107. QT5_WRAP_CPP(MOCS ${v-gears-installer_MOCS})
  108. # Compiler options.
  109. if (UNIX) # For SUDM. TODO: Add elses?
  110. add_definitions(-DPOSIX)
  111. endif()
  112. # Generate v-gears-installer executable.
  113. add_executable (v-gears-installer ${INSTALLER_SOURCE_FILES} ${UIS} ${MOCS})
  114. SET_PROPERTY(TARGET v-gears-installer PROPERTY FOLDER "build/v-gears-installer")
  115. if (APPLE)
  116. target_link_libraries(v-gears-installer "-framework CoreFoundation -framework Cocoa -framework IOKit")
  117. endif()
  118. if(WIN32)
  119. set_target_properties(v-gears-installer PROPERTIES WIN32_EXECUTABLE ON)
  120. if (MSVC)
  121. set_target_properties(v-gears-installer PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE")
  122. endif()
  123. endif()
  124. target_link_libraries(v-gears-installer
  125. libvgears
  126. Qt5::Widgets
  127. Qt5::Core
  128. ${OIS_LIBRARIES}
  129. ${TinyXML_LIBRARIES}
  130. ${BOOST_LINK_LIBS}
  131. ${OGRE_LIBRARIES}
  132. ${ZLIB_LIBRARIES}
  133. )
  134. # If OgreBites was found by the top-level CMake as a deterministic fallback
  135. # it may be present in OGRE_LIBRARIES already; ensure it's visible here too.
  136. if(NOT OGRE_LIBRARIES MATCHES ".*OgreBites.*")
  137. if(EXISTS "/usr/lib/x86_64-linux-gnu/libOgreBites.so")
  138. list(APPEND OGRE_LIBRARIES "/usr/lib/x86_64-linux-gnu/libOgreBites.so")
  139. message(STATUS "Installer CMake: appended deterministic OgreBites path for linker: /usr/lib/x86_64-linux-gnu/libOgreBites.so")
  140. endif()
  141. endif()
  142. # Ensure any newly appended OGRE libraries are linked into the installer target
  143. if(OGRE_LIBRARIES)
  144. message(STATUS "Installer linking additional OGRE libraries: ${OGRE_LIBRARIES}")
  145. target_link_libraries(v-gears-installer ${OGRE_LIBRARIES})
  146. endif()
  147. # Install v-gears-installer.
  148. if(WIN32 OR APPLE)
  149. install(TARGETS v-gears-installer DESTINATION .)
  150. else()
  151. install(TARGETS v-gears-installer RUNTIME DESTINATION bin)
  152. endif()