Project

General

Profile

Feature #2796

[SOURCE] Examples should Work Standalone

Added by I. Lazaridis over 8 years ago. Updated over 8 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.

#1

Updated by Wim Dumon over 8 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.

#2

Updated by I. Lazaridis over 8 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)

#3

Updated by I. Lazaridis over 8 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

#4

Updated by Wim Dumon over 8 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.

#5

Updated by I. Lazaridis over 8 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.

Also available in: Atom PDF