#Unable to build conan package with GTest with tool_requires(cmake)

6 messages · Page 1 of 1 (latest)

vast schooner
#

I have such simple package in conanfile.py in root of my project:

[....................imports....................i]

class APL(ConanFile):
   [......................]

    settings = "os", "compiler", "build_type", "arch"

    def build_requirements(self):
        self.tool_requires("cmake/3.22.6")        
        self.test_requires("gtest/1.16.0")

    [....................]

    def build(self):
        cmake = CMake(self)
        cmake.configure()
        cmake.build()

When running conan install . --build missing i get such error from gtest dependency after running cmake -G "MinGW Makefiles"............:

'cmake' is not recognized as an internal or external command,
operable program or batch file.

While i don't have cmake installed system-wide (it is not mentioned in PATH) i expect gtest to catch it from self.tool_requires("cmake/3.22.6"), but that doesn't happen. What am i doing wrong and how can i fix it?

Thanks for your help!

hearty flaxBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

unreal yoke
#

have you installed cmake?

vast schooner
#

i have cmake installed along with CLion and i could use it, but that is not what i want

#

i cna provide any additional info, if wanted