mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
simplify legacy qtdir logic
This commit is contained in:
parent
a617d32ddf
commit
b2ce234b96
2 changed files with 22 additions and 49 deletions
|
|
@ -53,21 +53,6 @@ if(WIN32 OR USE_VCPKG) # Windows (including 64bit) or USE_VCPKG set
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
CACHE FILEPATH "Vcpkg toolchain file"
|
||||
)
|
||||
|
||||
# Show warning if QTDIR is NOT defined
|
||||
if(NOT QTDIR
|
||||
AND NOT DEFINED ENV{QTDIR}
|
||||
AND NOT DEFINED ENV{QTDIR64}
|
||||
)
|
||||
set(QTDIR
|
||||
""
|
||||
CACHE PATH "Path to Qt (e.g. C:/Qt/6.4.2/msvc2019_64)"
|
||||
)
|
||||
message(
|
||||
WARNING
|
||||
"QTDIR variable is missing. Please set this variable to specify path to Qt (e.g. C:/Qt/6.4.2/msvc2019_64)"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# A project name is needed for CPack
|
||||
|
|
@ -196,16 +181,11 @@ endif()
|
|||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
if(DEFINED QTDIR)
|
||||
list(APPEND CMAKE_PREFIX_PATH "${QTDIR}")
|
||||
elseif(DEFINED ENV{QTDIR})
|
||||
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Update Translations: ${UPDATE_TRANSLATIONS}")
|
||||
|
||||
include(FindQtRuntime)
|
||||
|
||||
# Qt is located through normal CMake package discovery
|
||||
find_package(Qt6 6.4 REQUIRED)
|
||||
|
||||
set(CMAKE_AUTOMOC TRUE)
|
||||
|
|
|
|||
|
|
@ -8,49 +8,42 @@
|
|||
# Output: TEST_QT_MODULES
|
||||
|
||||
set(REQUIRED_QT_COMPONENTS Core)
|
||||
|
||||
if(WITH_SERVER)
|
||||
set(_SERVATRICE_NEEDED Network Sql WebSockets)
|
||||
list(APPEND REQUIRED_QT_COMPONENTS Network Sql WebSockets)
|
||||
endif()
|
||||
if(WITH_CLIENT)
|
||||
set(_COCKATRICE_NEEDED
|
||||
Concurrent
|
||||
Gui
|
||||
Multimedia
|
||||
Network
|
||||
PrintSupport
|
||||
ShaderTools
|
||||
Svg
|
||||
WebSockets
|
||||
Widgets
|
||||
Xml
|
||||
Quick
|
||||
QuickWidgets
|
||||
list(
|
||||
APPEND
|
||||
REQUIRED_QT_COMPONENTS
|
||||
Concurrent
|
||||
Gui
|
||||
Multimedia
|
||||
Network
|
||||
PrintSupport
|
||||
ShaderTools
|
||||
Svg
|
||||
WebSockets
|
||||
Widgets
|
||||
Xml
|
||||
Quick
|
||||
QuickWidgets
|
||||
)
|
||||
endif()
|
||||
if(WITH_ORACLE)
|
||||
set(_ORACLE_NEEDED Concurrent Network Svg Widgets)
|
||||
list(APPEND REQUIRED_QT_COMPONENTS Concurrent Network Svg Widgets)
|
||||
endif()
|
||||
if(TEST)
|
||||
# Union of Qt modules required across all test targets (independent of application targets).
|
||||
# When adding a new test that needs additional Qt modules, add them here rather than in the test's CMakeLists.txt.
|
||||
set(_TEST_NEEDED Concurrent Network Svg Widgets)
|
||||
# When adding a new test that needs additional Qt modules, add them here rather than in the test's CMakeLists.txt
|
||||
list(APPEND REQUIRED_QT_COMPONENTS Concurrent Network Svg Widgets)
|
||||
endif()
|
||||
|
||||
set(REQUIRED_QT_COMPONENTS ${REQUIRED_QT_COMPONENTS} ${_SERVATRICE_NEEDED} ${_COCKATRICE_NEEDED} ${_ORACLE_NEEDED}
|
||||
${_TEST_NEEDED}
|
||||
)
|
||||
list(REMOVE_DUPLICATES REQUIRED_QT_COMPONENTS)
|
||||
|
||||
# Find Qt and all required components including Linguist
|
||||
find_package(
|
||||
Qt6
|
||||
COMPONENTS ${REQUIRED_QT_COMPONENTS} Linguist
|
||||
QUIET HINTS ${Qt6_DIR}
|
||||
)
|
||||
find_package(Qt6 REQUIRED COMPONENTS ${REQUIRED_QT_COMPONENTS} Linguist)
|
||||
|
||||
if(NOT Qt6_FOUND)
|
||||
message(FATAL_ERROR "No suitable version of Qt was found")
|
||||
endif()
|
||||
set(COCKATRICE_QT_VERSION_NAME Qt6)
|
||||
|
||||
list(FIND Qt6LinguistTools_TARGETS Qt6::lrelease QT6_LRELEASE_INDEX)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue