Skip to content

Commit

Permalink
COMP 12945: Fix Qt5 specific build error related to vtkQtCxxTests
Browse files Browse the repository at this point in the history
While commit 384636e allows VTK libraries to be compiled against Qt5, an
error preventing the tests from being built on Unix platform has been
introduced while working on the different revision of the topic:

  ../TestQtDebugLeaksView.cxx:20:
  ../qglobal.h:1079:4: error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC or -fPIE."


This happened when it has been decided to use:
  VTK_QT_VERSION VERSION_GREATER "4"
instead of
  VTK_USE_QT5

At that time, the change has been tested doing a clean build on
windows where the error wouldn't happen.

This commit ensures VTK libraries, tests and examples can be built against
Qt5.

Finally, note that some of examples have been commented out while
modularizing VTK. This commit and commit 384636e are not addressing build
issue that would occur if re-enabling the missing examples.

Change-Id: Id72588d9f2d9cd9f45b2fe6a07f59513df9fd4c5
  • Loading branch information
jcfr committed Jun 5, 2013
1 parent 384636e commit e4e3dfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GUISupport/Qt/Testing/Cxx/CMakeLists.txt
Expand Up @@ -17,7 +17,7 @@ endif()

vtk_test_cxx_executable(${vtk-module}CxxTests QTestApp.cxx)

if(VTK_USE_QT5)
if(VTK_QT_VERSION VERSION_GREATER "4")
set_target_properties(${vtk-module}CxxTests PROPERTIES
COMPILE_FLAGS ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS})
endif()

0 comments on commit e4e3dfa

Please sign in to comment.