Skip to content

Commit

Permalink
Include qt svg library
Browse files Browse the repository at this point in the history
  • Loading branch information
davidborland committed Jan 24, 2020
1 parent b0887c1 commit 3fa7688
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,21 @@ file(GLOB CXX_FILES
${CMAKE_CURRENT_SOURCE_DIR}/vtk/*.cxx
)

set(UI_RESOURCES
${CMAKE_CURRENT_SOURCE_DIR}/Segmentor.qrc
${CMAKE_CURRENT_SOURCE_DIR}/Segmentor.rc
)

if(${VTK_VERSION} VERSION_GREATER "6" AND VTK_QT_VERSION VERSION_GREATER "4")
qt5_wrap_ui(UISrcs ${UI_FILES} )
# CMAKE_AUTOMOC in ON so the MOC headers will be automatically wrapped.
add_executable(Segmentor MACOSX_BUNDLE ${CXX_FILES} ${UISrcs} ${QT_WRAP} Segmentor.qrc Segmentor.rc)
qt5_use_modules(Segmentor Core Gui)
add_executable(Segmentor MACOSX_BUNDLE ${CXX_FILES} ${UISrcs} ${QT_WRAP} ${UI_RESOURCES})
qt5_use_modules(Segmentor Core Gui Svg)
target_link_libraries(Segmentor ${VTK_LIBRARIES})
else()
QT4_WRAP_UI(UISrcs ${UI_FILES})
QT4_WRAP_CPP(MOCSrcs ${QT_WRAP})
add_executable(Segmentor MACOSX_BUNDLE ${CXX_FILES} ${UISrcs} ${MOCSrcs} Segmentor.qrc Segmentor.rc)
add_executable(Segmentor MACOSX_BUNDLE ${CXX_FILES} ${UISrcs} ${MOCSrcs} ${UI_RESOURCES})
target_link_libraries(Segmentor ${VTK_LIBRARIES})
endif()

Expand Down
5 changes: 2 additions & 3 deletions Segmentor.cxx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#include <QApplication>
#include <QSurfaceFormat>
#include "MainWindow.h"

#include "MainWindow.h"

int main(int argc, char** argv)
{
int main(int argc, char** argv) {
// Needed to ensure appropriate OpenGL context is created for VTK rendering.
QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

Expand Down

0 comments on commit 3fa7688

Please sign in to comment.