Browse Source

V0.6.4
1、新增CMake对Qt6的兼容

Apple 1 week ago
parent
commit
c1bed85371
3 changed files with 6 additions and 5 deletions
  1. 1 0
      .gitignore
  2. 2 2
      CMakeLists.txt
  3. 3 3
      demo/DesignerPattern/CMakeLists.txt

+ 1 - 0
.gitignore

@@ -1 +1,2 @@
 External_Ex
+.DS_Store

+ 2 - 2
CMakeLists.txt

@@ -107,7 +107,7 @@ option(ENABLE_SPDLOG_STATIC_LIB "Enable spdlog static library" ON)
 find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
 find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
 
-find_package(Qt5 COMPONENTS
+find_package(Qt${QT_VERSION_MAJOR} COMPONENTS
     Widgets
     Core
     # SerialPort
@@ -118,7 +118,7 @@ find_package(Qt5 COMPONENTS
 )
 
 include(${CMAKE_SOURCE_DIR}/External/Libraries/Libraries.cmake)
-include(${CMAKE_SOURCE_DIR}/External_Ex/Library_EX.cmake)
+# include(${CMAKE_SOURCE_DIR}/External_Ex/Library_EX.cmake)
 
 
 #=========================================================

+ 3 - 3
demo/DesignerPattern/CMakeLists.txt

@@ -41,9 +41,9 @@ target_include_directories(${this_exe} PRIVATE
 )
 
 target_link_libraries(${this_exe} PRIVATE
-    Qt5::Widgets
-    Qt5::Core
-    Qt5::Network
+    Qt${QT_VERSION_MAJOR}::Widgets
+    Qt${QT_VERSION_MAJOR}::Core
+    Qt${QT_VERSION_MAJOR}::Network
     # Qt5::Multimedia
     # Qt5::Xml
     # Qt5::Sql