Skip to content

Commit 68ea99b

Browse files
author
Damian Rouson
authored
Merge pull request #405 from sourceryinstitute/fix-#404
Fix #404 -m/--with-cmake overrides default cmake
2 parents 268dd64 + afa0d63 commit 68ea99b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

install.sh-usage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
-I --install-version [arg] Install package version.
1212
-j --num-threads [arg] Number of threads to use when invoking make. Default="1"
1313
-l --list-packages Print packages this script can install.
14-
-m --with-cmake [arg] Use specified CMake installation. Default="cmake"
14+
-m --with-cmake [arg] Use specified CMake installation.
1515
-M --with-mpi [arg] Use specified MPI installation.
1616
-n --no-color Disable color output.
1717
-o --only-download Download (without building) the source for the package specified by -p or --package.

prerequisites/install-functions/find_or_install.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,17 @@ find_or_install()
6666
# Every branch that discovers an acceptable pre-existing installation must set the
6767
# CMAKE environment variable. Every branch must also manage the dependency stack.
6868

69-
if [[ "$script_installed_package" == true ]]; then
69+
# If the user specified a CMake binary, use it
70+
if [[ ! -z "${arg_m:-}" ]]; then
71+
72+
echo -e "$this_script: Using the $package specified by -m or --with-cmake: ${arg_m}\n"
73+
export CMAKE="${arg_m}"
74+
# Halt the recursion
75+
stack_push dependency_pkg "none"
76+
stack_push dependency_exe "none"
77+
stack_push dependency_path "none"
78+
79+
elif [[ "$script_installed_package" == true ]]; then
7080
echo -e "$this_script: Using the $package installed by $this_script\n"
7181
export CMAKE=$package_install_path/bin/$executable
7282
stack_push dependency_pkg "none"

0 commit comments

Comments
 (0)