Feature #2796
open[SOURCE] Examples should Work Standalone
0%
Description
I tried to open the "hangman" example stand-alone within the qt-creator IDE (CMakeLists.txt). This failed.
After this, I've tried to open the whole Examples tree. This failed, too.
I opened it finally as "new project", importing the sources, just to be able to look at the code within the ide (no compilation).
A possible feature would be:
- Ideally: each example should work (build, run) for itself.
- Alternatively: the example-tree should work for itself.
This could become difficult, and involve the CMAKE build-system. But having the source-codes modular and reusable (and not monolithic and coupled), especially the examples, has several benefits which could be worth the effort.
Test Case
- using qt-creator to open (via CMakeLists.txt) an example or the whole example tree.
Updated by Wim Dumon over 9 years ago
- Status changed from New to Feedback
Last time I looked into this, cmake did not support this. You can only write project statements in the toplevel CMakeLists.txt.
Do you know if CMake supports this now?
BR,
Wim.
Updated by I. Lazaridis over 9 years ago
No, but this would be an issue where I would get a solution, no matter how.
(Possibly I'll rework the hangman-example in parallel to the blog-example, and try it there, in a minimal setup)
Updated by I. Lazaridis over 9 years ago
Wim Dumon wrote:
Last time I looked into this, cmake did not support this. You can only write project statements in the toplevel CMakeLists.txt.
Do you know if CMake supports this now?
Seems that yes:
A quick lookup showed this use-case:
https://github.com/InsightSoftwareConsortium/ITKWikiExamples/blob/master/CMakeLists.txt
Updated by Wim Dumon over 9 years ago
You probably want to add BUILD_EXAMPLES=ON when you import Wt in Qt creator. I don't know Qt Creator, but that's what we do by default on Windows to get all the examples in the MSVS project.
BR,
Wim.
Updated by I. Lazaridis over 9 years ago
Wim Dumon wrote:
You probably want to add BUILD_EXAMPLES=ON when you import Wt in Qt creator.
This is not about my problem (I don't have one, I can rewrite the whole stuff if I want).
This is about changing your examples, thus they work out-of-the-box, standalone, as they should.