Skip to content
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

Question: Can we override cmake path? #4379

Closed
nesc1 opened this issue Jan 24, 2019 · 6 comments
Closed

Question: Can we override cmake path? #4379

nesc1 opened this issue Jan 24, 2019 · 6 comments

Comments

@nesc1
Copy link

nesc1 commented Jan 24, 2019

Hi, quick question, can we override cmake path in a profile or something like that or we need to do the following in order to execute a cmake that is not on the path:

from conans import ConanFile, CMake

 class ExampleConan(ConanFile):
     ...

     def build(self):
         cmake = CMake(self)
         self.run('/my/custom/path/to/cmake "%s" %s' % (self.source_folder, cmake.command_line))
         self.run('/my/custom/path/to/cmake --build . %s' % cmake.build_config)
         self.run('/my/custom/path/to/cmake --build . --target install')

Thanks

@SSE4
Copy link
Contributor

SSE4 commented Jan 24, 2019

Hi @nesc1
it was recently implemented in #4298 (docs conan-io/docs#1025), and probably, will be available in next release. CMake class will accept new argument called cmake_program.

@nesc1
Copy link
Author

nesc1 commented Jan 24, 2019

Thanks @SSE4 , so for now i can assume that i need to use self.run('path/to/cmake ...') right?

There is no profile environment ([env]) like for example CONAN_CMAKE_GENERATOR to override the default generator?

@SSE4
Copy link
Contributor

SSE4 commented Jan 24, 2019

yes, I believe until next release, there is no variable to do this. you probably may try to change PATH, so it has custom CMake path before others.

@nesc1
Copy link
Author

nesc1 commented Jan 24, 2019

Thanks @SSE4 for the quick reply

(would not it be also useful to be possible to define it on a profile, something like CONAN_CMAKE_CMAKE... or something like that?)

@nesc1 nesc1 closed this as completed Jan 24, 2019
@memsharded
Copy link
Member

Have you tried to customize the PATH in the profile, or just play with the PATH system env-var?

Yes, the CONAN_CMAKE_PROGRAM will be possible to set it in a profile. That is merged, you might try to run from latest develop release in TestPyPI:

$ pip install --index-url https://test.pypi.org/simple/ conan

@nesc1
Copy link
Author

nesc1 commented Jan 24, 2019

Thank you @memsharded, i will try both suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants