tdf#92561 : QtCreator doesn't find any generated c++ headers.

Use lib.include to list :
- all include paths (with generated c++ headers),
- header files for each lib/module.

Change-Id: I44f20ddbcaf2ffa844ec02977dea10f32fe9d92f
Reviewed-on: https://gerrit.libreoffice.org/17055
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
This commit is contained in:
Michel Renon
2015-07-14 23:40:04 +02:00
committed by Maxim Monastirsky
parent 50fe21c780
commit dcec162ea0

View File

@@ -1298,8 +1298,13 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
return os.path.relpath(path, lib.location) return os.path.relpath(path, lib.location)
sources_list = [] sources_list = []
headers_list = []
includepath_list = [] includepath_list = []
# The explicit headers list is not mandatory :
# QtCreator just needs 'include_path_list' to find all headers files.
# But files listed in 'header_list' will be shown
# in a specific "Headers" folder in QtCreator's Project panel.
# We will list here only headers files of current lib.
headers_list = []
for file_ in lib.cxxobjects: for file_ in lib.cxxobjects:
# the file has no extension : search it # the file has no extension : search it
# self._log("\n file : %s" % file_) # self._log("\n file : %s" % file_)
@@ -1312,21 +1317,19 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
if ext: if ext:
headers_list.append(lopath(file_+ext)) headers_list.append(lopath(file_+ext))
# List all headers # List all include paths
for hdir in lib.include: for hdir in lib.include:
# except from "workdir" folder hf_lopath = lopath(hdir)
if "workdir" not in hdir: includepath_list.append(hf_lopath)
# List headers files from current lib
for hdir in lib.include:
if hdir.startswith(lib.location):
for hf in os.listdir(hdir): for hf in os.listdir(hdir):
if hf.endswith(('.h', '.hxx', '.hpp', '.hrc')): if hf.endswith(('.h', '.hxx', '.hpp', '.hrc')):
hf_lopath = lopath(os.path.join(hdir, hf)) hf_lopath = lopath(os.path.join(hdir, hf))
headers_list.append(hf_lopath) headers_list.append(hf_lopath)
# We also need to have a list of include paths
for header in headers_list:
header_path = os.path.dirname(header)
if header_path not in includepath_list:
includepath_list.append(header_path)
# All datas are prepared, store them for the lib. # All datas are prepared, store them for the lib.
if lib_folder in self.data_libs: if lib_folder in self.data_libs:
self.data_libs[lib_folder]['sources'] |= set(sources_list) self.data_libs[lib_folder]['sources'] |= set(sources_list)