Skip to content

Commit

Permalink
Allow source location to be overridden
Browse files Browse the repository at this point in the history
By default the configure script assumes that the source is located
relative to the script itself. By allowing this to be overridden, the
script can be shared by other projects, each passing their own location
as an extra parameter.
  • Loading branch information
rolk committed Aug 16, 2013
1 parent fa5f17e commit c44b23d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/Scripts/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# where is the source tree located
# where is the source tree located by default relative to here
srcdir=$(dirname $(dirname $(dirname "$0")))

# display help text
Expand Down Expand Up @@ -141,6 +141,11 @@ for OPT in "$@"; do
OPTARG=${OPT#--}
# OPTARG now contains everything after double dashes
case "${OPTARG}" in
src-dir=*)
# allow the user to use these build macros for another
# project (so source-dir is not relative to us)
srcdir=${OPTARG#*=}
;;
prefix=*)
# remove prefix consisting of everything up to equal sign
prefix=${OPTARG#*=}
Expand Down

0 comments on commit c44b23d

Please sign in to comment.