Project

General

Profile

Actions

Feature #2796

open

[SOURCE] Examples should Work Standalone

Added by I. Lazaridis about 10 years ago. Updated about 10 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
03/11/2014
Due date:
% Done:

0%

Estimated time:

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.

Actions #1

Updated by Wim Dumon about 10 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.

Actions #2

Updated by I. Lazaridis about 10 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)

Actions #3

Updated by I. Lazaridis about 10 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

Actions #4

Updated by Wim Dumon about 10 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.

Actions #5

Updated by I. Lazaridis about 10 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.

Actions

Also available in: Atom PDF