Message: Re: How to compile examples with cmake and Qt support? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: How to compile examples with cmake and Qt support? 

Forum: (Graphical) User Interfaces
Re: Question How to compile examples with cmake and Qt support? (Mojca Miklavec)
Date: 17 Jul, 2011
From: Ben Morgan <Ben Morgan>

Hi Mojca,

On Thu, 14 Jul 2011 17:56:41 GMT, Mojca Miklavec wrote:
> it compiles fine and runs, but I don't get any Qt interface. It just prints out some initalizations and quits. What am I missing?

I suspect that it's missing the G4VIS_USE and G4UI_USE definitions, which are used in that example to protect the inclusion of the UI/VISExecutive setup classes in exampleN02.cc.

If you modify your CMakeLists.txt to

cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
project(exampleN02)
 
find_package(Geant4 REQUIRED COMPONENTS qt)
include(${Geant4_USE_FILE})
add_definitions(-DG4UI_USE -DG4VIS_USE)
 
GEANT4_COLLATE_APPLICATION_SOURCES(EXAMPLEN02_SOURCES)
 
add_executable(exampleN02 ${EXAMPLEN02_SOURCES})
target_link_libraries(exampleN02 ${Geant4_LIBRARIES})

that should add the needed definitions and the Qt UI/Vis should run.

Cheers,

Ben.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Ok: Re: How to compile examples with cmake and Qt support?   (Mojca Miklavec - 18 Jul, 2011)
 Add Message Add Message
to: "Re: How to compile examples with cmake and Qt support?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]