Discussion:
[Qt-creator] Questions about CMake INTERFACE project
Abir Basak
2018-08-27 05:23:01 UTC
Permalink
Hi,
When I open a CMake INTERFACE project, do not see the header files in the
QtC Projects pane. This is not problem with executable or library project.
Presently as a workaround I made a custom target adding the header files,
e.g.
add_custom_target(dummy SOURCES ${HEADERS})
This solves the problem partially listing the header files under a separate
target node 'dummy' , but misses language features.
So it shows all sorts of wrong analysis like include file not found, or
requires c++17 extension etc. Those settings are all present for the actual
target like target_compile_features, target_Include_directories , but can't
be placed on custom target which is not a compilable target.

Is there a proper way to handle INTERFACE projects so that QtC understands
it and doesn't show wrong analysis (btw, the project itself is fine, runs
all tests & examples correctly, only the analysis in QtC is misleading &
doesn't show the headers without custom target, even with target_sources)

Thanks
Aleksey Kontsevich
2018-08-27 05:25:54 UTC
Permalink
Observed this situation many times as well - good to know the answer: is there a way to handle, bug or missed feature?

-- 
Best regards,
Aleksey
Linked in https://www.linkedin.com/in/alekseykontsevich
Hi,
  When I open a CMake INTERFACE project, do not see the header files in the QtC Projects pane. This is not problem with executable or library project.
  Presently as a workaround I made a custom target adding the header files, e.g.
 add_custom_target(dummy SOURCES ${HEADERS})
This solves the problem partially listing the header files under a separate target node 'dummy' , but misses language features.
 So it shows all sorts of wrong analysis like include file not found, or requires c++17 extension etc. Those settings are all present for the actual target like target_compile_features, target_Include_directories , but can't be placed on custom target which is not a compilable target.
 Is there a proper way to handle INTERFACE projects so that QtC understands it and doesn't show wrong analysis (btw, the project itself is fine, runs all tests & examples correctly, only the analysis in QtC is misleading & doesn't show the headers without custom target, even with target_sources)
Thanks
,
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
Tobias Hunger
2018-08-27 10:56:30 UTC
Permalink
Currently CMake does not provide the necessary information to include
this information in the tree.

There is currently work ongoing in cmake to provide it though, so
maybe this long-standing issue can be fixed soon -- provided you use
cmake >= 3.13 or whenever that change will be available in cmake and a
creator new enough to know about it.

Best Regards,
Tobias

Loading...