mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 05:20:00 -08:00
Restore native Continuumatrice and Continuum-Servatrice CMake targets
This commit is contained in:
parent
7de50eb739
commit
905d58c201
1 changed files with 31 additions and 31 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# provides the cockatrice binary
|
# provides the cockatrice binary
|
||||||
|
|
||||||
project(Cockatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
project(Continuumatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||||
|
|
||||||
set(cockatrice_SOURCES
|
set(cockatrice_SOURCES
|
||||||
${VERSION_STRING_CPP}
|
${VERSION_STRING_CPP}
|
||||||
|
|
@ -457,7 +457,7 @@ set(cockatrice_SOURCES
|
||||||
add_subdirectory(sounds)
|
add_subdirectory(sounds)
|
||||||
add_subdirectory(themes)
|
add_subdirectory(themes)
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_SOURCE_DIR}/cockatrice/resources/config/qtlogging.ini ${CMAKE_BINARY_DIR}/cockatrice/qtlogging.ini COPYONLY
|
${CMAKE_CURRENT_SOURCE_DIR}/resources/config/qtlogging.ini ${CMAKE_CURRENT_BINARY_DIR}/qtlogging.ini COPYONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
set(cockatrice_RESOURCES cockatrice.qrc)
|
set(cockatrice_RESOURCES cockatrice.qrc)
|
||||||
|
|
@ -510,12 +510,12 @@ set(MIMEDIR
|
||||||
CACHE STRING "mime file destination"
|
CACHE STRING "mime file destination"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(COCKATRICE_MAC_QM_INSTALL_DIR "cockatrice.app/Contents/Resources/translations")
|
set(COCKATRICE_MAC_QM_INSTALL_DIR "continuumatrice.app/Contents/Resources/translations")
|
||||||
set(COCKATRICE_UNIX_QM_INSTALL_DIR "share/continuumatrice/translations")
|
set(COCKATRICE_UNIX_QM_INSTALL_DIR "share/continuumatrice/translations")
|
||||||
set(COCKATRICE_WIN32_QM_INSTALL_DIR "translations")
|
set(COCKATRICE_WIN32_QM_INSTALL_DIR "translations")
|
||||||
|
|
||||||
qt_add_executable(
|
qt_add_executable(
|
||||||
cockatrice
|
continuumatrice
|
||||||
WIN32
|
WIN32
|
||||||
MACOSX_BUNDLE
|
MACOSX_BUNDLE
|
||||||
${cockatrice_SOURCES}
|
${cockatrice_SOURCES}
|
||||||
|
|
@ -524,16 +524,12 @@ qt_add_executable(
|
||||||
MANUAL_FINALIZATION
|
MANUAL_FINALIZATION
|
||||||
)
|
)
|
||||||
|
|
||||||
# Keep the CMake target name for existing build dependencies and scripts while
|
# Product target is Continuumatrice on every platform. The source directory and
|
||||||
# installing an independently named Linux application alongside MTG Cockatrice.
|
# upstream libcockatrice_* library names remain internal implementation details.
|
||||||
if(UNIX AND NOT APPLE)
|
target_precompile_headers(continuumatrice PRIVATE "${CMAKE_SOURCE_DIR}/cmake/pch/qtwidgets_pch.h")
|
||||||
set_target_properties(cockatrice PROPERTIES OUTPUT_NAME continuumatrice)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_precompile_headers(cockatrice PRIVATE "${CMAKE_SOURCE_DIR}/cmake/pch/qtwidgets_pch.h")
|
|
||||||
|
|
||||||
qt_add_shaders(
|
qt_add_shaders(
|
||||||
cockatrice
|
continuumatrice
|
||||||
"onboarding_shaders"
|
"onboarding_shaders"
|
||||||
PREFIX
|
PREFIX
|
||||||
"/onboarding/shaders"
|
"/onboarding/shaders"
|
||||||
|
|
@ -545,7 +541,7 @@ qt_add_shaders(
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_add_resources(
|
qt_add_resources(
|
||||||
cockatrice
|
continuumatrice
|
||||||
"onboarding_qml"
|
"onboarding_qml"
|
||||||
PREFIX
|
PREFIX
|
||||||
"/onboarding/qml"
|
"/onboarding/qml"
|
||||||
|
|
@ -556,7 +552,7 @@ qt_add_resources(
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
cockatrice
|
continuumatrice
|
||||||
PUBLIC libcockatrice_card
|
PUBLIC libcockatrice_card
|
||||||
libcockatrice_deck_list
|
libcockatrice_deck_list
|
||||||
libcockatrice_filters
|
libcockatrice_filters
|
||||||
|
|
@ -569,23 +565,23 @@ target_link_libraries(
|
||||||
${COCKATRICE_QT_MODULES}
|
${COCKATRICE_QT_MODULES}
|
||||||
)
|
)
|
||||||
|
|
||||||
cockatrice_target_enable_crash_reporting(cockatrice)
|
cockatrice_target_enable_crash_reporting(continuumatrice)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}")
|
set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}")
|
||||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.cockatrice.${PROJECT_NAME}")
|
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.continuum-universes.continuumatrice")
|
||||||
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}-${PROJECT_VERSION}")
|
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}-${PROJECT_VERSION}")
|
||||||
set(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}")
|
set(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}")
|
||||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
|
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
|
||||||
set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
|
set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
|
||||||
|
|
||||||
set_target_properties(cockatrice PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/Info.plist)
|
set_target_properties(continuumatrice PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/Info.plist)
|
||||||
|
|
||||||
install(TARGETS cockatrice BUNDLE DESTINATION ./)
|
install(TARGETS continuumatrice BUNDLE DESTINATION ./)
|
||||||
else()
|
else()
|
||||||
# Assume linux
|
# Assume linux
|
||||||
install(TARGETS cockatrice RUNTIME DESTINATION bin/)
|
install(TARGETS continuumatrice RUNTIME DESTINATION bin/)
|
||||||
# Install using distinct names so the normal MTG client keeps its .desktop,
|
# Install using distinct names so the normal MTG client keeps its .desktop,
|
||||||
# icon and .cod / cockatrice:// file associations unchanged.
|
# icon and .cod / cockatrice:// file associations unchanged.
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.png
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.png
|
||||||
|
|
@ -611,13 +607,13 @@ if(UNIX)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
install(TARGETS cockatrice RUNTIME DESTINATION ./)
|
install(TARGETS continuumatrice RUNTIME DESTINATION ./)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
# these needs to be relative to CMAKE_INSTALL_PREFIX
|
# these needs to be relative to CMAKE_INSTALL_PREFIX
|
||||||
set(plugin_dest_dir cockatrice.app/Contents/Plugins)
|
set(plugin_dest_dir continuumatrice.app/Contents/Plugins)
|
||||||
set(qtconf_dest_dir cockatrice.app/Contents/Resources)
|
set(qtconf_dest_dir continuumatrice.app/Contents/Resources)
|
||||||
|
|
||||||
# Qt plugins: audio, iconengines, imageformats, multimedia, platforms, printsupport, styles, tls
|
# Qt plugins: audio, iconengines, imageformats, multimedia, platforms, printsupport, styles, tls
|
||||||
install(
|
install(
|
||||||
|
|
@ -638,7 +634,7 @@ if(APPLE)
|
||||||
)
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
DIRECTORY "${CMAKE_BINARY_DIR}/cockatrice/"
|
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
|
||||||
DESTINATION ${qtconf_dest_dir}/
|
DESTINATION ${qtconf_dest_dir}/
|
||||||
FILES_MATCHING
|
FILES_MATCHING
|
||||||
PATTERN "*.ini"
|
PATTERN "*.ini"
|
||||||
|
|
@ -660,7 +656,7 @@ Data = Resources\")
|
||||||
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dylib\")
|
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dylib\")
|
||||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||||
include(BundleUtilities)
|
include(BundleUtilities)
|
||||||
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/cockatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
|
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/continuumatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
|
||||||
"
|
"
|
||||||
COMPONENT Runtime
|
COMPONENT Runtime
|
||||||
)
|
)
|
||||||
|
|
@ -672,7 +668,7 @@ if(WIN32)
|
||||||
set(qtconf_dest_dir .)
|
set(qtconf_dest_dir .)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
DIRECTORY "$<TARGET_FILE_DIR:cockatrice>/"
|
DIRECTORY "$<TARGET_FILE_DIR:continuumatrice>/"
|
||||||
DESTINATION ./
|
DESTINATION ./
|
||||||
FILES_MATCHING
|
FILES_MATCHING
|
||||||
PATTERN "*.dll"
|
PATTERN "*.dll"
|
||||||
|
|
@ -706,7 +702,7 @@ if(WIN32)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
install(
|
install(
|
||||||
DIRECTORY "${CMAKE_BINARY_DIR}/cockatrice/"
|
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
|
||||||
DESTINATION ./
|
DESTINATION ./
|
||||||
FILES_MATCHING
|
FILES_MATCHING
|
||||||
PATTERN "*.ini"
|
PATTERN "*.ini"
|
||||||
|
|
@ -771,7 +767,7 @@ Data = Resources\")
|
||||||
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\")
|
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\")
|
||||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||||
include(BundleUtilities)
|
include(BundleUtilities)
|
||||||
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Cockatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
|
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/continuumatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
|
||||||
"
|
"
|
||||||
COMPONENT Runtime
|
COMPONENT Runtime
|
||||||
)
|
)
|
||||||
|
|
@ -781,7 +777,7 @@ if(Qt6LinguistTools_FOUND)
|
||||||
#Qt6 Translations happen after the executable is built up
|
#Qt6 Translations happen after the executable is built up
|
||||||
if(UPDATE_TRANSLATIONS)
|
if(UPDATE_TRANSLATIONS)
|
||||||
qt_add_translations(
|
qt_add_translations(
|
||||||
cockatrice
|
continuumatrice
|
||||||
TS_FILES
|
TS_FILES
|
||||||
${cockatrice_TS}
|
${cockatrice_TS}
|
||||||
SOURCES
|
SOURCES
|
||||||
|
|
@ -790,7 +786,7 @@ if(Qt6LinguistTools_FOUND)
|
||||||
cockatrice_QM
|
cockatrice_QM
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
qt_add_translations(cockatrice TS_FILES ${cockatrice_TS} QM_FILES_OUTPUT_VARIABLE cockatrice_QM)
|
qt_add_translations(continuumatrice TS_FILES ${cockatrice_TS} QM_FILES_OUTPUT_VARIABLE cockatrice_QM)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
|
@ -811,9 +807,13 @@ if(Qt6LinguistTools_FOUND)
|
||||||
# error on Xcode. Older Qt versions already add this dependency themselves.
|
# error on Xcode. Older Qt versions already add this dependency themselves.
|
||||||
foreach(_lrelease_target Cockatrice_lrelease cockatrice_lrelease)
|
foreach(_lrelease_target Cockatrice_lrelease cockatrice_lrelease)
|
||||||
if(TARGET ${_lrelease_target})
|
if(TARGET ${_lrelease_target})
|
||||||
add_dependencies(cockatrice ${_lrelease_target})
|
add_dependencies(continuumatrice ${_lrelease_target})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qt_finalize_target(cockatrice)
|
qt_finalize_target(continuumatrice)
|
||||||
|
|
||||||
|
# Compatibility with existing CI scripts calling --target cockatrice. No
|
||||||
|
# executable named cockatrice is created by this target.
|
||||||
|
add_custom_target(cockatrice DEPENDS continuumatrice)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue