CMakeLists.txt 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. cmake_minimum_required(VERSION 3.16)
  2. project(Cabinet VERSION 0.1 LANGUAGES CXX)
  3. set(CMAKE_AUTOMOC ON)
  4. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  5. set(CMAKE_AUTORCC ON)
  6. find_package(Qt6 6.7 COMPONENTS Quick Network SerialPort Multimedia Pdf Xml REQUIRED)
  7. find_package(Qt6 REQUIRED COMPONENTS Core)
  8. find_package(Qt6 REQUIRED COMPONENTS Core)
  9. find_package(Qt6 REQUIRED COMPONENTS Core)
  10. find_package(Qt6 REQUIRED COMPONENTS Core)
  11. find_package(Qt6 REQUIRED COMPONENTS Core)
  12. # 查找静态库
  13. find_library(ZKFP_LIB
  14. NAMES zkfp libzkfp
  15. PATHS libs/x64lib
  16. NO_DEFAULT_PATH
  17. )
  18. # 查找虹软SDK
  19. find_library(ARCSOFT_FACE_LIB
  20. NAMES libarcsoft_face_engine
  21. PATHS sdk/hrsdk/lib/X64
  22. NO_DEFAULT_PATH
  23. )
  24. set(APP_ICON_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/logo.rc")
  25. qt_add_executable(appCabinet
  26. main.cpp resource.qrc ${RESOURCES} ${APP_ICON_WINDOWS}
  27. )
  28. qt_add_qml_module(appCabinet
  29. URI Cabinet
  30. VERSION 1.0
  31. QML_FILES main.qml
  32. RESOURCES resource.qrc
  33. QML_FILES content/Login.qml content/MainScreen.qml
  34. SOURCES user/config.cpp
  35. SOURCES user/config.h user/define.h
  36. SOURCES user/lock.h user/lock.cpp
  37. SOURCES user/httpclient.cpp user/httpclient.h
  38. SOURCES user/rfid.h user/rfid.cpp
  39. SOURCES user/ModuleReader.h
  40. SOURCES user/pro.cpp user/pro.h
  41. QML_FILES content/MaterialSelModel.qml
  42. QML_FILES content/MaterialTakeBack.qml
  43. QML_FILES content/MaterialStatistics.qml
  44. QML_FILES content/MaterialInstructions.qml
  45. QML_FILES content/MaterialCheckPlan.qml
  46. QML_FILES content/MaterialCheckForm.qml
  47. SOURCES user/finger.h user/finger.cpp
  48. SOURCES user/logoutput.cpp user/logoutput.h
  49. QML_FILES content/SetView.qml
  50. SOURCES libs/include/libzkfp.h libs/include/libzkfperrdef.h libs/include/libzkfptype.h libs/include/zkinterface.h
  51. RESOURCES logo.rc
  52. QML_FILES content/MaterialCheckSign.qml
  53. QML_FILES content/PromptInfo.qml
  54. QML_FILES content/MaterialReplace.qml
  55. QML_FILES content/ReuseTextField.qml
  56. QML_FILES content/ReuseComboBox.qml
  57. QML_FILES content/ReuseDateField.qml
  58. SOURCES sdk/hrsdk/inc/amcomdef.h sdk/hrsdk/inc/arcsoft_face_sdk.h sdk/hrsdk/inc/asvloffscreen.h sdk/hrsdk/inc/merror.h
  59. SOURCES Interactive/template_singleton.h
  60. SOURCES Interactive/InteractiveCore.cpp Interactive/InteractiveCore.h
  61. SOURCES Interactive/InteractiveData.cpp Interactive/InteractiveData.h
  62. SOURCES Interactive/InteractiveTask.cpp Interactive/InteractiveTask.h
  63. SOURCES Interactive/InteractiveWork.cpp Interactive/InteractiveWork.h
  64. SOURCES Interactive/DataListModel.cpp Interactive/DataListModel.h
  65. SOURCES Interactive/RunAbstract.cpp Interactive/RunAbstract.h
  66. SOURCES Interactive/RunDataCacheRefresh.h Interactive/RunDataCacheRefresh.cpp
  67. SOURCES Interactive/RunMaterialInfoListRefresh.cpp Interactive/RunMaterialInfoListRefresh.h
  68. SOURCES Interactive/RunMaterialReplaceRefreshListModel.h Interactive/RunMaterialReplaceRefreshListModel.cpp
  69. SOURCES Interactive/RunMaterialManualReplaceRefreshListModel.h Interactive/RunMaterialManualReplaceRefreshListModel.cpp
  70. SOURCES Interactive/RunMaterialManualReplaceSubmit.h Interactive/RunMaterialManualReplaceSubmit.cpp
  71. QML_FILES content/MaterialReplaceHand.qml
  72. QML_FILES content/MaterialReplaceAuto.qml
  73. QML_FILES content/MaterialException.qml
  74. QML_FILES content/ReuseMaterialInfo.qml
  75. QML_FILES content/MaterialExceptionReport.qml
  76. QML_FILES
  77. SOURCES Interactive/RunMaterialExceptionReport.h Interactive/RunMaterialExceptionReport.cpp
  78. SOURCES Interactive/RunMaterialExceptionRefreshListModel.h Interactive/RunMaterialExceptionRefreshListModel.cpp
  79. QML_FILES content/MaterialExceptionFinish.qml
  80. SOURCES user/timeout.h user/timeout.cpp
  81. QML_FILES content/MaterialDialog.qml
  82. SOURCES Interactive/RunHttpGet_getIsMaterialsLoanExceptionPage.h Interactive/RunHttpGet_getIsMaterialsLoanExceptionPage.cpp
  83. QML_FILES content/MaterialDialogMisplace.qml
  84. QML_FILES content/MaterialDialogTake.qml
  85. QML_FILES content/MaterialDialogBack.qml
  86. SOURCES Interactive/InteractiveFace.h Interactive/InteractiveFace.cpp
  87. QML_FILES content/FacialRecognition.qml
  88. SOURCES Interactive/InteractiveHttp.h Interactive/InteractiveHttp.cpp
  89. SOURCES Interactive/RunHttpGet_getSysUserCharacteristicPage.h Interactive/RunHttpGet_getSysUserCharacteristicPage.cpp
  90. SOURCES Interactive/RunHttpPost_insertUserFace.h Interactive/RunHttpPost_insertUserFace.cpp
  91. SOURCES Interactive/RunHttpPost_loginByFace.h Interactive/RunHttpPost_loginByFace.cpp
  92. SOURCES Interactive/InteractiveConf.h Interactive/InteractiveConf.cpp
  93. QML_FILES content/MaterialCheckUpdate.qml
  94. SOURCES Interactive/RunHttpGet_getIsMaterialsPage.h Interactive/RunHttpGet_getIsMaterialsPage.cpp
  95. QML_FILES content/MaterialStocktaking.qml
  96. SOURCES Interactive/RunHttpGet_selectExMaterialTypeById.h Interactive/RunHttpGet_selectExMaterialTypeById.cpp
  97. QML_FILES content/WaitPromptBox.qml
  98. SOURCES Interactive/RunHttpGet_getInfo.h Interactive/RunHttpGet_getInfo.cpp
  99. QML_FILES content/InfoPromptBox.qml
  100. SOURCES Interactive/RunHttpPost_startCheckPlan.h Interactive/RunHttpPost_startCheckPlan.cpp
  101. SOURCES Interactive/RunHttpGet_getLastCheckPlanByCabinetCode.h Interactive/RunHttpGet_getLastCheckPlanByCabinetCode.cpp
  102. SOURCES Interactive/RunHttpGet_getCabinetHomePage.h Interactive/RunHttpGet_getCabinetHomePage.cpp
  103. SOURCES Interactive/RunHttpPost_insertSubmitPlan.h Interactive/RunHttpPost_insertSubmitPlan.cpp
  104. SOURCES Interactive/RunHttpGet_getInstructionsList.h Interactive/RunHttpGet_getInstructionsList.cpp
  105. SOURCES Interactive/RunHttpPost_insertCheckRecord.h Interactive/RunHttpPost_insertCheckRecord.cpp
  106. SOURCES Interactive/RunHttpPost_deleteSysUserCharacteristicByRecordIds.h Interactive/RunHttpPost_deleteSysUserCharacteristicByRecordIds.cpp
  107. SOURCES Interactive/InteractiveHand.h Interactive/InteractiveHand.cpp
  108. SOURCES Interactive/RunHttpPost_insertUserFingerprintDat.h Interactive/RunHttpPost_insertUserFingerprintDat.cpp
  109. SOURCES Interactive/RunHttpGet_exception_type.h Interactive/RunHttpGet_exception_type.cpp
  110. SOURCES Interactive/RunHttpGet_severity_level.h Interactive/RunHttpGet_severity_level.cpp
  111. SOURCES Interactive/RunViewRefresh_AbnormalReport.h Interactive/RunViewRefresh_AbnormalReport.cpp
  112. SOURCES Interactive/RunHttpPost_insertIsException.h Interactive/RunHttpPost_insertIsException.cpp
  113. SOURCES Interactive/RunHttpGet_selectIsMaterialsCabinetByCode.h Interactive/RunHttpGet_selectIsMaterialsCabinetByCode.cpp
  114. QML_FILES content/HangPromptBox.qml
  115. SOURCES Interactive/RunViewWait.h Interactive/RunViewWait.cpp
  116. SOURCES Interactive/RunHttpPost_loginByFingerprintDat.h Interactive/RunHttpPost_loginByFingerprintDat.cpp
  117. QML_FILES content/MaterialManualReplace.qml
  118. SOURCES user/filelogger.h user/filelogger.cpp
  119. )
  120. # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
  121. # If you are developing for iOS or macOS you should consider setting an
  122. # explicit, fixed bundle identifier manually though.
  123. set_target_properties(appCabinet PROPERTIES
  124. # MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appCabinet
  125. MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
  126. MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
  127. MACOSX_BUNDLE TRUE
  128. WIN32_EXECUTABLE TRUE
  129. )
  130. # add_subdirectory(MediaPlayer)
  131. # add_subdirectory(MediaControls)
  132. # 链接静态库
  133. target_link_libraries(appCabinet PRIVATE ${ZKFP_LIB} ${ARCSOFT_FACE_LIB})
  134. target_link_libraries(appCabinet
  135. PRIVATE Qt6::Quick
  136. Qt6::Network
  137. Qt6::SerialPort
  138. Qt6::Multimedia
  139. Qt6::Pdf
  140. Qt6::Xml
  141. )
  142. target_link_libraries(appCabinet PRIVATE Qt6::Core)
  143. target_link_libraries(appCabinet PRIVATE Qt6::Core)
  144. target_link_libraries(appCabinet PRIVATE Qt6::Core)
  145. target_link_libraries(appCabinet PRIVATE Qt6::Core)
  146. target_link_libraries(appCabinet PRIVATE Qt6::Core)
  147. include(GNUInstallDirs)
  148. install(TARGETS appCabinet
  149. BUNDLE DESTINATION .
  150. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  151. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  152. )