mirror of
https://github.com/HIllya51/LunaHook.git
synced 2025-01-12 04:49:37 +08:00
Update QtUtils.cmake
This commit is contained in:
parent
71a22be841
commit
a512437f1b
@ -14,39 +14,45 @@ macro(msvc_registry_search)
|
|||||||
# assume the latest version will be last alphabetically
|
# assume the latest version will be last alphabetically
|
||||||
list(REVERSE QT_VERSIONS)
|
list(REVERSE QT_VERSIONS)
|
||||||
|
|
||||||
list(GET QT_VERSIONS 0 QT_VERSION)
|
list(LENGTH QT_VERSIONS QT_VERSIONS_LENGTH)
|
||||||
|
if(${QT_VERSIONS_LENGTH} EQUAL 0)
|
||||||
# fix any double slashes which seem to be common
|
message(WARNING "Required QT5 toolchain is not installed")
|
||||||
string(REPLACE "//" "/" QT_VERSION "${QT_VERSION}")
|
|
||||||
|
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1920)
|
|
||||||
set(QT_MSVC 2019)
|
|
||||||
elseif(MSVC_VERSION GREATER_EQUAL 1910)
|
|
||||||
set(QT_MSVC 2017)
|
|
||||||
elseif(MSVC_VERSION GREATER_EQUAL 1900)
|
|
||||||
set(QT_MSVC 2015)
|
|
||||||
else()
|
else()
|
||||||
message(WARNING "Unsupported MSVC toolchain version")
|
list(GET QT_VERSIONS 0 QT_VERSION)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(QT_MSVC)
|
# fix any double slashes which seem to be common
|
||||||
if(CMAKE_CL_64)
|
string(REPLACE "//" "/" QT_VERSION "${QT_VERSION}")
|
||||||
SET(QT_SUFFIX "_64")
|
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1920)
|
||||||
|
set(QT_MSVC 2019)
|
||||||
|
elseif(MSVC_VERSION GREATER_EQUAL 1910)
|
||||||
|
set(QT_MSVC 2017)
|
||||||
|
elseif(MSVC_VERSION GREATER_EQUAL 1900)
|
||||||
|
set(QT_MSVC 2015)
|
||||||
else()
|
else()
|
||||||
set(QT_SUFFIX "")
|
message(WARNING "Unsupported MSVC toolchain version")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# MSVC 2015+ is only backwards compatible
|
if(QT_MSVC)
|
||||||
if(EXISTS "${QT_VERSION}/msvc${QT_MSVC}${QT_SUFFIX}")
|
if(CMAKE_CL_64)
|
||||||
set(Qt5_DIR "${QT_VERSION}/msvc${QT_MSVC}${QT_SUFFIX}/lib/cmake/Qt5")
|
SET(QT_SUFFIX "_64")
|
||||||
elseif(QT_MSVC GREATER_EQUAL 2019 AND EXISTS "${QT_VERSION}/msvc2017${QT_SUFFIX}")
|
else()
|
||||||
set(Qt5_DIR "${QT_VERSION}/msvc2017${QT_SUFFIX}/lib/cmake/Qt5")
|
set(QT_SUFFIX "")
|
||||||
elseif(QT_MSVC GREATER_EQUAL 2017 AND EXISTS "${QT_VERSION}/msvc2015${QT_SUFFIX}")
|
endif()
|
||||||
set(Qt5_DIR "${QT_VERSION}/msvc2015${QT_SUFFIX}/lib/cmake/Qt5")
|
|
||||||
else()
|
# MSVC 2015+ is only backwards compatible
|
||||||
message(WARNING "Required QT5 toolchain is not installed")
|
if(EXISTS "${QT_VERSION}/msvc${QT_MSVC}${QT_SUFFIX}")
|
||||||
|
set(Qt5_DIR "${QT_VERSION}/msvc${QT_MSVC}${QT_SUFFIX}/lib/cmake/Qt5")
|
||||||
|
elseif(QT_MSVC GREATER_EQUAL 2019 AND EXISTS "${QT_VERSION}/msvc2017${QT_SUFFIX}")
|
||||||
|
set(Qt5_DIR "${QT_VERSION}/msvc2017${QT_SUFFIX}/lib/cmake/Qt5")
|
||||||
|
elseif(QT_MSVC GREATER_EQUAL 2017 AND EXISTS "${QT_VERSION}/msvc2015${QT_SUFFIX}")
|
||||||
|
set(Qt5_DIR "${QT_VERSION}/msvc2015${QT_SUFFIX}/lib/cmake/Qt5")
|
||||||
|
else()
|
||||||
|
message(WARNING "Required QT5 toolchain is not installed")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user