Skip to content

Commit 9c97834

Browse files
committed
Plugins::FtpServer: use FetchContent_Declare download source code
1 parent 1fc28d1 commit 9c97834

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Plugins/FtpServer/CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,21 @@ project(FtpServer
66

77
find_package(QFtpServerLib)
88
if(NOT QFtpServerLib_FOUND)
9-
return()
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+
)
16+
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+
if(WIN32)
21+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
22+
endif()
23+
FetchContent_MakeAvailable(QFtpServerLib)
1024
endif()
1125

1226
option(INSTALL_QFtpServer "Install QFtpServer libraries" OFF)

0 commit comments

Comments
 (0)