Мой DCMAKE_TOOLCHAIN_FILE установлен соответствующим образом. Intellisense распознает библиотеку, которую я использую, и все же я не могу заставить ее работать. Обычно я получаю. Если я не установил целевую архитектуру, она будет продолжаться без vcpkg. Если я пытаюсь установить его, он говорит, что он не поддерживается генератором, что на самом деле и следовало ожидать, поскольку в cmake --help ony Генераторы VS имеют [Arch] tag
CmakeLists.txt cmake_minimum_required(VERSION 3.10)
# set the project name
project(KeyHUD)
find_library()
# add the executable
add_executable(main main.cpp)
Команда 1, которую я попробовал, и ее вывод
PS D:\.WorkSpaces\KeyHUD> cmake -G "MinGW Makefile" -A=Win32 "-DCMAKE_TOOLCHAIN_FILE=D:\.Installs\vcpkg\scripts\buildsystems\vcpkg.cmake"
CMake Error: Could not create named generator MinGW Makefile
Generators
Visual Studio 16 2019 = Generates Visual Studio 2019 project files.
Use -A option to specify architecture.
* Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
Optional [arch] can be "Win64" or "IA64".
Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files.
Optional [arch] can be "Win64" or "IA64".
Borland Makefiles = Generates Borland makefiles.
NMake Makefiles = Generates NMake makefiles.
NMake Makefiles JOM = Generates JOM makefiles.
MSYS Makefiles = Generates MSYS makefiles.
MinGW Makefiles = Generates a make file for use with
mingw32-make.
Unix Makefiles = Generates standard UNIX makefiles.
Green Hills MULTI = Generates Green Hills MULTI files
(experimental, work-in-progress).
Ninja = Generates build.ninja files.
Ninja Multi-Config = Generates build-<Config>.ninja files.
Watcom WMake = Generates Watcom WMake makefiles.
CodeBlocks - MinGW Makefiles = Generates CodeBlocks project files.
CodeBlocks - NMake Makefiles = Generates CodeBlocks project files.
CodeBlocks - NMake Makefiles JOM
= Generates CodeBlocks project files.
CodeBlocks - Ninja = Generates CodeBlocks project files.
CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
CodeLite - MinGW Makefiles = Generates CodeLite project files.
CodeLite - NMake Makefiles = Generates CodeLite project files.
CodeLite - Ninja = Generates CodeLite project files.
CodeLite - Unix Makefiles = Generates CodeLite project files.
Sublime Text 2 - MinGW Makefiles
= Generates Sublime Text 2 project files.
Sublime Text 2 - NMake Makefiles
= Generates Sublime Text 2 project files.
Sublime Text 2 - Ninja = Generates Sublime Text 2 project files.
Sublime Text 2 - Unix Makefiles
= Generates Sublime Text 2 project files.
Команда 2 и ее вывод
PS D:\.WorkSpaces\KeyHUD\build> cmake "-DCMAKE_TOOLCHAIN_FILE=D:\.Installs\vcpkg\scripts\buildsystems\vcpkg.cmake" ..
CMake Warning at D:/.Installs/vcpkg/scripts/buildsystems/vcpkg.cmake:85 (message):
Unable to determine target architecture, continuing without vcpkg.
Call Stack (most recent call first):
CMakeFiles/3.17.0/CMakeSystem.cmake:6 (include)
CMakeLists.txt:4 (project)
CMake Error at CMakeLists.txt:4 (project):
Generator
MinGW Makefiles
does not support platform specification, but platform
=Win32
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "D:/.WorkSpaces/KeyHUD/CMakeFiles/CMakeOutput.log".
Структура папки
D:\.WORKSPACES\KEYHUD
├───.vscode
├───build
├───CMakeFiles
│ └───3.17.0
|───raster
|───main.cpp