diff --git a/sw/tools/qt_project.py b/sw/tools/qt_project.py index 648b4b5fe3..49d6ade3a4 100755 --- a/sw/tools/qt_project.py +++ b/sw/tools/qt_project.py @@ -3,6 +3,7 @@ import sys import re from os import path, getenv from lxml import etree +import fileinput # Get the paparazzi home dir (if not set assume this folder is correct) home_dir = getenv("PAPARAZZI_HOME", path.normpath(path.join( @@ -108,4 +109,19 @@ creator_file.close() # Close the ap_srcs.list ap_srcs_list.close() + +#Create a .user file, which contains user settings such as editor settings and build settings +with open(path.join(home_dir , "sw/tools/qtc.creator.user_template")) as input: + with open(path.join(home_dir, target + ".creator.user"), 'w') as output: + for s in input: + if "!TARGET1!" in s: + output.write(s.replace("!TARGET1!", aircraft + " " + target + ".compile")) + elif "!TARGET2!" in s: + output.write(s.replace("!TARGET2!", aircraft)) + elif "!PPRZHOME!" in s: + output.write(s.replace("!PPRZHOME!", getenv("PAPARAZZI_HOME"))) + else: + output.write(s.replace("!PPRZSRC!", getenv("PAPARAZZI_SRC"))) + + print("Done generating the Qt Creator project!") diff --git a/sw/tools/qtc.creator.user_template b/sw/tools/qtc.creator.user_template new file mode 100644 index 0000000000..5869247310 --- /dev/null +++ b/sw/tools/qtc.creator.user_template @@ -0,0 +1,200 @@ + + + + + + EnvironmentId + {3799acf3-eb9e-4a06-886d-992bd0f8d07a} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + qt3 + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 1 + false + 80 + true + true + 1 + true + false + 0 + true + true + 1 + 2 + false + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.7.0 GCC 64bit + Desktop Qt 5.7.0 GCC 64bit + qt.57.gcc_64_kit + 0 + 0 + 0 + + $PAPARAZZI_SRC + + + + false + -C $PAPARAZZI_SRC -f Makefile.ac AIRCRAFT=!TARGET1! + + true + Make + + GenericProjectManager.GenericMakeStep + + 1 + Build + + ProjectExplorer.BuildSteps.Build + + + + + true + -C $PAPARAZZI_SRC -f Makefile.ac AIRCRAFT=!TARGET2! clean_ac + + true + Make + + GenericProjectManager.GenericMakeStep + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + PAPARAZZI_HOME=!PPRZHOME! + PAPARAZZI_SRC=!PPRZSRC! + PAPARAZZI_QT_GEN=0 + + Default + Default + GenericProjectManager.GenericBuildConfiguration + + 1 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + + %{buildDir} + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + +