CMakeLists.txt 6.4 KB

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