使用qt部署Cmake项目时,遇到"Failed to set working directory to"的错误(还没编译),然后查看部署信息发现:
"The CXX compiler identification is unknown"、"CMake Error at xxxx/CMakeTestCXXCompiler.cmake:56 (try_compile):"
clike
[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里加上:
clike
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限制:
powershell
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
- 参考其他链接:
- 然后又去检查Qt的Cmake命令参数和环境,对比能正常部署的Cmake和这个不能正常部署的Cmake命令参数:
- 这个是正常的Cmake配置:
clike
-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配置:
clike
-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}
-
然后解决了...