-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] How to use cmake-conan with CMakeToolchain
generator?
#410
Comments
This is kind of a chicken and egg problem, you cannot pass the toolchain because it doesnt exist yet. Unless you want to build a cmake flow that actually stops at the first pass after generating the conan stuff, and then it can use the toolchain at the second run, then, using the toolchain file is impossible by CMake behavior. Even if that is possible, then it is certainly not a conventional flow, and if you need to teach developers to do that, why not just letting them run a "conan install"? In any case the |
@memsharded Are you saying, It's "not" possible/reasonable/recommended to use CMake-Conan with |
Can somebody clarify this? |
@lbckmnn, If you want to use the existing If you want to use CMake-Conan, I suggest that you use |
If |
Hi @hwhsu1231, |
This CAE problem is probably solved by the solution that I proposed previously. (#449) Project Link: https:/hwhsu1231/cmake-conan-setup |
CMakeToolchain
generator.CMakeToolchain
generator?
CMakeToolchain
generator?CMakeToolchain
generator?
In Conan documentation, it says that we need to add
-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
in the command-line. That is, we have to generate theconan_toolchain.cmake
file "before" we runcmake
to configure the project.However, with CMake-Conan, we use
conan_cmake_configure()
to generateconanfile.txt
file, and useconan_cmake_install()
to runconan install
command. If we addCMakeToolchain
generator inconan_cmake_configure()
, theconan_toolchain.cmake
file will be generated after theconan_cmake_install()
is conducted.It looks like the
conan_toolchain.cmake
file is generated "after" we runcmake
executable.How to deal with this situation?
The text was updated successfully, but these errors were encountered: