mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-12 20:55:56 +00:00
rename cmake file, add check before running cmake and add inheritation to presets
This commit is contained in:
parent
bee3f1075d
commit
321ed8b267
4 changed files with 40 additions and 68 deletions
|
@ -214,7 +214,9 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/common/scm_rev.cpp.in" "${CMAKE_
|
||||||
|
|
||||||
message("end git things, remote: ${GIT_REMOTE_NAME}, branch: ${GIT_BRANCH}")
|
message("end git things, remote: ${GIT_REMOTE_NAME}, branch: ${GIT_BRANCH}")
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/findQt.cmake")
|
if(WIN32 AND ENABLE_QT_GUI AND NOT CMAKE_PREFIX_PATH)
|
||||||
|
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/DetectQtInstallation.cmake")
|
||||||
|
endif ()
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
find_package(Boost 1.84.0 CONFIG)
|
find_package(Boost 1.84.0 CONFIG)
|
||||||
|
|
|
@ -6,6 +6,22 @@
|
||||||
"patch": 0
|
"patch": 0
|
||||||
},
|
},
|
||||||
"configurePresets": [
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "x64-Clang-Base",
|
||||||
|
"hidden": true,
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/Build/${presetName}",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_C_COMPILER": "clang-cl",
|
||||||
|
"CMAKE_CXX_COMPILER": "clang-cl",
|
||||||
|
"CMAKE_INSTALL_PREFIX": "${sourceDir}/Build/${presetName}"
|
||||||
|
},
|
||||||
|
"vendor": {
|
||||||
|
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||||
|
"intelliSenseMode": "windows-clang-x64"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "x64-Clang-Debug",
|
"name": "x64-Clang-Debug",
|
||||||
"displayName": "Clang x64 Debug",
|
"displayName": "Clang x64 Debug",
|
||||||
|
@ -26,89 +42,44 @@
|
||||||
{
|
{
|
||||||
"name": "x64-Clang-Debug-Qt",
|
"name": "x64-Clang-Debug-Qt",
|
||||||
"displayName": "Clang x64 Debug with Qt",
|
"displayName": "Clang x64 Debug with Qt",
|
||||||
"generator": "Ninja",
|
"inherits": ["x64-Clang-Base"],
|
||||||
"binaryDir": "${sourceDir}/Build/x64-Clang-Debug-Qt",
|
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "clang-cl",
|
|
||||||
"CMAKE_CXX_COMPILER": "clang-cl",
|
|
||||||
"CMAKE_BUILD_TYPE": "Debug",
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/Install/x64-Clang-Debug-Qt",
|
|
||||||
"ENABLE_QT_GUI": "ON"
|
"ENABLE_QT_GUI": "ON"
|
||||||
},
|
|
||||||
"vendor": {
|
|
||||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
|
||||||
"intelliSenseMode": "windows-clang-x64"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "x64-Clang-Release",
|
"name": "x64-Clang-Release",
|
||||||
"displayName": "Clang x64 Release",
|
"displayName": "Clang x64 Release",
|
||||||
"generator": "Ninja",
|
"inherits": ["x64-Clang-Base"],
|
||||||
"binaryDir": "${sourceDir}/Build/x64-Clang-Release",
|
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "clang-cl",
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
"CMAKE_CXX_COMPILER": "clang-cl",
|
|
||||||
"CMAKE_BUILD_TYPE": "Release",
|
|
||||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/Install/x64-Clang-Release"
|
|
||||||
},
|
|
||||||
"vendor": {
|
|
||||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
|
||||||
"intelliSenseMode": "windows-clang-x64"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "x64-Clang-Release-Qt",
|
"name": "x64-Clang-Release-Qt",
|
||||||
"displayName": "Clang x64 Release with Qt",
|
"displayName": "Clang x64 Release with Qt",
|
||||||
"generator": "Ninja",
|
"inherits": ["x64-Clang-Base"],
|
||||||
"binaryDir": "${sourceDir}/Build/x64-Clang-Release-Qt",
|
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "clang-cl",
|
|
||||||
"CMAKE_CXX_COMPILER": "clang-cl",
|
|
||||||
"CMAKE_BUILD_TYPE": "Release",
|
"CMAKE_BUILD_TYPE": "Release",
|
||||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/Install/x64-Clang-Release-Qt",
|
|
||||||
"ENABLE_QT_GUI": "ON"
|
"ENABLE_QT_GUI": "ON"
|
||||||
},
|
|
||||||
"vendor": {
|
|
||||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
|
||||||
"intelliSenseMode": "windows-clang-x64"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "x64-Clang-RelWithDebInfo",
|
"name": "x64-Clang-RelWithDebInfo",
|
||||||
"displayName": "Clang x64 RelWithDebInfo",
|
"displayName": "Clang x64 RelWithDebInfo",
|
||||||
"generator": "Ninja",
|
"inherits": ["x64-Clang-Base"],
|
||||||
"binaryDir": "${sourceDir}/Build/x64-Clang-RelWithDebInfo",
|
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "clang-cl",
|
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||||
"CMAKE_CXX_COMPILER": "clang-cl",
|
|
||||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
|
|
||||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/Install/x64-Clang-RelWithDebInfo"
|
|
||||||
},
|
|
||||||
"vendor": {
|
|
||||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
|
||||||
"intelliSenseMode": "windows-clang-x64"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "x64-Clang-RelWithDebInfo-Qt",
|
"name": "x64-Clang-RelWithDebInfo-Qt",
|
||||||
"displayName": "Clang x64 RelWithDebInfo with Qt",
|
"displayName": "Clang x64 RelWithDebInfo with Qt",
|
||||||
"generator": "Ninja",
|
"inherits": ["x64-Clang-Base"],
|
||||||
"binaryDir": "${sourceDir}/Build/x64-Clang-RelWithDebInfo-Qt",
|
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "clang-cl",
|
|
||||||
"CMAKE_CXX_COMPILER": "clang-cl",
|
|
||||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
|
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
|
||||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/Install/x64-Clang-RelWithDebInfo-Qt",
|
|
||||||
"ENABLE_QT_GUI": "ON"
|
"ENABLE_QT_GUI": "ON"
|
||||||
},
|
|
||||||
"vendor": {
|
|
||||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
|
||||||
"intelliSenseMode": "windows-clang-x64"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
14
cmake/DetectQtInstallation.cmake
Normal file
14
cmake/DetectQtInstallation.cmake
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||||
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
file(GLOB QT_KITS LIST_DIRECTORIES true "C:/Qt/*/msvc*")
|
||||||
|
list(SORT QT_KITS COMPARE NATURAL)
|
||||||
|
list(REVERSE QT_KITS)
|
||||||
|
list(GET QT_KITS 0 QT_PREFIX)
|
||||||
|
if(QT_PREFIX)
|
||||||
|
set(CMAKE_PREFIX_PATH "${QT_PREFIX}" CACHE PATH "Qt prefix auto‑detected" FORCE)
|
||||||
|
message(STATUS "Auto-detected Qt prefix: ${QT_PREFIX}")
|
||||||
|
else()
|
||||||
|
message(WARNING "findQt.cmake: no Qt‑Directory found in C:/Qt – please set CMAKE_PREFIX_PATH manually")
|
||||||
|
endif()
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
if(WIN32 AND NOT CMAKE_PREFIX_PATH)
|
|
||||||
file(GLOB QT_KITS LIST_DIRECTORIES true "C:/Qt/*/msvc*")
|
|
||||||
list(SORT QT_KITS COMPARE NATURAL)
|
|
||||||
list(REVERSE QT_KITS)
|
|
||||||
list(GET QT_KITS 0 QT_PREFIX)
|
|
||||||
if(QT_PREFIX)
|
|
||||||
set(CMAKE_PREFIX_PATH "${QT_PREFIX}" CACHE PATH "Qt prefix auto‑detected" FORCE)
|
|
||||||
message(STATUS "Auto-detected Qt prefix: ${QT_PREFIX}")
|
|
||||||
else()
|
|
||||||
message(WARNING "findQt.cmake: no Qt‑Directory found in C:/Qt – please set CMAKE_PREFIX_PATH manually")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
Loading…
Add table
Add a link
Reference in a new issue