-
Notifications
You must be signed in to change notification settings - Fork 255
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
[suggest][dev2] Run conan install in a subprocess when injection. (to solve CAE) #488
Comments
This scheme should be able to solve the situation you mentioned in: #480 (comment), right? |
And I noticed that it won't generate a |
The approach described cannot detect correctly CMake current compiler and configuration.
When |
@memsharded - Are you sure? Well... Recently, QtCreator updated its
As we can see, Qt Team uses nearly the same method as mine to integrate
Since my cmake-conan-setup project is inspired by the design of |
Their approach is to provide a profile: cc/ @cristianadam |
But their |
I did the same things as the @hwhsu1231 thank you for looking in to Qt Creator's source code. I do hope that it works for you, if not feel free to open bug reports at http://bugreports.qt.io/ |
The key of running Trying to detect the profile before that, as @hwhsu1231 suggests, doesn't work, and results in the wrong profile being detected and passed to |
I still don't get it. Why will the wrong profile be detected? Can you provide an example? In my opinion, if we can pass exactly the same CMake CLI arguments as the main-process is using to the sub-process, then it should be able to generate the correct profile in the sub-process. What do I miss? |
Excuse me, @cristianadam. Do you understand what @memsharded was talking about? I think the integration with cmake-conan that QtCreator proposed is great and feasible. However, @memsharded said that this only works with Qt, but doesn't work with the majority of Conan cmake-conan users. Why? |
If I understand correctly, what @memsharded insisted is that:
But what I'm saying is that:
|
@memsharded @jcar87 @czoido @prince-chrismc Hello Conan Team. Can you give some responses, please? |
Sorry, we are busy, things take time and there are many ongoing parallel priorities, no need to rush the team, we already have this in our agendas, please be patience. |
Suggestion
There still exists the CAE problem of CMakeToolchain in the Dependency Provider, which causes some limitations:
However, I wondered why not adopt the techinuqe I mentioned in the cmake-conan-setup before:
The outline of the workflow may look like this:
When injection with
CMAKE_PROJECT_TOP_LEVEL_INCLUDES
:CMakeLists.txt
throughfile(WRITE)
command.conan_install()
inside the generatedCMakeLists.txt
.CMakeLists.txt
throughexecute_process()
command.conan_toolchain.cmake
afterconan install
successes.When
find_package()
invokesconan_provide_dependency()
:${CONAN_OUTPUT_FOLDER}
intoCMAKE_PREFIX_PATH
.${CONAN_OUTPUT_FOLDER}
intoCMAKE_MODULE_PATH
.find_package(${ARGN} BYPASS_PROVIDER)
.Demonstration
The following project is a simple prototype, in which I only considered the situation using MSVC compiler with Ninja generator:
Extract the following archived file.
cmake-conan-provider.zip
Call
vcvarsall.bat x64
to initialize the MSVC env:Run the following
cmake
command to configure the porject:Logs
Click to expand logs
As we can see in the above logs, the
conan_toolchain.cmake
file is included andfmt-config.cmake
file is find_packaged successfully. Although I only considered using MSVC compiler with Ninja generator currently, it proves that this scheme is feasible at least. What do you think, Conan Team?The text was updated successfully, but these errors were encountered: