@@ -24,11 +24,10 @@ if(MSVC)
2424 add_link_options (/DEBUG /OPT:REF,ICF,LBR )
2525 endif ()
2626endif ()
27-
27+
2828include (FetchContent )
2929include (ExternalProject )
3030
31- include (cmake/install_nuget.cmake )
3231include (cmake/install_ffmpeg.cmake )
3332include (cmake/build_QR-Code-generator.cmake )
3433
@@ -39,6 +38,8 @@ FetchContent_Declare(
3938)
4039FetchContent_MakeAvailable (nlohmann_json)
4140
41+ find_package (unofficial-webview2 CONFIG REQUIRED )
42+
4243find_package (cpr CONFIG REQUIRED )
4344
4445find_package (OpenCV REQUIRED opencv_world )
@@ -122,7 +123,7 @@ set(PROJECT_LIBRARIES
122123
123124 cpr::cpr
124125 QR_Code_generator
125- WebView2LoaderStatic
126+ unofficial::webview2::webview2
126127 nlohmann_json::nlohmann_json
127128 ${OpenCV_LIBS}
128129 ${FFMPEG_LIBS}
@@ -131,7 +132,7 @@ set(PROJECT_LIBRARIES
131132
132133target_link_libraries (${PROJECT_NAME} PRIVATE ${PROJECT_LIBRARIES} )
133134
134- file (GLOB FFMPEG_DLLS
135+ file (GLOB FFMPEG_DLL_FILES
135136 "${FFMPEG_BIN_DIR} /avcodec-*.dll"
136137 "${FFMPEG_BIN_DIR} /avformat-*.dll"
137138 "${FFMPEG_BIN_DIR} /avutil-*.dll"
@@ -141,7 +142,7 @@ file(GLOB FFMPEG_DLLS
141142
142143add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD
143144 COMMAND ${CMAKE_COMMAND} -E copy_if_different
144- ${FFMPEG_DLLS }
145+ ${FFMPEG_DLL_FILES }
145146 "$<TARGET_FILE_DIR :${PROJECT_NAME} >"
146147)
147148
@@ -159,38 +160,37 @@ endif()
159160# install
160161set (Install_Directory "${CMAKE_INSTALL_PREFIX} /${PROJECT_NAME} _${PROJECT_VERSION} " )
161162
162- install (TARGETS ${PROJECT_NAME}
163- RUNTIME DESTINATION ${Install_Directory}
164- )
163+ install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${Install_Directory} )
164+
165+ install ( FILES $< TARGET_PDB_FILE : ${PROJECT_NAME} > DESTINATION ${Install_Directory} )
165166
166167set (QT_DLL_FILES
167- " ${QT6_INSTALL_PREFIX} /bin/Qt6Core.dll"
168- " ${QT6_INSTALL_PREFIX} /bin/Qt6Widgets.dll"
169- " ${QT6_INSTALL_PREFIX} /bin/Qt6Gui.dll"
168+ ${QT6_INSTALL_PREFIX} /bin/Qt6Core.dll
169+ ${QT6_INSTALL_PREFIX} /bin/Qt6Widgets.dll
170+ ${QT6_INSTALL_PREFIX} /bin/Qt6Gui.dll
170171)
171172
172173install (
173174 FILES
174- ${CMAKE_BINARY_DIR} /${PROJECT_NAME} .pdb
175175 ${QT_DLL_FILES}
176- ${FFMPEG_DLLS }
176+ ${FFMPEG_DLL_FILES }
177177 DESTINATION
178178 ${Install_Directory}
179179)
180180
181181install (
182182 FILES
183- " ${QT6_INSTALL_PREFIX} /plugins/platforms/qdirect2d.dll"
184- " ${QT6_INSTALL_PREFIX} /plugins/platforms/qminimal.dll"
185- " ${QT6_INSTALL_PREFIX} /plugins/platforms/qoffscreen.dll"
186- " ${QT6_INSTALL_PREFIX} /plugins/platforms/qwindows.dll"
183+ ${QT6_INSTALL_PREFIX} /plugins/platforms/qdirect2d.dll
184+ ${QT6_INSTALL_PREFIX} /plugins/platforms/qminimal.dll
185+ ${QT6_INSTALL_PREFIX} /plugins/platforms/qoffscreen.dll
186+ ${QT6_INSTALL_PREFIX} /plugins/platforms/qwindows.dll
187187 DESTINATION
188- " ${Install_Directory} /plugins/platforms"
188+ ${Install_Directory} /plugins/platforms
189189)
190190
191191install (
192192 FILES
193- " ${QT6_INSTALL_PREFIX} /plugins/styles/qmodernwindowsstyle.dll"
193+ ${QT6_INSTALL_PREFIX} /plugins/styles/qmodernwindowsstyle.dll
194194 DESTINATION
195195 ${Install_Directory} /plugins/styles
196196)
0 commit comments