首先从官方下载源码: https://github.com/nextcloud/desktop Desktop sync client for Nextcloud. Contribute to nextcloud/desktop development by creating an account on GitHub.https://github.com/nextcloud/desktop
我选择的是3.9.1的稳定版本。
打开VS2019的 : X64 Native Tools Command Prompt for VS 2019
进入源码目录执行:
F:\desktop-3.9.1>cmake -S . -B build -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=F:\nextcloud-desktop-client -DCMAKE_BUILD_TYPE=Debug
报错:Qt5Keychain 找不到
Compiling with updater
CMake Error at src/CMakeLists.txt:63 (get_target_property):
get_target_property() called with non-existent target "Qt5::qmake".
-- Using Qt ()
CMake Error at src/CMakeLists.txt:67 (find_package):
By not providing "FindQt5Keychain.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Keychain", but CMake did not find one.
Could not find a package configuration file provided by "Qt5Keychain" with
any of the following names:
Qt5KeychainConfig.cmake
qt5keychain-config.cmake
Add the installation prefix of "Qt5Keychain" to CMAKE_PREFIX_PATH or set
"Qt5Keychain_DIR" to a directory containing one of the above files. If
"Qt5Keychain" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
查看src/CMakeLists.txt 的63行代码,代表不使用TOKEN_AUTH_ONLY,我们修改为使用
if(NOT TOKEN_AUTH_ONLY)
find_package(Qt5Keychain REQUIRED)
endif()
把 option(TOKEN_AUTH_ONLY "TOKEN_AUTH_ONLY" OFF) 改为
option(TOKEN_AUTH_ONLY "TOKEN_AUTH_ONLY" ON)
然后继续,接下来有报错:"KF5Archive", but CMake did not find one. 没有安装的错误。
CMake Error at src/gui/CMakeLists.txt:3 (find_package):
By not providing "FindKF5Archive.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"KF5Archive", but CMake did not find one.
Could not find a package configuration file provided by "KF5Archive" with
any of the following names:
KF5ArchiveConfig.cmake
kf5archive-config.cmake
Add the installation prefix of "KF5Archive" to CMAKE_PREFIX_PATH or set
"KF5Archive_DIR" to a directory containing one of the above files. If
"KF5Archive" provides a separate development package or SDK, be sure it has
been installed.
下载KArchive : GitHub - KDE/karchive: Qt 5 addon providing access to numerous types of archivesQt 5 addon providing access to numerous types of archives - GitHub - KDE/karchive: Qt 5 addon providing access to numerous types of archiveshttps://github.com/KDE/karchive设置了ECM_DIR的环境变量,还是报错。
F:\karchive-master\build>cmake ..
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19045.
-- Could NOT find ECM (missing: ECM_DIR)
--
* ECM (required version >= 5.240.0), Extra CMake Modules.,
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FeatureSummary.cmake:464 (message):
feature_summary() Error: REQUIRED package(s) are missing, aborting CMake
run.
Call Stack (most recent call first):
CMakeLists.txt:9 (feature_summary)
ECM下载路径:
Frameworks / Extra CMake Modules · GitLabExtra modules and scripts for CMake.https://invent.kde.org/frameworks/extra-cmake-modules
KArchive编译不过去, 暂时没解决,继续研究