blob: 8a13dfda93359d675f03e294e360cfd1d113e76e [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001#Copyright (c) 2017 Sprint
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15#!/bin/sh
16
17usage ()
18{
19 echo "Scans the current directory and adds, as required, the "
20 echo "subdirectories to the specified cmake file with their build ON (enabled)."
21 echo "Usage: $0 <make file>"
22}
23
24
25if [ "$#" -ne 1 ]; then
26 usage
27 exit 0
28fi
29
30if [ -e $1 ]; then
31 echo "Updating $1"
32 for D in *; do
33 if [ -d "${D}" ]; then
34 INDIR=`grep -c FD_EXTENSION_SUBDIR\(${D} $1`
35 if [ "$INDIR" -eq 0 ]; then
36 echo "Adding ${D} to file"
37 echo "FD_EXTENSION_SUBDIR(${D} \"${D} extension library\" ON)" >> $1
38 fi
39 fi
40 done
41else
42 echo "File $1 doesn't exist.Please provide valid make file\n"
43fi