obliteration/gui/CMakeLists.txt

108 lines
2.9 KiB
CMake
Raw Normal View History

2022-09-15 21:29:53 +00:00
# External dependencies.
find_package(Qt6 REQUIRED COMPONENTS Svg Widgets)
2022-09-18 07:04:02 +00:00
find_package(Threads REQUIRED)
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
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
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
display_settings.cpp
2022-09-17 08:03:04 +00:00
game_models.cpp
initialize_wizard.cpp
2024-07-14 19:52:33 +00:00
launch_settings.cpp
log_formatter.cpp
logs_viewer.cpp
main.cpp
main_window.cpp
path.cpp
2024-03-30 15:27:55 +00:00
pkg_extractor.cpp
pkg_installer.cpp
profile_models.cpp
progress_dialog.cpp
resources.cpp
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)
elseif(APPLE)
target_sources(obliteration PRIVATE resources/obliteration.icns)
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()
2024-10-21 20:35:32 +00:00
add_dependencies(obliteration kernel)
2022-09-18 02:57:50 +00:00
set_target_properties(obliteration PROPERTIES AUTOMOC ON AUTORCC ON)
if(WIN32)
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)
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
MACOSX_BUNDLE_COPYRIGHT "Copyright © Obliteration Contributors"
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)
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
2022-09-18 07:04:02 +00:00
if(WIN32)
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()
if(APPLE)
add_custom_command(TARGET obliteration POST_BUILD
COMMAND codesign -s - --entitlements ${CMAKE_SOURCE_DIR}/entitlements.plist obliteration.app)
endif()
# Setup installation.
if(WIN32)
install(TARGETS obliteration DESTINATION .)
else()
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})
endif()
if(APPLE)
2024-07-14 12:13:36 +00:00
install(FILES ${KERNEL} DESTINATION obliteration.app/Contents/Resources)
else()
2024-07-14 12:13:36 +00:00
install(FILES ${KERNEL} TYPE DATA)
endif()