2013-08-22 14:22:49 +00:00
|
|
|
set(launcher_modmanager_SRCS
|
2017-08-15 21:17:00 +03:00
|
|
|
modManager/cdownloadmanager_moc.cpp
|
|
|
|
modManager/cmodlist.cpp
|
|
|
|
modManager/cmodlistmodel_moc.cpp
|
|
|
|
modManager/cmodlistview_moc.cpp
|
|
|
|
modManager/cmodmanager.cpp
|
|
|
|
modManager/imageviewer_moc.cpp
|
2013-08-22 14:22:49 +00:00
|
|
|
)
|
|
|
|
|
2017-07-13 02:44:58 +03:00
|
|
|
set(launcher_modmanager_HEADERS
|
2017-08-15 21:17:00 +03:00
|
|
|
modManager/cdownloadmanager_moc.h
|
|
|
|
modManager/cmodlist.h
|
|
|
|
modManager/cmodlistmodel_moc.h
|
|
|
|
modManager/cmodlistview_moc.h
|
|
|
|
modManager/cmodmanager.h
|
|
|
|
modManager/imageviewer_moc.h
|
2017-07-13 02:44:58 +03:00
|
|
|
)
|
|
|
|
|
2013-08-22 14:22:49 +00:00
|
|
|
set(launcher_settingsview_SRCS
|
2017-08-15 21:17:00 +03:00
|
|
|
settingsView/csettingsview_moc.cpp
|
2013-08-22 14:22:49 +00:00
|
|
|
)
|
|
|
|
|
2017-07-13 02:44:58 +03:00
|
|
|
set(launcher_settingsview_HEADERS
|
2017-08-15 21:17:00 +03:00
|
|
|
settingsView/csettingsview_moc.h
|
2017-07-13 02:44:58 +03:00
|
|
|
)
|
|
|
|
|
2013-08-22 14:22:49 +00:00
|
|
|
set(launcher_SRCS
|
2017-08-15 21:17:00 +03:00
|
|
|
StdInc.cpp
|
|
|
|
${launcher_modmanager_SRCS}
|
|
|
|
${launcher_settingsview_SRCS}
|
|
|
|
main.cpp
|
|
|
|
mainwindow_moc.cpp
|
|
|
|
launcherdirs.cpp
|
|
|
|
jsonutils.cpp
|
2022-09-04 20:32:48 +04:00
|
|
|
updatedialog_moc.cpp
|
2013-08-22 14:22:49 +00:00
|
|
|
)
|
|
|
|
|
2017-07-13 02:44:58 +03:00
|
|
|
set(launcher_HEADERS
|
2017-08-15 21:17:00 +03:00
|
|
|
StdInc.h
|
|
|
|
${launcher_modmanager_HEADERS}
|
|
|
|
${launcher_settingsview_HEADERS}
|
|
|
|
mainwindow_moc.h
|
|
|
|
launcherdirs.h
|
|
|
|
jsonutils.h
|
2022-09-04 20:32:48 +04:00
|
|
|
updatedialog_moc.h
|
2022-08-05 14:32:29 +03:00
|
|
|
main.h
|
2017-07-13 02:44:58 +03:00
|
|
|
)
|
|
|
|
|
2013-08-22 14:22:49 +00:00
|
|
|
set(launcher_FORMS
|
2017-08-15 21:17:00 +03:00
|
|
|
modManager/cmodlistview_moc.ui
|
|
|
|
modManager/imageviewer_moc.ui
|
|
|
|
settingsView/csettingsview_moc.ui
|
|
|
|
mainwindow_moc.ui
|
2022-09-04 20:32:48 +04:00
|
|
|
updatedialog_moc.ui
|
2013-08-22 14:22:49 +00:00
|
|
|
)
|
|
|
|
|
2021-04-19 03:38:20 +03:00
|
|
|
if(APPLE_IOS)
|
2022-08-05 14:32:29 +03:00
|
|
|
list(APPEND launcher_SRCS
|
2022-08-07 08:58:04 +03:00
|
|
|
ios/main.m
|
2022-08-05 14:32:29 +03:00
|
|
|
)
|
2021-04-19 03:38:20 +03:00
|
|
|
endif()
|
|
|
|
|
2017-08-15 21:17:00 +03:00
|
|
|
assign_source_group(${launcher_SRCS} ${launcher_HEADERS} VCMI_launcher.rc)
|
|
|
|
|
2013-08-22 14:22:49 +00:00
|
|
|
# Tell CMake to run moc when necessary:
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
2018-02-23 20:20:20 +01:00
|
|
|
if(POLICY CMP0071)
|
|
|
|
cmake_policy(SET CMP0071 NEW)
|
|
|
|
endif()
|
|
|
|
|
2013-08-22 14:22:49 +00:00
|
|
|
# As moc files are generated in the binary dir, tell CMake
|
|
|
|
# to always look for includes there:
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
2022-05-28 16:32:20 +03:00
|
|
|
if(TARGET Qt6::Core)
|
|
|
|
qt_wrap_ui(launcher_UI_HEADERS ${launcher_FORMS})
|
|
|
|
else()
|
|
|
|
qt5_wrap_ui(launcher_UI_HEADERS ${launcher_FORMS})
|
2017-08-15 21:17:00 +03:00
|
|
|
endif()
|
2013-08-22 14:22:49 +00:00
|
|
|
|
2014-07-11 00:57:17 +03:00
|
|
|
if(WIN32)
|
2017-08-15 21:17:00 +03:00
|
|
|
set(launcher_ICON VCMI_launcher.rc)
|
2014-07-11 00:57:17 +03:00
|
|
|
endif()
|
2013-08-22 14:22:49 +00:00
|
|
|
|
2022-08-03 10:49:04 +03:00
|
|
|
if(BUILD_SINGLE_APP)
|
|
|
|
add_library(vcmilauncher STATIC ${launcher_SRCS} ${launcher_HEADERS} ${launcher_UI_HEADERS})
|
|
|
|
else()
|
|
|
|
add_executable(vcmilauncher WIN32 ${launcher_SRCS} ${launcher_HEADERS} ${launcher_UI_HEADERS} ${launcher_ICON})
|
|
|
|
endif()
|
2017-08-15 21:17:00 +03:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set_target_properties(vcmilauncher
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "VCMI_launcher"
|
|
|
|
PROJECT_LABEL "VCMI_launcher"
|
|
|
|
)
|
|
|
|
|
|
|
|
# FIXME: Can't to get CMP0020 working with Vcpkg and CMake 3.8.2
|
|
|
|
# So far I tried:
|
|
|
|
# - cmake_minimum_required set to 2.8.11 globally and in this file
|
|
|
|
# - cmake_policy in all possible places
|
|
|
|
# - used NO_POLICY_SCOPE to make sure no other parts reset policies
|
|
|
|
# Still nothing worked, warning kept appearing and WinMain didn't link automatically
|
2022-05-28 16:32:20 +03:00
|
|
|
target_link_libraries(vcmilauncher Qt${QT_VERSION_MAJOR}::WinMain)
|
2014-10-12 16:40:49 +03:00
|
|
|
endif()
|
2013-08-22 14:22:49 +00:00
|
|
|
|
2017-08-11 05:31:23 +03:00
|
|
|
if(APPLE)
|
|
|
|
# This makes Xcode project prettier by moving vcmilauncher_autogen directory into vcmiclient subfolder
|
|
|
|
set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER vcmilauncher)
|
|
|
|
endif()
|
|
|
|
|
2022-07-29 09:52:39 +03:00
|
|
|
target_link_libraries(vcmilauncher ${VCMI_LIB_TARGET} Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
|
2019-01-19 00:57:54 +01:00
|
|
|
target_include_directories(vcmilauncher
|
|
|
|
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
2017-07-04 23:46:49 +03:00
|
|
|
vcmi_set_output_dir(vcmilauncher "")
|
2022-06-17 04:02:36 +08:00
|
|
|
enable_pch(vcmilauncher)
|
2014-02-01 13:37:26 +00:00
|
|
|
|
2021-04-19 03:38:20 +03:00
|
|
|
if(APPLE_IOS)
|
2022-08-03 10:49:04 +03:00
|
|
|
set(ICONS_DESTINATION ${DATA_DIR})
|
2022-10-13 13:04:32 +03:00
|
|
|
|
|
|
|
# workaround https://github.com/conan-io/conan-center-index/issues/13332
|
|
|
|
if(USING_CONAN)
|
|
|
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/QIOSIntegrationPlugin.h
|
|
|
|
"#include <QtPlugin>\nQ_IMPORT_PLUGIN(QIOSIntegrationPlugin)"
|
|
|
|
)
|
|
|
|
# target_include_directories(vcmilauncher PRIVATE ${CMAKE_BINARY_DIR})
|
|
|
|
target_link_libraries(vcmilauncher
|
|
|
|
Qt${QT_VERSION_MAJOR}::QIOSIntegrationPlugin
|
|
|
|
qt::QIOSIntegrationPlugin
|
|
|
|
)
|
|
|
|
endif()
|
2021-04-19 03:38:20 +03:00
|
|
|
else()
|
2022-08-03 10:49:04 +03:00
|
|
|
set(ICONS_DESTINATION ${DATA_DIR}/launcher)
|
|
|
|
|
2021-04-20 00:23:44 +03:00
|
|
|
# Copy to build directory for easier debugging
|
|
|
|
add_custom_command(TARGET vcmilauncher POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/launcher/icons
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/launcher/icons ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/launcher/icons
|
|
|
|
)
|
|
|
|
|
2021-04-19 03:38:20 +03:00
|
|
|
install(TARGETS vcmilauncher DESTINATION ${BIN_DIR})
|
2022-08-03 10:49:04 +03:00
|
|
|
|
2021-04-19 03:38:20 +03:00
|
|
|
# Install icons and desktop file on Linux
|
|
|
|
if(NOT WIN32 AND NOT APPLE)
|
|
|
|
install(FILES "vcmilauncher.desktop" DESTINATION share/applications)
|
|
|
|
install(FILES "eu.vcmi.VCMI.metainfo.xml" DESTINATION share/metainfo)
|
|
|
|
endif()
|
2013-08-22 14:22:49 +00:00
|
|
|
endif()
|
2022-08-03 10:49:04 +03:00
|
|
|
install(DIRECTORY icons DESTINATION ${ICONS_DESTINATION})
|