关于Qt部署CMake导致“Failed to set working directory to”的问题

2024年7月23日补充:该目录过深的情况只在Win10上有发现,Win11则没有问题,且Win11可以在DevHome中设置LongPath。

---------------------------------------------------------------------------------------------------------------

使用qt部署Cmake项目时,遇到"Failed to set working directory to"的错误(还没编译),然后查看部署信息发现:
“The CXX compiler identification is unknown”、“CMake Error at xxxx/CMakeTestCXXCompiler.cmake:56 (try_compile):”

[cmake] -- The CXX compiler identification is unknown
[cmake] -- Check for working CXX compiler: C:/01_Software/06_QT/Tools/mingw1120_64/bin/g++.exe
[cmake] CMake Error at C:/01_Software/06_QT/Tools/CMake_64/share/cmake-3.29/Modules/CMakeTestCXXCompiler.cmake:56 (try_compile):
[cmake]   Failed to set working directory to
[cmake]   C:/02_MyRepository/Qt6_CPlusPlus_Learning/My_Source_Code/chapter_06_EventsDealt/sample_6.1_QPaintEvent&QCloseEvent&QMouseEvent&QKeyEvent&QShowEvent&QHideEvent/TestWidgetTypicalEvent/build/Desktop_Qt_6_7_2_MinGW_64_bit-Debug/CMakeFiles/CMakeScratch/TryCompile-efahz1
[cmake]   : No such file or directory
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt:3 (project)
[cmake] 
[cmake] 
[cmake] -- Configuring incomplete, errors occurred!
  • 报错截图:

  • 在这里插入图片描述

  • 先说结论吧:其实是因为目录过长目录过深导致的

  • 虽然按照参考设置了Cmake的工程路径最大长度和文件名最大长度,也改过Windows的文件最大长度限制,但是都没用!

  • 例如CMakeLIsts里加上:

