-
Notifications
You must be signed in to change notification settings - Fork 988
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
[feature] Support for running tools built with *:shared=True on Windows from CMake #17508
Comments
BTW - this use-case somehow worked with Conan 1.x... Maybe "*:shared=True" did not apply to transitive dependencies previously? |
Hi @timpatt Thanks for your report. It seems that this hasn't been discussed as a possibility, because you are intending to run purely from cmake, but running purely from CMake as you have realized can have some challenges. For reference, the reported case can work with: conan install . -of=build/conan -s compiler.cppstd=17
call build/conan/build/generators/conanrun.bat
:: Generate
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
:: Build
cmake --build build --config Release As there are DLLs, after Then, an important point to take into account is that executable tools are expected to be used from the "build" context, that is, With this use case, controlling the options for the "build" context is trivial, you can use |
Thanks, @memsharded... I hadn't consider cross-compilation as a solution. I've never used cross compilation before, but spent a fair bit of today looking into it. Looking at the conan-generated files, it looks like I have worked out a couple of solutions to my problem that I've confirmed to work. Both parse the output of
|
This is mostly a recipe thing. Recipes might need to provide extra custom modules to be able to do the right thing. This is one of the things we are trying to improve with the new
Interesting. This is already done automatically by the Related to the new incubating |
What is your suggestion?
I'm not sure if this is a bug (supported feature, but not working) or a feature request (not currently supported feature)...
I'm upgrading our project to use Conan 2 and have hit an issue on Windows running Qt's
moc.exe
that was built as part of a conan install with the-o *:shared=True
option.moc.exe
depends onpcre2-16.dll
and a bunch of other libs which are successfully built with conan, but are in their own directories and not on the path. I know there's the conan deploy stuff now, but that appears to be meant for runtime, not build-time. On Linux/mac, I suspect rpath sidesteps this issue with shared libraries, and when using static libraries there's no issues.Here's a minimal repro: QtConanFail.zip
Note that in my actual use-case, CMake is the primary tool - we use
CMakePresets.json
to inject a customised version ofconan_provider.cmake
making Conan effectively a hidden implementation detail. One solution that does work (but not in my preferred usecase) is to use the "VirtualRunEnv" generator, run conan install, run theconanrun
script and then run CMake.I see a couple of ways forward with my preferred usecase:
** I extract the
bin_paths
from each dependency installed withconan install
and set the PATH environment variable in CMake configure stepset(ENV{PATH} "<qt tool dependency paths>")
, but it doesn't get used in the generate step...** I can set
CMAKE_AUTOMOC_EXECUTABLE
tocmake -e env PATH=<qt tool dependency paths> -- moc.exe
. This alternative makes it past the CMake generation step, but the actual automoc process fails indicating that the CMAKE_AUTOMOC_EXECTUABLE doesn't exist...pcre2:shared=False
for each.See also this slack discussion.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: