conan-io / examples2

Conan 2.x examples
MIT License
87 stars 48 forks source link

error in first example simple_cmake_project #148

Closed simshi closed 3 months ago

simshi commented 3 months ago

conan version 2.3.0 cmake 3.22.1

  1. conan install . --output-folder=build --build=missing generates build/build/Release/generators/, it has extra build/
  2. change to conan install . --build=missing, generates build/Release/generators/, then:
    1. cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release, error with "Could not find toolchain file: conan_toolchain.cmake"
    2. change to cmake .. -DCMAKE_TOOLCHAIN_FILE=Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release, it works
perseoGI commented 3 months ago

@simshi could you please share your conan profile?

jcar87 commented 3 months ago

HI @simshi thank you for reporting this.

Are we talking about https://github.com/conan-io/examples2/tree/main/tutorial/consuming_packages/simple_cmake_project ?

I'm unable to reproduce this with the conanfile.txt in that folder: conan install . --output-folder=build will generate only a single build folder. Have you, by any chance, edited conanfile.txt to define a layout?

simshi commented 3 months ago

Have you, by any chance, edited conanfile.txt to define a layout?

Yes, that's the reason, it worked after I remove the layout. Thank you.