2022-09-15 21:29:53 +00:00
|
|
|
# External dependencies.
|
2024-10-10 07:24:39 +00:00
|
|
|
find_package(Qt6 REQUIRED COMPONENTS Svg Widgets)
|
2022-09-18 07:04:02 +00:00
|
|
|
find_package(Threads REQUIRED)
|
2024-09-11 16:56:30 +00:00
|
|
|
|
2024-08-17 05:28:46 +00:00
|
|
|
if(WIN32 OR (UNIX AND NOT APPLE))
|
|
|
|
find_package(Vulkan REQUIRED)
|
|
|
|
endif()
|
2022-09-15 05:22:22 +00:00
|
|
|
|
2024-07-21 15:46:26 +00:00
|
|
|
if(APPLE)
|
|
|
|
find_library(HYPERVISOR Hypervisor REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
2024-10-21 20:35:32 +00:00
|
|
|
# Setup GUI.
|
2023-07-31 16:40:29 +00:00
|
|
|
add_executable(obliteration WIN32 MACOSX_BUNDLE
|
2023-02-06 16:36:05 +00:00
|
|
|
ansi_escape.cpp
|
2022-10-16 14:07:56 +00:00
|
|
|
app_data.cpp
|
2023-10-09 10:50:29 +00:00
|
|
|
core.cpp
|
2024-09-08 18:40:09 +00:00
|
|
|
cpu_settings.cpp
|
2024-07-25 20:13:24 +00:00
|
|
|
display_settings.cpp
|
2022-09-17 08:03:04 +00:00
|
|
|
game_models.cpp
|
2023-02-16 18:47:18 +00:00
|
|
|
initialize_wizard.cpp
|
2024-07-14 19:52:33 +00:00
|
|
|
launch_settings.cpp
|
2023-02-06 16:36:05 +00:00
|
|
|
log_formatter.cpp
|
2024-07-25 06:18:44 +00:00
|
|
|
logs_viewer.cpp
|
2022-09-16 02:12:25 +00:00
|
|
|
main.cpp
|
|
|
|
main_window.cpp
|
2022-10-23 12:43:35 +00:00
|
|
|
path.cpp
|
2024-03-30 15:27:55 +00:00
|
|
|
pkg_extractor.cpp
|
|
|
|
pkg_installer.cpp
|
2024-08-24 18:08:12 +00:00
|
|
|
profile_models.cpp
|
2022-10-02 21:26:37 +00:00
|
|
|
progress_dialog.cpp
|
2024-07-23 17:57:36 +00:00
|
|
|
resources.cpp
|
2022-09-19 07:08:26 +00:00
|
|
|
resources.qrc
|
2024-07-26 18:04:58 +00:00
|
|
|
screen.cpp
|
2022-09-20 14:50:30 +00:00
|
|
|
settings.cpp
|
2024-07-20 12:45:01 +00:00
|
|
|
system.cpp)
|
2022-09-15 21:29:53 +00:00
|
|
|
|
2022-10-01 18:33:26 +00:00
|
|
|
if(WIN32)
|
2024-08-13 18:27:11 +00:00
|
|
|
target_sources(obliteration PRIVATE resources.rc vulkan.cpp)
|
2023-08-05 12:04:58 +00:00
|
|
|
elseif(APPLE)
|
|
|
|
target_sources(obliteration PRIVATE resources/obliteration.icns)
|
2024-07-21 15:46:26 +00:00
|
|
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
2024-08-13 18:27:11 +00:00
|
|
|
target_sources(obliteration PRIVATE kvm.cpp vulkan.cpp)
|
2022-10-01 18:33:26 +00:00
|
|
|
endif()
|
|
|
|
|
2022-10-05 17:02:47 +00:00
|
|
|
set_target_properties(obliteration PROPERTIES AUTOMOC ON AUTORCC ON)
|
|
|
|
|
2023-08-05 12:04:58 +00:00
|
|
|
if(WIN32)
|
2022-10-05 17:02:47 +00:00
|
|
|
set_target_properties(obliteration PROPERTIES OUTPUT_NAME Obliteration)
|
|
|
|
endif()
|
2022-09-15 21:29:53 +00:00
|
|
|
|
2023-07-31 16:40:29 +00:00
|
|
|
if(APPLE)
|
2023-08-05 12:04:58 +00:00
|
|
|
set_target_properties(obliteration PROPERTIES
|
|
|
|
MACOSX_BUNDLE_GUI_IDENTIFIER io.github.obhq.obliteration
|
|
|
|
MACOSX_BUNDLE_BUNDLE_NAME Obliteration
|
|
|
|
MACOSX_BUNDLE_BUNDLE_VERSION 0.1.0
|
|
|
|
MACOSX_BUNDLE_SHORT_VERSION_STRING 0.1.0
|
2024-01-28 09:55:36 +00:00
|
|
|
MACOSX_BUNDLE_COPYRIGHT "Copyright © Obliteration Contributors"
|
2023-08-05 12:04:58 +00:00
|
|
|
MACOSX_BUNDLE_ICON_FILE obliteration
|
|
|
|
RESOURCE resources/obliteration.icns)
|
2023-07-31 16:40:29 +00:00
|
|
|
endif()
|
|
|
|
|
2022-09-15 21:29:53 +00:00
|
|
|
target_compile_features(obliteration PRIVATE cxx_std_17)
|
|
|
|
|
2024-10-10 07:24:39 +00:00
|
|
|
target_link_libraries(obliteration PRIVATE Qt6::Svg Qt6::Widgets)
|
2022-09-18 07:04:02 +00:00
|
|
|
target_link_libraries(obliteration PRIVATE Threads::Threads)
|
2024-10-21 20:35:32 +00:00
|
|
|
target_link_libraries(obliteration PRIVATE gui)
|
2022-09-15 05:31:45 +00:00
|
|
|
|
2024-11-11 04:16:48 +00:00
|
|
|
if(WIN32 OR (UNIX AND NOT APPLE))
|
|
|
|
target_link_libraries(obliteration PRIVATE Vulkan::Vulkan)
|
|
|
|
endif()
|
|
|
|
|
2022-09-18 07:04:02 +00:00
|
|
|
if(WIN32)
|
2024-07-21 15:46:26 +00:00
|
|
|
target_link_libraries(obliteration PRIVATE bcrypt imm32 ntdll setupapi userenv version winhvplatform winmm ws2_32)
|
|
|
|
elseif(APPLE)
|
|
|
|
target_link_libraries(obliteration PRIVATE ${HYPERVISOR})
|
2022-09-18 07:30:25 +00:00
|
|
|
else()
|
|
|
|
target_link_libraries(obliteration PRIVATE ${CMAKE_DL_LIBS})
|
2022-09-18 07:04:02 +00:00
|
|
|
endif()
|
2022-09-24 10:20:29 +00:00
|
|
|
|
2024-07-22 06:49:13 +00:00
|
|
|
if(APPLE)
|
|
|
|
add_custom_command(TARGET obliteration POST_BUILD
|
|
|
|
COMMAND codesign -s - --entitlements ${CMAKE_SOURCE_DIR}/entitlements.plist obliteration.app)
|
|
|
|
endif()
|
|
|
|
|
2022-09-24 10:20:29 +00:00
|
|
|
# Setup installation.
|
|
|
|
if(WIN32)
|
|
|
|
install(TARGETS obliteration DESTINATION .)
|
|
|
|
else()
|
2023-08-05 12:04:58 +00:00
|
|
|
install(TARGETS obliteration BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
install(SCRIPT deploy-win32.cmake)
|
|
|
|
elseif(APPLE)
|
|
|
|
qt_generate_deploy_app_script(
|
|
|
|
TARGET obliteration
|
|
|
|
OUTPUT_SCRIPT QT_DEPLOY_SCRIPT
|
|
|
|
NO_TRANSLATIONS
|
|
|
|
NO_COMPILER_RUNTIME)
|
|
|
|
|
|
|
|
install(SCRIPT ${QT_DEPLOY_SCRIPT})
|
2022-09-24 10:20:29 +00:00
|
|
|
endif()
|
|
|
|
|
2023-08-05 12:04:58 +00:00
|
|
|
if(APPLE)
|
2024-11-03 18:21:08 +00:00
|
|
|
install(IMPORTED_RUNTIME_ARTIFACTS obkrnl DESTINATION obliteration.app/Contents/Resources)
|
2023-08-05 12:04:58 +00:00
|
|
|
else()
|
2024-11-03 18:21:08 +00:00
|
|
|
install(IMPORTED_RUNTIME_ARTIFACTS obkrnl DESTINATION share)
|
2023-08-05 12:04:58 +00:00
|
|
|
endif()
|