Skip to content

Commit 608dac1

Browse files
committed
CI: add build QFtpServer
1 parent 919d197 commit 608dac1

2 files changed

Lines changed: 36 additions & 14 deletions

File tree

.github/workflows/android.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,25 @@ jobs:
339339
cmake --build . --config Release --target install
340340
fi
341341
342+
- name: Build QFtpServer
343+
working-directory: ${{env.SOURCE_DIR}}
344+
run: |
345+
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/QFtpServerLib/QFtpServerLib ]; then
346+
git clone --depth=1 https://github.com/KangLin/QFtpServer.git
347+
cd QFtpServer
348+
cmake -E make_directory build
349+
cd build
350+
${QT_ROOT_DIR}/bin/qt-cmake .. -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} \
351+
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
352+
-DCMAKE_PREFIX_PATH=${QT_ROOT_DIR}:${{env.INSTALL_DIR}}/lib/cmake \
353+
-DQT_HOST_PATH=${QT_ROOT_DIR}/../gcc_64 \
354+
-DQt6LinguistTools_DIR=${QT_ROOT_DIR}/../gcc_64/lib/cmake/Qt6LinguistTools \
355+
-DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE} \
356+
-DWITH_APP=OFF
357+
cmake --build . --config Release --parallel $(nproc)
358+
cmake --build . --config Release --target install
359+
fi
360+
342361
- name: git clone RabbitCommon
343362
working-directory: ${{env.SOURCE_DIR}}
344363
run: git clone https://github.com/KangLin/RabbitCommon.git
@@ -371,7 +390,7 @@ jobs:
371390
-DRABBIT_ENABLE_INSTALL_DEPENDENT=ON \
372391
-DRABBIT_ENABLE_INSTALL_QT=ON \
373392
-DRABBIT_ENABLE_INSTALL_TO_BUILD_PATH=ON \
374-
-DCMAKE_PREFIX_PATH=${QT_ROOT_DIR}:${{env.INSTALL_DIR}}/lib/cmake \
393+
-DCMAKE_PREFIX_PATH=${QT_ROOT_DIR}:${{env.INSTALL_DIR}} \
375394
-DQT_HOST_PATH=${QT_ROOT_DIR}/../gcc_64 \
376395
-DQT_ANDROID_SIGN_APK=ON \
377396
-DQT_ENABLE_VERBOSE_DEPLOYMENT=ON \
@@ -389,6 +408,7 @@ jobs:
389408
-DINSTALL_QTERMWIDGET=ON \
390409
-DQt6Keychain_DIR=${{env.INSTALL_DIR}}/lib/cmake/Qt6Keychain \
391410
-DINSTALL_QTKEYCHAIN=ON \
411+
-DQFtpServerLib_DIR=${{env.INSTALL_DIR}}/lib/cmake/QFtpServerLib \
392412
-DINSTALL_QFtpServer=ON
393413
cmake --build . --parallel $(nproc) --verbose --config ${{matrix.BUILD_TYPE}} --target all
394414
APK_FILE=`find . -name "android-*.apk"`

Plugins/FtpServer/CMakeLists.txt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ project(FtpServer
66

77
find_package(QFtpServerLib)
88
if(NOT QFtpServerLib_FOUND)
9-
# Fetch QFtpServer from GitHub
10-
include(FetchContent)
11-
FetchContent_Declare(
12-
QFtpServerLib
13-
GIT_REPOSITORY https://github.com/KangLin/QFtpServer.git
14-
GIT_TAG master # or specify a specific version/tag
15-
)
9+
message("Please set QFtpServerLib_DIR to QFtpServerLib install root or download and build from `https://github.com/KangLin/QFtpServer.git`")
10+
return()
11+
# # Fetch QFtpServer from GitHub
12+
# include(FetchContent)
13+
# FetchContent_Declare(
14+
# QFtpServerLib
15+
# GIT_REPOSITORY https://github.com/KangLin/QFtpServer.git
16+
# GIT_TAG master # or specify a specific version/tag
17+
# )
1618

17-
# Configure QFtpServer build options before making it available
18-
set(WITH_APP OFF CACHE BOOL "" FORCE)
19-
set(WITH_TEST OFF CACHE BOOL "" FORCE)
20-
FetchContent_MakeAvailable(QFtpServerLib)
19+
# # Configure QFtpServer build options before making it available
20+
# set(WITH_APP OFF CACHE BOOL "" FORCE)
21+
# set(WITH_TEST OFF CACHE BOOL "" FORCE)
22+
# FetchContent_MakeAvailable(QFtpServerLib)
2123
endif()
2224

2325
SET(FtpServer_PRIVATE_LIBS Plugin QFtpServerLib)
@@ -67,9 +69,9 @@ ADD_PLUGIN_TARGET(NAME PluginService${PROJECT_NAME}
6769
VERSION ${RabbitRemoteControl_VERSION}
6870
)
6971

70-
add_dependencies(PluginService${PROJECT_NAME} QFtpServerLib)
72+
#add_dependencies(PluginService${PROJECT_NAME} QFtpServerLib)
7173
option(INSTALL_QFtpServer "Install QFtpServer libraries" OFF)
72-
if(INSTALL_QFtpServer)
74+
if(INSTALL_QFtpServer AND QFtpServerLib_FOUND)
7375
if(ANDROID)
7476
set_target_properties(PluginService${PROJECT_NAME} PROPERTIES
7577
QT_ANDROID_EXTRA_LIBS $<TARGET_SONAME_FILE:QFtpServerLib>)

0 commit comments

Comments
 (0)