set(CMAKE_OBJECT_PATH_MAX 2048)
set(CMAKE_OBJECT_NAME_MAX 512)
if (WIN32)set(CMAKE_OBJECT_PATH_MAX 2048)set(CMAKE_OBJECT_NAME_MAX 512)
endif()
if(CMAKE_HOST_UNIX)execute_process( COMMAND getconf PATH_MAX /OUTPUT_VARIABLE OBJECT_PATH_MAX OUTPUT_STRIP_TRAILING_WHITESPACE)execute_process( COMMAND getconf NAME_MAX /OUTPUT_VARIABLE OBJECT_NAME_MAX OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
  • 参考:CMAKE_OBJECT_PATH_MAX
  • 再或者命令行改Windows限制:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
  • 具体参考stackoverflow上的这个问题:maximum-path-lengths-with-cmake
  • maximum-file-path-limitation
  • 后面找到原输出信息发现是CMakeTestCXXCompiler.cmake:56 (try_compile)这个文件中的第56行的try_complie出现问题,找不到临时生成的文件夹:`CMakeScratch/TryCompile-xxxx在这里插入图片描述
  • Cmake中该操作是会在${CMAKE_BINARY_DIR}/CMakeFiles/CMakeScratch这个路径下面生成一个独特的哈希后缀文件夹,该文件夹是临时的,可以加上--debug-trycompile命令让他不删除保留然后看里面的.cmake文件;
  • CMake automatically generates, for each try_compile operation, a unique directory under ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeScratch with an unspecified name. These directories are cleaned automatically unless --debug-trycompile is passed to cmake.
  • 参考原文:try_compile
  • 参考其他链接:
    • how-to-debug-detecting-c-compiler-abi-info
    • cmake-complains-the-cxx-compiler-identification-is-unknown
  • 然后又去检查Qt的Cmake命令参数和环境,对比能正常部署的Cmake和这个不能正常部署的Cmake命令参数:
  • 这个是正常的Cmake配置:
-DCMAKE_ADDR2LINE:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/addr2line.exe
-DCMAKE_ADDR2LINE:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/addr2line.exe
-DCMAKE_AR:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ar.exe
-DCMAKE_AR:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ar.exe
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_COLOR_DIAGNOSTICS:BOOL=1
-DCMAKE_COLOR_DIAGNOSTICS:BOOL=1
-DCMAKE_CXX_COMPILER:STRING=C:/01_Software/06_QT/Tools/mingw1120_64/bin/g++.exe
-DCMAKE_CXX_COMPILER:STRING=C:/01_Software/06_QT/Tools/mingw1120_64/bin/g++.exe
-DCMAKE_CXX_COMPILER_AR:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/gcc-ar.exe
-DCMAKE_CXX_COMPILER_AR:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/gcc-ar.exe
-DCMAKE_CXX_COMPILER_RANLIB:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/gcc-ranlib.exe
-DCMAKE_CXX_COMPILER_RANLIB:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/gcc-ranlib.exe
-DCMAKE_CXX_FLAGS:STRING=
-DCMAKE_CXX_FLAGS:STRING=
-DCMAKE_CXX_FLAGS_DEBUG:STRING=-g
-DCMAKE_CXX_FLAGS_DEBUG:STRING=-g
-DCMAKE_CXX_FLAGS_INIT:STRING=
-DCMAKE_CXX_FLAGS_INIT:STRING=
-DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
-DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
-DCMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
-DCMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
-DCMAKE_CXX_OUTPUT_EXTENSION:STRING=.obj
-DCMAKE_CXX_OUTPUT_EXTENSION:STRING=.obj
-DCMAKE_CXX_STANDARD_LIBRARIES:STRING=-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
-DCMAKE_CXX_STANDARD_LIBRARIES:STRING=-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
-DCMAKE_C_COMPILER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/gcc.exe
-DCMAKE_C_COMPILER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/gcc.exe
-DCMAKE_C_OUTPUT_EXTENSION:STRING=
-DCMAKE_C_OUTPUT_EXTENSION:STRING=
-DCMAKE_DLLTOOL:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/dlltool.exe
-DCMAKE_DLLTOOL:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/dlltool.exe
-DCMAKE_EXE_LINKER_FLAGS:STRING=
-DCMAKE_EXE_LINKER_FLAGS:STRING=
-DCMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_GNUtoMS:BOOL=OFF
-DCMAKE_GNUtoMS:BOOL=OFF
-DCMAKE_INSTALL_BINDIR:PATH=bin
-DCMAKE_INSTALL_BINDIR:PATH=bin
-DCMAKE_INSTALL_DATADIR:PATH=
-DCMAKE_INSTALL_DATADIR:PATH=
-DCMAKE_INSTALL_DATAROOTDIR:PATH=share
-DCMAKE_INSTALL_DATAROOTDIR:PATH=share
-DCMAKE_INSTALL_DOCDIR:PATH=
-DCMAKE_INSTALL_DOCDIR:PATH=
-DCMAKE_INSTALL_INCLUDEDIR:PATH=include
-DCMAKE_INSTALL_INCLUDEDIR:PATH=include
-DCMAKE_INSTALL_INFODIR:PATH=
-DCMAKE_INSTALL_INFODIR:PATH=
-DCMAKE_INSTALL_LIBDIR:PATH=lib
-DCMAKE_INSTALL_LIBDIR:PATH=lib
-DCMAKE_INSTALL_LIBEXECDIR:PATH=libexec
-DCMAKE_INSTALL_LIBEXECDIR:PATH=libexec
-DCMAKE_INSTALL_LOCALEDIR:PATH=
-DCMAKE_INSTALL_LOCALEDIR:PATH=
-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=var
-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=var
-DCMAKE_INSTALL_MANDIR:PATH=
-DCMAKE_INSTALL_MANDIR:PATH=
-DCMAKE_INSTALL_OLDINCLUDEDIR:PATH=/usr/include
-DCMAKE_INSTALL_OLDINCLUDEDIR:PATH=/usr/include
-DCMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/TestWidgetTypicalEvent
-DCMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/TestWidgetTypicalEvent
-DCMAKE_INSTALL_RUNSTATEDIR:PATH=
-DCMAKE_INSTALL_RUNSTATEDIR:PATH=
-DCMAKE_INSTALL_SBINDIR:PATH=sbin
-DCMAKE_INSTALL_SBINDIR:PATH=sbin
-DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=com
-DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=com
-DCMAKE_INSTALL_SYSCONFDIR:PATH=etc
-DCMAKE_INSTALL_SYSCONFDIR:PATH=etc
-DCMAKE_LINKER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ld.exe
-DCMAKE_LINKER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ld.exe
-DCMAKE_MAKE_PROGRAM:FILEPATH=C:/01_Software/06_QT/Tools/Ninja/ninja.exe
-DCMAKE_MAKE_PROGRAM:FILEPATH=C:/01_Software/06_QT/Tools/Ninja/ninja.exe
-DCMAKE_MODULE_LINKER_FLAGS:STRING=
-DCMAKE_MODULE_LINKER_FLAGS:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_NM:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/nm.exe
-DCMAKE_NM:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/nm.exe
-DCMAKE_OBJCOPY:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/objcopy.exe
-DCMAKE_OBJCOPY:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/objcopy.exe
-DCMAKE_OBJDUMP:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/objdump.exe
-DCMAKE_OBJDUMP:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/objdump.exe
-DCMAKE_PREFIX_PATH:PATH=C:/01_Software/06_QT/6.7.2/mingw_64
-DCMAKE_PREFIX_PATH:PATH=C:/01_Software/06_QT/6.7.2/mingw_64
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:/02_MyRepository/.build/Desktop_Qt_6_7_2_MinGW_64_bit-Debug/.qtc/package-manager/auto-setup.cmake
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:/02_MyRepository/.build/Desktop_Qt_6_7_2_MinGW_64_bit-Debug/.qtc/package-manager/auto-setup.cmake
-DCMAKE_RANLIB:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ranlib.exe
-DCMAKE_RANLIB:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ranlib.exe
-DCMAKE_RC_COMPILER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/windres.exe
-DCMAKE_RC_COMPILER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/windres.exe
-DCMAKE_RC_FLAGS:STRING=
-DCMAKE_RC_FLAGS:STRING=
-DCMAKE_RC_FLAGS_DEBUG:STRING=
-DCMAKE_RC_FLAGS_DEBUG:STRING=
-DCMAKE_RC_FLAGS_MINSIZEREL:STRING=
-DCMAKE_RC_FLAGS_MINSIZEREL:STRING=
-DCMAKE_RC_FLAGS_RELEASE:STRING=
-DCMAKE_RC_FLAGS_RELEASE:STRING=
-DCMAKE_RC_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_RC_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_READELF:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/readelf.exe
-DCMAKE_READELF:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/readelf.exe
-DCMAKE_SHARED_LINKER_FLAGS:STRING=
-DCMAKE_SHARED_LINKER_FLAGS:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=NO
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=NO
-DCMAKE_SKIP_RPATH:BOOL=NO
-DCMAKE_SKIP_RPATH:BOOL=NO
-DCMAKE_STATIC_LINKER_FLAGS:STRING=
-DCMAKE_STATIC_LINKER_FLAGS:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_STRIP:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/strip.exe
-DCMAKE_STRIP:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/strip.exe
-DCMAKE_TAPI:FILEPATH=CMAKE_TAPI-NOTFOUND
-DCMAKE_TAPI:FILEPATH=CMAKE_TAPI-NOTFOUND
-DCMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
-DCMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
-DQT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH:STRING=
-DQT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH:STRING=
-DQT_ADDITIONAL_PACKAGES_PREFIX_PATH:STRING=
-DQT_ADDITIONAL_PACKAGES_PREFIX_PATH:STRING=
-DQT_CREATOR_SKIP_PACKAGE_MANAGER_SETUP:BOOL=OFF
-DQT_CREATOR_SKIP_PACKAGE_MANAGER_SETUP:BOOL=OFF
-DQT_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6
-DQT_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6
-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/01_Software/06_QT/6.7.2/mingw_64/bin/qmake.exe
-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/01_Software/06_QT/6.7.2/mingw_64/bin/qmake.exe
-DQt6CoreTools_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6CoreTools
-DQt6CoreTools_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6CoreTools
-DQt6Core_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6Core
-DQt6Core_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6Core
-DQt6EntryPointPrivate_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6EntryPointPrivate
-DQt6EntryPointPrivate_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6EntryPointPrivate
-DQt6GuiTools_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6GuiTools
-DQt6GuiTools_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6GuiTools
-DQt6Gui_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6Gui
-DQt6Gui_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6Gui
-DQt6WidgetsTools_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6WidgetsTools
-DQt6WidgetsTools_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6WidgetsTools
-DQt6Widgets_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6Widgets
-DQt6Widgets_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6Widgets
-DQt6ZlibPrivate_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6ZlibPrivate
-DQt6ZlibPrivate_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6ZlibPrivate
-DQt6_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6
-DQt6_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6
-DVulkan_GLSLANG_VALIDATOR_EXECUTABLE:FILEPATH=Vulkan_GLSLANG_VALIDATOR_EXECUTABLE-NOTFOUND
-DVulkan_GLSLANG_VALIDATOR_EXECUTABLE:FILEPATH=Vulkan_GLSLANG_VALIDATOR_EXECUTABLE-NOTFOUND
-DVulkan_GLSLC_EXECUTABLE:FILEPATH=Vulkan_GLSLC_EXECUTABLE-NOTFOUND
-DVulkan_GLSLC_EXECUTABLE:FILEPATH=Vulkan_GLSLC_EXECUTABLE-NOTFOUND
-DVulkan_INCLUDE_DIR:PATH=Vulkan_INCLUDE_DIR-NOTFOUND
-DVulkan_INCLUDE_DIR:PATH=Vulkan_INCLUDE_DIR-NOTFOUND
-DVulkan_LIBRARY:FILEPATH=Vulkan_LIBRARY-NOTFOUND
-DVulkan_LIBRARY:FILEPATH=Vulkan_LIBRARY-NOTFOUND
-DWINDEPLOYQT_EXECUTABLE:FILEPATH=C:/01_Software/06_QT/6.7.2/mingw_64/bin/windeployqt.exe
-DWINDEPLOYQT_EXECUTABLE:FILEPATH=C:/01_Software/06_QT/6.7.2/mingw_64/bin/windeployqt.exe
  • 这个是不正常的CMake配置:
-DCMAKE_ADDR2LINE:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/addr2line.exe
-DCMAKE_ADDR2LINE:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/addr2line.exe
-DCMAKE_AR:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ar.exe
-DCMAKE_AR:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ar.exe
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_COLOR_DIAGNOSTICS:BOOL=1
-DCMAKE_COLOR_DIAGNOSTICS:BOOL=1
-DCMAKE_CXX_COMPILER:STRING=C:/01_Software/06_QT/Tools/mingw1120_64/bin/g++.exe
-DCMAKE_CXX_COMPILER:STRING=C:/01_Software/06_QT/Tools/mingw1120_64/bin/g++.exe
-DCMAKE_CXX_FLAGS:STRING=
-DCMAKE_CXX_FLAGS:STRING=
-DCMAKE_CXX_FLAGS_DEBUG:STRING=
-DCMAKE_CXX_FLAGS_DEBUG:STRING=
-DCMAKE_CXX_FLAGS_INIT:STRING=
-DCMAKE_CXX_FLAGS_INIT:STRING=
-DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=
-DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=
-DCMAKE_CXX_FLAGS_RELEASE:STRING=
-DCMAKE_CXX_FLAGS_RELEASE:STRING=
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_C_COMPILER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/gcc.exe
-DCMAKE_C_COMPILER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/gcc.exe
-DCMAKE_DLLTOOL:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/dlltool.exe
-DCMAKE_DLLTOOL:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/dlltool.exe
-DCMAKE_EXE_LINKER_FLAGS:STRING=
-DCMAKE_EXE_LINKER_FLAGS:STRING=
-DCMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/TestWidgetTypicalEvent
-DCMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/TestWidgetTypicalEvent
-DCMAKE_LINKER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ld.exe
-DCMAKE_LINKER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ld.exe
-DCMAKE_MAKE_PROGRAM:FILEPATH=C:/01_Software/06_QT/Tools/Ninja/ninja.exe
-DCMAKE_MAKE_PROGRAM:FILEPATH=C:/01_Software/06_QT/Tools/Ninja/ninja.exe
-DCMAKE_MODULE_LINKER_FLAGS:STRING=
-DCMAKE_MODULE_LINKER_FLAGS:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_NM:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/nm.exe
-DCMAKE_NM:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/nm.exe
-DCMAKE_OBJCOPY:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/objcopy.exe
-DCMAKE_OBJCOPY:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/objcopy.exe
-DCMAKE_OBJDUMP:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/objdump.exe
-DCMAKE_OBJDUMP:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/objdump.exe
-DCMAKE_PREFIX_PATH:PATH=C:/01_Software/06_QT/6.7.2/mingw_64
-DCMAKE_PREFIX_PATH:PATH=C:/01_Software/06_QT/6.7.2/mingw_64
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:/02_MyRepository/Qt6_CPlusPlus_Learning/My_Source_Code/chapter_06_EventsDealt/sample_6.1_QPaintEvent&QCloseEvent&QMouseEvent&QKeyEvent&QShowEvent&QHideEvent/TestWidgetTypicalEvent/build/Desktop_Qt_6_7_2_MinGW_64_bit-Debug/.qtc/package-manager/auto-setup.cmake
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:/02_MyRepository/Qt6_CPlusPlus_Learning/My_Source_Code/chapter_06_EventsDealt/sample_6.1_QPaintEvent&QCloseEvent&QMouseEvent&QKeyEvent&QShowEvent&QHideEvent/TestWidgetTypicalEvent/build/Desktop_Qt_6_7_2_MinGW_64_bit-Debug/.qtc/package-manager/auto-setup.cmake
-DCMAKE_RANLIB:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ranlib.exe
-DCMAKE_RANLIB:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/ranlib.exe
-DCMAKE_READELF:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/readelf.exe
-DCMAKE_READELF:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/readelf.exe
-DCMAKE_SHARED_LINKER_FLAGS:STRING=
-DCMAKE_SHARED_LINKER_FLAGS:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=NO
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=NO
-DCMAKE_SKIP_RPATH:BOOL=NO
-DCMAKE_SKIP_RPATH:BOOL=NO
-DCMAKE_STATIC_LINKER_FLAGS:STRING=
-DCMAKE_STATIC_LINKER_FLAGS:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-DCMAKE_STRIP:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/strip.exe
-DCMAKE_STRIP:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/strip.exe
-DCMAKE_TAPI:FILEPATH=CMAKE_TAPI-NOTFOUND
-DCMAKE_TAPI:FILEPATH=CMAKE_TAPI-NOTFOUND
-DCMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
-DCMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
-DQT_CREATOR_SKIP_PACKAGE_MANAGER_SETUP:BOOL=OFF
-DQT_CREATOR_SKIP_PACKAGE_MANAGER_SETUP:BOOL=OFF
-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/01_Software/06_QT/6.7.2/mingw_64/bin/qmake.exe
-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/01_Software/06_QT/6.7.2/mingw_64/bin/qmake.exe
  • 然后手动加上没有的参数:
    在这里插入图片描述

  • -DCMAKE_CXX_COMPILER_AR:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/gcc-ar.exe -DCMAKE_CXX_COMPILER_RANLIB:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/gcc-ranlib.exe -DCMAKE_CXX_FLAGS_DEBUG:STRING=-g -DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-O3-DNDEBUG -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2-g-DNDEBUG -DCMAKE_CXX_OUTPUT_EXTENSION:STRING=.obj -DCMAKE_CXX_STANDARD_LIBRARIES:STRING=-lkernel32-luser32-lgdi32-lwinspool-lshell32-lole32-loleaut32-luuid-lcomdlg32-ladvapi32 -DCMAKE_GNUtoMS:BOOL=OFF -DCMAKE_INSTALL_BINDIR:PATH=bin -DCMAKE_INSTALL_DATAROOTDIR:PATH=share -DCMAKE_INSTALL_INCLUDEDIR:PATH=include -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_INSTALL_LIBEXECDIR:PATH=libexec -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=var -DCMAKE_INSTALL_OLDINCLUDEDIR:PATH=/usr/include -DCMAKE_INSTALL_SBINDIR:PATH=sbin -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=com -DCMAKE_INSTALL_SYSCONFDIR:PATH=etc -DCMAKE_RC_COMPILER:FILEPATH=C:/01_Software/06_QT/Tools/mingw1120_64/bin/windres.exe -DQT_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6 -DQt6CoreTools_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6CoreTools -DQt6Core_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6Core -DQt6EntryPointPrivate_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6EntryPointPrivate -DQt6GuiTools_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6GuiTools -DQt6Gui_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6Gui -DQt6WidgetsTools_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6WidgetsTools -DQt6Widgets_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6Widgets -DQt6ZlibPrivate_DIR:PATH=C:/01_Software/06_QT/6.7.2/mingw_64/lib/cmake/Qt6ZlibPrivate

  • 然后重新部署发现还是没用。。。

  • 只能把编译路径设浅一点解决问题了。

  • 例如我的方法:把构建路径设为:%{BuildDevice::Root:FilePath}.buildAll/%{Project:Name}-%{Kit:FileSystemName}-%{BuildConfig:Name}

  • 在这里插入图片描述

  • 然后解决了…

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/874854.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Spark_Oracle_II_Spark高效处理Oracle时间数据:通过JDBC桥接大数据与数据库的分析之旅

接前文背景, 当需要从关系型数据库(如Oracle)中读取数据时,Spark提供了JDBC连接功能,允许我们轻松地将数据从Oracle等数据库导入到Spark DataFrame中。然而,在处理时间字段时,可能会遇到一些挑战…

分布式Apollo配置中心搭建实战

文章目录 环境要求第一步、软件下载第二步、创建数据库参考文档 最近新项目启动,采用Apollo作为分布式的配置中心,在本地搭建huanj 实现原理图如下所示。 环境要求 Java版本要求:JDK1.8 MySql版本要求:5.6.5 Apollo版本要求&…

第八讲:Sysmac Studio控制器设置

控制器设置 一、控制器设定-操作设置 1、启动模式(运行模式/编程模式) 控制器上电后,希望程序运行还是不运行。如果说希望程序运行,那么就选择运行模式。如果说希望上电后程序不运行就选择编程模式。 通常情况下选运行模式可能会比较多一些。 2、SD内存卡设置 当控制…

Pytorch TensorBoard的使用

from torch.utils.tensorboard import SummaryWriter writer SummaryWriter("logs")for i in range(100):writer.add_scalar("yx",i,i) writer.close() 第一个参数 y2x: 这是图表的标题或标签。它会显示在TensorBoard界面中,帮助你识别这条曲线。 第二个参…

(35)远程识别(又称无人机识别)(二)

文章目录 前言 4 ArduRemoteID 5 终端用户数据的设置和使用 6 测试 7 为OEMs添加远程ID到ArduPilot系统的视频教程 前言 在一些国家,远程 ID 正在成为一项法律要求。以下是与 ArduPilot 兼容的设备列表。这里(here)有一个关于远程 ID 的很好解释和常见问题列表…

【数据结构】排序算法——Lesson2

Hi~!这里是奋斗的小羊,很荣幸您能阅读我的文章,诚请评论指点,欢迎欢迎 ~~ 💥💥个人主页:奋斗的小羊 💥💥所属专栏:C语言 🚀本系列文章为个人学习…

uni-app pinia搭建

1.新建store文件 新建index.js,代码: // import { // createPinia // } from pinia //const store createPinia() import * as Pinia from pinia const pinia Pinia.createPinia() export * from "./modules/user" export * from ".…

vscode 寻找全部分支的提交

vscode 寻找全部分支的提交 Git Graph

Python 机器学习求解 PDE 学习项目——PINN 求解二维 Poisson 方程

本文使用 TensorFlow 1.15 环境搭建深度神经网络(PINN)求解二维 Poisson 方程: 模型问题 − Δ u f in Ω , u g on Γ : ∂ Ω . \begin{align} -\Delta u & f \quad & \text{in } \Omega,\\ u & g \quad & \text{on } \Gamma:\p…

Proxmox8基于PC物理机/服务器安装,初始化,挂载磁盘,安装虚拟机

目录 安装文件 开始安装Proxmox 选择启动菜单,F11 后进入启动菜单选择 按需选择是否关闭RAID 选择对应的U盘 进入安装界面 进入安装启动过程 选择系统盘 设置相关信息 设置IP和开启root远程登录 设置dns 设置网卡ip 设置 ssh 远程登录 开机合并local-l…

Telegram曝零日漏洞,可伪装成视频攻击安卓用户

ESET Research在一个地下论坛上发现了一个针对Android Telegram的零日漏洞广告。 ESET将该漏洞命名为“EvilVideo”,并将其报告给Telegram,Telegram于7月11日更新了该应用程序。 EvilVideo允许攻击者发送恶意的有效载荷,这些载荷以视频文件…

计算机网络-配置双机三层互联(静态路由方式)

目录 交换机工作原理路由器工作原理路由信息表组成部分路由器发决策 ARP工作原理配置双机三层互联(静态路由方式) 交换机工作原理 MAC自学习过程 初始状态: 刚启动的交换机的MAC地址表是空的。 学习过程: 当交换机收到一个数据帧…

论文阅读——Integrated Diffusive Antenna Array of Low Backscattering

文章目录 摘要一、背景介绍二、天线结构A. 缝隙天线B. 低频扩散单元C. 高频扩散单元D. 集成设计 三、验证总结 论文来源:https://ieeexplore.ieee.org/document/10309141 摘要 文章提出了一种低雷达散射截面(RCS)的扩散天线阵列。 作为示例…

STM32嵌入式人工智能边缘计算应用教程

目录 引言环境准备边缘计算系统基础代码实现:实现嵌入式人工智能边缘计算系统 4.1 数据采集模块 4.2 数据处理与推理模块 4.3 通信与网络系统实现 4.4 用户界面与数据可视化应用场景:边缘计算与优化问题解决方案与优化收尾与总结 1. 引言 嵌入式人工智…

前后端分离项目部署,vue--nagix发布部署,.net--API发布部署。

目录 Nginx免安装部署文件包准备一、vue前端部署1、修改http.js2、npm run build 编译项目3、解压Nginx免安装,修改nginx.conf二、.net后端发布部署1、编辑appsetting.json,配置跨域请求2、配置WebApi,点击发布3、配置文件发布到那个文件夹4、配置发布相关选项5、点击保存,…

Python-numpy基础--------2

1.full()创建函数 目录 1.full()创建函数 2.创建单位矩阵 3.linspace创建 4.logspace 创建 5.二维数组的索引和切片: 1.索引直接获取 在NumPy中,full() 函数用于创建一个给定形状、类型的新数组,并用指定的值填充这个数组。这个函数非…

【vue前端项目实战案例】Vue3仿今日头条App

本文将开发一款仿“今日头条”的新闻App。该案例是基于 Vue3.0 Vue Router webpack TypeScript 等技术栈实现的一款新闻资讯类App,适合有一定Vue框架使用经验的开发者进行学习。 项目源码在文章末尾 1 项目概述 该项目是一款“今日头条”的新闻资讯App&#xf…

go语言day14 bufio包 ioutil包

Golang-100-Days/Day16-20(Go语言基础进阶)/day16_file操作.md at master rubyhan1314/Golang-100-Days GitHub 一、bufio包 读写文件 1) bufio包下的Reader类实现了Read()方法和Write()方法 2)和io包相比,虽然都是在读写文件,…

【Android】性能实践—编码优化与布局优化学习笔记

【Android】性能实践—编码优化与布局优化学习笔记 编码优化 使用场景 如果需要拼接字符串,优先使用StringBuffer和StringBuilder进行凭借,他们的性能优于直接用加号进行拼接,因为使用加号连接符会创建多余的对象一般情况下使用基本数据类…

Unity扩展SVN命令

可以直接在unity里右键文件提交和查看提交记录 顶部菜单栏上回退和更新整个unity工程 SvnForUnity.CS 记得要放在Editor文件夹下 using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using UnityEditor; using Unity…