microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.2k stars 6.39k forks source link

Error from vcpkg.cmake: 'CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".' WSL Arch #41095

Closed carljohnson93 closed 1 month ago

carljohnson93 commented 1 month ago

Describe the bug When running "cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake" I get an error "CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".". I have make installed, so the actual generator does not matter, the issue still appears if I use -G'Ninja' (I also have ninja installed).

Environment

To Reproduce Steps to reproduce the behavior:

  1. Execute following shell commands:
    mkdir test && cd test
    git clone --depth=1 https://github.com/microsoft/vcpkg
    echo '{"dependencies":["fmt"]}' >vcpkg.json
    echo 'int main() {}' >main.c
    {
    echo "cmake_minimum_required(VERSION 3.10)"
    echo "project(test)"
    echo "find_package(fmt CONFIG REQUIRED)"
    echo "add_executable(main main.c)"
    } >CMakeLists.txt
    cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake

Expected behavior No error

Failure logs I couldn't find any failure logs

Osyotr commented 1 month ago

What is the full error log? I suspect that the path to the toolchain is wrong.

carljohnson93 commented 1 month ago

@Osyotr the path to the toolchain isn't wrong. I tried to specify path prefixed with ${HOME}/test/ and it made no difference. And error message says that the error occured in .../buildsystems/vcpkg.cmake so it's not that.

Osyotr commented 1 month ago

Ok but what is the full output? The message you mentioned is usually a result of some previous error.

carljohnson93 commented 1 month ago

I'm sorry I have reinstalled windows for different reasons, and installed WSL with openSUSE tumbleweed distro this time, so I cannot provide full error output.

dg0yt commented 1 month ago

Then this issue can be closed,