Skip to content

Add support for the CMAKE environmental variable #42

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

Merged
merged 1 commit into from
Dec 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ library.
cmake = "0.2"
```

The CMake executable is assumed to be `cmake` unless the `CMAKE`
environmental variable is set.

# License

This project is licensed under either of
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ impl Config {
let cmake_prefix_path = env::join_paths(&cmake_prefix_path).unwrap();

// Build up the first cmake command to build the build system.
let mut cmd = Command::new("cmake");
let executable = env::var("CMAKE").unwrap_or("cmake".to_owned());
let mut cmd = Command::new(executable);
cmd.arg(&self.path)
.current_dir(&build);
if target.contains("windows-gnu") {
Expand Down