qtcreator IDE template now generates a "generic" Qt project (#4262)

* Create qtcreator-generic IDE template.

* Fix case of #define in qtcreator-generic template .config file.

* follow directory move

* * fix includes output
  * fixup -mlong-calls for clang
  * add Makefile to files output

* fix escaping in config output

* Makefile improvements:
  * support any platformio run target
  * remove platformio deprecated -f option
  * remove explicit default target (first is always default)

* replace qtcreator rather than making another IDE target

Co-authored-by: Donna Whisnant <dewhisna@users.noreply.github.com>
This commit is contained in:
John Belmonte
2022-05-14 21:26:04 +09:00
committed by GitHub
parent 7c93167d52
commit 8c27754045
9 changed files with 29 additions and 45 deletions

View File

@ -0,0 +1,2 @@
.pio
*.creator.user

View File

@ -0,0 +1,6 @@
all:
platformio -c qtcreator run
# forward any other target (clean, build, etc.) to pio run
{{'%'}}:
platformio -c qtcreator run --target $*

View File

@ -0,0 +1 @@
{{cc_flags.replace('-mlongcalls', '-mlong-calls')}}

View File

@ -0,0 +1,8 @@
% for define in defines:
% tokens = define.split("=", 1)
% if len(tokens) > 1:
#define {{tokens[0].strip()}} {{!tokens[1].strip()}}
% else:
#define {{define}}
% end
% end

View File

@ -0,0 +1,2 @@
[General]

View File

@ -0,0 +1 @@
{{cxx_flags.replace('-mlongcalls', '-mlong-calls')}}

View File

@ -0,0 +1,5 @@
Makefile
platformio.ini
% for file in src_files:
{{file}}
% end

View File

@ -0,0 +1,4 @@
./
% for include in filter_includes(includes):
{{include}}
% end

View File

@ -1,45 +0,0 @@
% import re
%
% cpp_standards_remap = {
% "0x": "11",
% "1y": "14",
% "1z": "17",
% "2a": "20",
% "2b": "23"
% }
win32 {
HOMEDIR += $$(USERPROFILE)
}
else {
HOMEDIR += $$(HOME)
}
% for include in filter_includes(includes):
% if include.startswith(user_home_dir):
INCLUDEPATH += "$${HOMEDIR}{{include.replace(user_home_dir, "")}}"
% else:
INCLUDEPATH += "{{include}}"
% end
% end
% for define in defines:
% tokens = define.split("##", 1)
DEFINES += "{{tokens[0].strip()}}"
% end
OTHER_FILES += platformio.ini
% for file in src_files:
% if file.endswith((".h", ".hpp")):
HEADERS += {{file}}
% else:
SOURCES += {{file}}
% end
% end
% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)")
% cxx_stds = STD_RE.findall(cxx_flags)
% if cxx_stds:
CONFIG += c++{{ cpp_standards_remap.get(cxx_stds[-1], cxx_stds[-1]) }}
% end