conan-io / cmake-conan

CMake wrapper for conan C and C++ package manager
MIT License
829 stars 252 forks source link

Passing PROFILE breaks cmake_multi generator #103

Open sssilver opened 6 years ago

sssilver commented 6 years ago

The following invocation:

conan_cmake_run(REQUIRES ${DEPENDENCIES}
    BASIC_SETUP CMAKE_TARGETS
    BUILD missing
    PROFILE ../custom_profile
)

Where ../custom_profile contains just a single line:

include(default)

Fails to build with the following output:

-- Toolchain using default iOS SDK: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - failed
-- Conan: Using cmake-multi generator
-- Conan ** WARNING** : This detection of settings from cmake is experimental and incomplete. Please check 'conan.cmake' and contribute
-- Conan executing: conan install . -pr ../custom_profile --build=missing
PROJECT: Installing /Users/silver/Projects/tsg/sphere-game/build.ios/conanfile.txt
Requirements
    fmt/5.1.0@bincrafters/stable from 'conan-center' - Cache
    gtest/1.8.0@bincrafters/stable from 'conan-center' - Cache
    spdlog/1.1.0@bincrafters/stable from 'conan-center' - Cache
Packages
    fmt/5.1.0@bincrafters/stable:d8916f6016f745b1163b85952f5e984556ca5311 - Cache
    gtest/1.8.0@bincrafters/stable:79bf458d3de8bb5575d85a5ab9191928a608b0ae - Cache
    spdlog/1.1.0@bincrafters/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache

fmt/5.1.0@bincrafters/stable: Already installed!
gtest/1.8.0@bincrafters/stable: Already installed!
spdlog/1.1.0@bincrafters/stable: Already installed!
PROJECT: Generator cmake created conanbuildinfo.cmake
PROJECT: Generator txt created conanbuildinfo.txt
PROJECT: Generated conaninfo.txt
-- Conan ** WARNING** : This detection of settings from cmake is experimental and incomplete. Please check 'conan.cmake' and contribute
-- Conan executing: conan install . -pr ../custom_profile --build=missing
PROJECT: Installing /Users/silver/Projects/tsg/sphere-game/build.ios/conanfile.txt
Requirements
    fmt/5.1.0@bincrafters/stable from 'conan-center' - Cache
    gtest/1.8.0@bincrafters/stable from 'conan-center' - Cache
    spdlog/1.1.0@bincrafters/stable from 'conan-center' - Cache
Packages
    fmt/5.1.0@bincrafters/stable:d8916f6016f745b1163b85952f5e984556ca5311 - Cache
    gtest/1.8.0@bincrafters/stable:79bf458d3de8bb5575d85a5ab9191928a608b0ae - Cache
    spdlog/1.1.0@bincrafters/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache

fmt/5.1.0@bincrafters/stable: Already installed!
gtest/1.8.0@bincrafters/stable: Already installed!
spdlog/1.1.0@bincrafters/stable: Already installed!
PROJECT: Generator cmake created conanbuildinfo.cmake
PROJECT: Generator txt created conanbuildinfo.txt
PROJECT: Generated conaninfo.txt
-- Configuring incomplete, errors occurred!
See also "/Users/silver/Projects/tsg/sphere-game/build.ios/CMakeFiles/CMakeOutput.log".
See also "/Users/silver/Projects/tsg/sphere-game/build.ios/CMakeFiles/CMakeError.log".

CMake Error at cmake/conan.cmake:391 (message):
  conanbuildinfo_multi.cmake doesn't exist in
  /Users/silver/Projects/tsg/sphere-game/build.ios
Call Stack (most recent call first):
  cmake/conan.cmake:420 (conan_load_buildinfo)
  cmake/dependencies.cmake:11 (conan_cmake_run)
  CMakeLists.txt:24 (include)

Tried this with 0.11/0.12/develop, all have the same issue.

Removing the PROFILE argument from conan_cmake_run() makes everything work.

MarcelRaad commented 6 years ago

I've also just been hit by this. It's caused by overriding the settings here: https://github.com/conan-io/cmake-conan/blob/v0.12/conan.cmake#L301 which have previously been updated to contain the right generator: https://github.com/conan-io/cmake-conan/blob/v0.12/conan.cmake#L77

puetzk commented 5 years ago

I think this gets fixed by #104, so it should probably get labeled for milestone v0.13 too?