QT使用cmake生成vs2019工程方法
QT使用cmake生成vs2019工程方法
參考鏈接:https://cmake.org/cmake/help/git-stage/generator/Visual%20Studio%2016%202019.html
生成命令:
1、生成win32工程
cmake -G "Visual Studio 16 2019" -A Win32
2、生成win64工程
cmake -G "Visual Studio 16 2019" -A x64
3、生成arm工程
cmake -G "Visual Studio 16 2019" -A ARM
4、生成arm64工程
cmake -G "Visual Studio 16 2019" -A ARM64
示例:生成vs2019 win32的工程
$ cmake -G "Visual Studio 16 2019" -A Win32
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
-- The C compiler identification is MSVC 19.22.27905.0
-- The CXX compiler identification is MSVC 19.22.27905.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/qslidetext
最後打開目錄下的sln後綴名文件。