conan-io / cmake-conan

CMake wrapper for conan C and C++ package manager
MIT License
814 stars 247 forks source link

cmake bootstrapping fails if not on PATH #639

Open tbeu opened 2 months ago

tbeu commented 2 months ago

On Win10, I have CMake installed, but not available on PATH. When using the cmake-conan v0.18.1 with --build-missing I notice that cmake is properly resolved as dependency

cmake/3.29.2: Appending PATH environment variable: C:\Users\tbeu.conan\data\cmake\3.29.2__\package\ca33edce272a279b24f87dc0d4cf5bbdcffbc187\bin

but it finally fails with cmake not found:

zlib/1.3.1: Aggregating env generators

zlib/1.3.1: Calling build()

zlib/1.3.1: Apply patch (conan): separate static/shared builds, disable debug suffix

zlib/1.3.1: CMake command: cmake -G "Visual Studio 15 2017" -DCMAKE_TOOLCHAINFILE="C:/Users/tbeu/.conan/data/zlib/1.3.1//_/build/8cf01e2f50fcd6b63525e70584df0326550364e1/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALLPREFIX="C:/Users/tbeu/.conan/data/zlib/1.3.1//_/package/8cf01e2f50fcd6b63525e70584df0326550364e1" -DCMAKE_POLICY_DEFAULTCMP0091="NEW" "C:\Users\tbeu.conan\data\zlib\1.3.1_\\build\8cf01e2f50fcd6b63525e70584df0326550364e1\src"

Der Befehl "cmake" ist entweder falsch geschrieben oder konnte nicht gefunden werden.

zlib/1.3.1: zlib/1.3.1: ERROR: Package '8cf01e2f50fcd6b63525e70584df0326550364e1' build failed

memsharded commented 2 months ago

Hi @tbeu

Thanks for your report.

It seems you are using the legacy 1.X cmake-conan integration, and it is likely that this won't work in it. Unfortunately, we no longer have the resources to keep maintaining the Conan 1.X cmake-conan integration.

I think this should work with Conan 2 cmake-conan integration based in CMake providers, but if not, please let us know and we will have a look.

tbeu commented 2 months ago

Thanks for the fast reply. Yes, I am still on Conan 1.X because latest version 0.18.1 does not support Conan 2 yet.

memsharded commented 2 months ago

Thanks for the fast reply. Yes, I am still on Conan 1.X because latest version 0.18.1 does not support Conan 2 yet.

The main branch in the repo, that is now develop2 contains a Conan 2 ready version, using the new CMake providers which is a great feature because it does no longer need any modification to CMakeLists.txt files, and it is already being extensively used, for example it is used in the CLion plugin integration.

This develop2 branch cmake-conan integration (conan_provider.cmake) is the recommended cmake-conan integration for production now.