conan icon indicating copy to clipboard operation
conan copied to clipboard

Package visual studio compiler for use with tool_requires

Open klausholstjacobsen opened this issue 2 years ago • 4 comments

What is your question?

OS: windows 10 conan 1.56

I have packaged the "Visual Studio 2017" toolchain in a package and use it on the consumer side in my build profile [tool_requires]. My consumer I would then like my consumer recipe to detect and use the toolchain provided by conan like this:

    def generate(self):
        tc = CMakeToolchain(self)
        tc.cache_variables["CMAKE_GENERATOR_INSTANCE"] = "[path to toolchain]"
        tc.generate()
        deps = CMakeDeps(self)
        deps.generate()

[path to toolchain] points to "...2017\BuildTools" within the package as indicated by cmake. But CMakeToolchain refuses to detect anything but the installed Visual Studio in "c:\Program Files....." Is there a way for me to be able to force the "system" to use the visual studio compiler from my package so that other developers in my team can build without manually installing visual studio.

Regards Klaus

Have you read the CONTRIBUTING guide?

  • [X] I've read the CONTRIBUTING guide

klausholstjacobsen avatar Feb 03 '23 13:02 klausholstjacobsen