xref: /haiku/3rdparty/qtcreator/create_project_file.sh (revision 7bdeef54a24d3417300f251af891df962b638b9b)
1#!/bin/sh
2
3if [ "$#" -ne 2 ]; then
4	echo "This script creates project files for Qt Creator to develop Haiku with."
5	echo "It should only be used on a per-project basis, as Qt Creator is too slow"
6	echo "when used on all of Haiku at once."
7	echo ""
8	echo "THIS SCRIPT *MUST* BE RUN FROM THE REPOSITORY ROOT."
9	echo ""
10	echo "Usage: <script> <project name> <path to project root>"
11	echo "e.g: create_project_file.sh Tracker src/kits/tracker/"
12	exit 1
13fi
14
15DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
16NAME=$1
17ROOTDIR=$2
18
19printf "// Add predefined macros for your project here. For example:\n// #define THE_ANSWER 42\n" \
20	>$DIR/$NAME.config
21printf "[General]\n" >$DIR/$NAME.creator
22
23# Build lists of files
24find $ROOTDIR -type f | sed "s@^@../../@" >$DIR/$NAME.files
25find $ROOTDIR -type d | sed "s@^@../../@" >$DIR/$NAME.includes
26find headers -type d | sed "s@^@../../@" >>$DIR/$NAME.includes
27echo "Done. Project file: $DIR/$NAME.creator"
28