Skip to content

Commit

Permalink
Adjust configure -cmake to accept both single and double dash arguments
Browse files Browse the repository at this point in the history
This uses sed -E (extended regular expressions) to improve readability of
regular expressions. Shouldn't be a problem on most modern systems.

Change-Id: I12c9834c1ef83bf5f8547bccff655a6b8525cc3d
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
jimis committed Jun 27, 2020
1 parent 52a7d2e commit 33714b6
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -149,23 +149,18 @@ $i"
CMAKE_CMDLINE="$CMAKE_CMDLINE
-DQT_NO_MAKE_${arg_capitalized}=ON"
;;
-feature-*)
VAR=`echo $i | sed 's,^-feature-\(.*\),\1,'`
-feature-*|--feature-*)
VAR=`echo $i | sed -E 's/-?-feature-(.*)/\1/'`
CMAKE_CMDLINE="$CMAKE_CMDLINE
-DQT_FEATURE_${VAR}=ON"
;;
-no-feature-*)
VAR=`echo $i | sed 's,^-no-feature-\(.*\),\1,'`
-no-feature-*|--no-feature-*)
VAR=`echo $i | sed -E 's/-?-no-feature-(.*)/\1/'`
CMAKE_CMDLINE="$CMAKE_CMDLINE
-DQT_FEATURE_${VAR}=OFF"
;;
--no-*)
VAR=`echo $i | sed 's,^--no-\(.*\),\1,'`
CMAKE_CMDLINE="$CMAKE_CMDLINE
-DFEATURE_${VAR}=OFF"
;;
-no-*)
VAR=`echo $i | sed 's,^-no-\(.*\),\1,'`
-no-*|--no-*)
VAR=`echo $i | sed -E 's/-?-no-(.*)/\1/'`
CMAKE_CMDLINE="$CMAKE_CMDLINE
-DFEATURE_${VAR}=OFF"
;;
Expand All @@ -179,12 +174,12 @@ $i"
CMAKE_CMDLINE="$CMAKE_CMDLINE
-DFEATURE_system_${VAR}=OFF"
;;
--sanitize=*)
VAR=`echo $i | sed 's,^--sanitize=\(.*\),\1,'`
-sanitize=*|--sanitize=*)
VAR=`echo $i | sed -E 's/-?-sanitize=(.*)/\1/'`
CMAKE_CMDLINE="$CMAKE_CMDLINE
-DECM_ENABLE_SANITIZERS=${VAR}"
;;
--ccache)
-ccache|--ccache)
CMAKE_CMDLINE="$CMAKE_CMDLINE
-DQT_USE_CCACHE=ON"
;;
Expand Down

0 comments on commit 33714b6

Please sign in to comment.