conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.01k stars 954 forks source link

Issue with paths in CMake configure #2157

Closed CausticYarn closed 6 years ago

CausticYarn commented 6 years ago

Issue #2152 appears to be resolved, but I am having a similar issue with another package on the Conan Center site (Expat/2.2.1@pix4d/stable). Inside the build method is:

cmake.configure(source_dir="../libexpat/expat", build_dir="build", defs=cmake_args)
cmake.build(target="install")

On Conan 0.28.1, this generates the following command and it builds successfully:

cd build && cmake -G "Visual Studio 9 2008 Win64" -DCONAN_LINK_RUNTIME="/MD" -DCONAN_EXPORTED="1" -DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="9" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="C:\Users\plondino\.conan\data\Expat\2.2.1\msa\thirdparty\package\27a862ea6362ac73306b01c05496a8e44879113a" -DCONAN_CXX_FLAGS="/MP24" -DCONAN_C_FLAGS="/MP24" -Wno-dev -DBUILD_shared="False" -DBUILD_examples="OFF" -DBUILD_tests="OFF" -DBUILD_doc="OFF" -DBUILD_tools="OFF" ../libexpat/expat

However on 0.30.2, the command is:

cd C:\temp\conan30_w_remote\.conan\data\Expat\2.2.1\msa\thirdparty\build\27a862ea6362ac73306b01c05496a8e44879113a\build && cmake -G "Visual Studio 9 2008 Win64" -DCONAN_LINK_RUNTIME="/MD" -DCONAN_EXPORTED="1" -DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="9" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="C:\temp\conan30_w_remote\.conan\data\Expat\2.2.1\msa\thirdparty\package\27a862ea6362ac73306b01c05496a8e44879113a" -DCONAN_CXX_FLAGS="/MP24" -DCONAN_C_FLAGS="/MP24" -Wno-dev -DBUILD_shared="False" -DBUILD_examples="OFF" -DBUILD_tests="OFF" -DBUILD_doc="OFF" -DBUILD_tools="OFF" C:\temp\conan30_w_remote\.conan\data\Expat\2.2.1\msa\thirdparty\build\27a862ea6362ac73306b01c05496a8e44879113a\../libexpat/expat

The absolute paths are appended to the arguments passed to CMake, so the cd command to the build directory doesn't change the relative path like it used to.

It might be a good idea to clarify or restrict this behavior in a future release, but right now this appears to be a breaking change like #2152

memsharded commented 6 years ago

It mostly seems a regression, we are working on it, will try to do a minor 0.30.3. Thanks very much for the info!

memsharded commented 6 years ago

We have released 0.30.3, please check again and report. Sorry for the inconvenient and thanks again for your help!