Skip to content

Commit

Permalink
Add QtCreator files
Browse files Browse the repository at this point in the history
This adds

* a script that runs qmake and then patches includes/defines/QT-vars
* a code style script that helps following our coding conventions
  • Loading branch information
JohannesLorenz committed May 5, 2019
1 parent ac257f0 commit ce108d6
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
40 changes: 40 additions & 0 deletions data/ide/qt-creator/code-style.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorCodeStyle>
<!-- Written by QtCreator 4.8.2, 2019-04-27T23:08:23. -->
<qtcreator>
<data>
<variable>CodeStyleData</variable>
<valuemap type="QVariantMap">
<value type="bool" key="AlignAssignments">false</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="bool" key="BindStarToIdentifier">true</value>
<value type="bool" key="BindStarToLeftSpecifier">false</value>
<value type="bool" key="BindStarToRightSpecifier">false</value>
<value type="bool" key="BindStarToTypeName">false</value>
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
<value type="bool" key="IndentAccessSpecifiers">false</value>
<value type="bool" key="IndentBlockBody">true</value>
<value type="bool" key="IndentBlockBraces">true</value>
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentClassBraces">false</value>
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
<value type="bool" key="IndentEnumBraces">false</value>
<value type="bool" key="IndentFunctionBody">true</value>
<value type="bool" key="IndentFunctionBraces">false</value>
<value type="bool" key="IndentNamespaceBody">true</value>
<value type="bool" key="IndentNamespaceBraces">false</value>
<value type="int" key="IndentSize">4</value>
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentSwitchLabels">true</value>
<value type="int" key="PaddingMode">2</value>
<value type="bool" key="ShortGetterName">true</value>
<value type="bool" key="SpacesForTabs">false</value>
<value type="int" key="TabSize">4</value>
</valuemap>
</data>
<data>
<variable>DisplayName</variable>
<value type="QString">LMMS</value>
</data>
</qtcreator>
40 changes: 40 additions & 0 deletions data/ide/qt-creator/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

die()
{
echo "$@"
exit 1
}

main()
{
[ "${BASH_SOURCE[0]}" ] || die "Variable BASH_SOURCE missing"
command -v dirname >/dev/null || die "Function 'dirname' missing"
command -v qmake >/dev/null || die "Mising command or alias 'qmake'"
local cwd
cwd="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
[ "$cwd" ] || die "Could not find current working dir"
cd "$cwd/../../../" || die "Could not change directory"


local builddir=$1
[ -d "$builddir" ] || die "Please specify a build directory for 1st arg"

local settings=()
settings+=('QT += core gui widgets xml')
settings+=('INCLUDEPATH += include')
settings+=("INCLUDEPATH += $builddir $builddir/src")
settings+=("DEFINES += LMMS_EXPORT=")

[ -d /usr/include/lilv-0 ] && settings+=('INCLUDEPATH += /usr/include/lilv-0')

local basename=$(basename $PWD)
[ "$basename" ] || die "Can't get basename of $PWD"
local profile=$(basename $PWD).pro
qmake -project "${settings[@]}" -o $(basename $PWD).pro || die "qmake failure"

echo "Created $profile"
echo "If you have not already, import code style "
}

main "$@"

0 comments on commit ce108d6

Please sign in to comment.