Changed the order of application initialization to avoid window popping up with -h option
project (VEFViewer)
cmake_minimum_required (VERSION 2.4)
# Set Qt4 and QGLViewer configuration
find_package (Qt4 REQUIRED)
find_library (QGLViewer_LIBRARY
NAMES QGLViewer)
find_path (QGLViewer_INCLUDE_DIR QGLViewer/qglviewer.h)
set (QT_USE_QTXML TRUE)
set (QT_USE_QTOPENGL TRUE)
include (${QT_USE_FILE})
set (sources VEFViewer.cpp main.cpp sphere.cpp)
set (moc_hdrs VEFViewer.h)
qt4_wrap_cpp (moc_srcs ${moc_hdrs})
set (uis viewerInterface.ui)
qt4_wrap_ui (uis_h ${uis})
include_directories (${CMAKE_CURRENT_BINARY_DIR} ${QGLViewer_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
find_library (boost_program_options_LIBRARY NAME boost_program_options
PATHS ${Boost_LIBRARY_DIR})
add_executable (VEFViewer ${sources} ${moc_srcs} ${uis_h})
target_link_libraries (VEFViewer ${QT_LIBRARIES} ${QGLViewer_LIBRARY} ${boost_program_options_LIBRARY})
install (TARGETS VEFViewer
RUNTIME DESTINATION bin)