Qt5 Windows10 MinG

The C compiler identification is GNU 7.3.0
The CXX compiler identification is GNU 7.3.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Qt/Qt5.12.9/Tools/mingw730_32/bin/gcc.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: C:/Qt/Qt5.12.9/Tools/mingw730_32/bin/g++.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
Found PkgConfig: C:/Qt/Qt5.12.9/Tools/mingw730_32/bin/pkg-config.exe (found version "0.23") 
No qmake Qt5 binary found. Can't check QT_INSTALL_PREFIX
CMake Error at CMakeLists.txt:44 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5" with any of
  the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.


Configuring incomplete, errors occurred!
See also "C:/work/tool/qtkeychain-0.12.0/build/CMakeFiles/CMakeOutput.log".

上述错误问题是编译方式不对,上述错误采用的是命令行:cmake -G "MinGW Makefiles"  ..

Cmake Gui也可以自定义编译方式

正确的编译方式是,命令行:cmake -G "Visual Studio 16 2019" ..

C:work	oolqtkeychain-0.12.0uild>cmake -G "Visual Studio 16 2019" ..
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.14393.
-- The C compiler identification is MSVC 19.28.29914.0
-- The CXX compiler identification is MSVC 19.28.29914.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: C:/Qt/Qt5.12.9/Tools/mingw730_32/bin/pkg-config.exe (found version "0.23")
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
-- Performing Test COMPILER_HAS_DEPRECATED
-- Performing Test COMPILER_HAS_DEPRECATED - Success
-- Configuring done
-- Generating done
-- Build files have been written to: C:/work/tool/qtkeychain-0.12.0/build
原文地址:https://www.cnblogs.com/xiongyingaoxiang/p/14694304.html