Browse Source

V0.4.13
1、修改了ftp,支持了sftp,但是未验证成功

Apple 3 months ago
parent
commit
6dd8f4d1bd
5 changed files with 18 additions and 6 deletions
  1. 3 0
      .gitmodules
  2. 2 2
      CMakeLists.txt
  3. 1 0
      External
  4. 9 2
      demo/ftp/CMakeLists.txt
  5. 3 2
      demo/ftp/widget.cpp

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "External"]
+	path = External
+	url = http://10.147.18.110:10086/apple/External.git

+ 2 - 2
CMakeLists.txt

@@ -145,10 +145,10 @@ file(GLOB GLOBAL_SRC
 # add_subdirectory(${CMAKE_SOURCE_DIR}/demo/mqtt)
 # add_subdirectory(${CMAKE_SOURCE_DIR}/demo/http)
 # add_subdirectory(${CMAKE_SOURCE_DIR}/demo/threadPool)
-# add_subdirectory(${CMAKE_SOURCE_DIR}/demo/ftp)
+add_subdirectory(${CMAKE_SOURCE_DIR}/demo/ftp)
 # add_subdirectory(${CMAKE_SOURCE_DIR}/demo/OneThread)
 # add_subdirectory(${CMAKE_SOURCE_DIR}/demo/timer)
-add_subdirectory(${CMAKE_SOURCE_DIR}/demo/time)
+# add_subdirectory(${CMAKE_SOURCE_DIR}/demo/time)
 # add_subdirectory(${CMAKE_SOURCE_DIR}/demo/VideoPlayer)
 # add_subdirectory(${CMAKE_SOURCE_DIR}/demo/xlsx)
 

+ 1 - 0
External

@@ -0,0 +1 @@
+Subproject commit 007124246a9907d0cc95a93143ac2ec817494ed3

+ 9 - 2
demo/ftp/CMakeLists.txt

@@ -19,6 +19,7 @@ file(GLOB LOCAL_SRC
 )
 
 
+
 # 生成可执行程序
 
 add_executable(${this_exe}
@@ -39,6 +40,9 @@ target_include_directories(${this_exe} PRIVATE
     ${CMAKE_SOURCE_DIR}/External/common/ftp
     ${CMAKE_SOURCE_DIR}/External/common/CurlFtp
     ${CMAKE_SOURCE_DIR}/External/common/FmtLog
+
+    ${spdlog_INCLUDE_DIR}
+    # ${CURL_INCLUDE_DIR}
 )
 
 target_link_libraries(${this_exe} PRIVATE
@@ -51,9 +55,12 @@ target_link_libraries(${this_exe} PRIVATE
 )
 
 target_link_libraries(${this_exe} PRIVATE 
-    fmt::fmt
-    spdlog::spdlog
+    # fmt::fmt
+    # spdlog::spdlog
     ${CURL_LIBRARY}
+    ${spdlog_LIBRARY}
+    ${OpenSSL-1.1.1_LIB_LIBRARY}
+    # CURL::libcurl
 )
 
 if(CMAKE_CXX_COMPILER_VERSION LESS 9.0)

+ 3 - 2
demo/ftp/widget.cpp

@@ -9,7 +9,6 @@
 #include <iostream>
 #include <regex>
 #include <stdlib.h>
-#include "QtFtp.h"
 
 #include "spdlog/spdlog.h"
 #include "fmtlog.h"
@@ -24,8 +23,10 @@ Widget::Widget(QWidget *parent)
 {
     ui->setupUi(this);
 
-    m_curlFtp.setFtpIPAndPort("192.168.50.100", 21);
+    // m_curlFtp.setFtpIPAndPort("192.168.50.100", 21);
+    m_curlFtp.setSftpIPAndPort("192.168.50.100", 22);
     m_curlFtp.setFtpUsernameAndPassword("microsoft", "19980714Lq");
+    m_curlFtp.setIgnoreSSLCert(true);
 
     SPDLOG_INFO("***** Qt Library *****");
 }