Skip to content

Package visual studio compiler for use with tool_requires #1

Open
conan-io/docs
#3666
@klausholstjacobsen

Description

@klausholstjacobsen

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?

  • I've read the CONTRIBUTING guide

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions