Morse Mo
Morse Mo

Reputation: 21

VTK configuration issue on Mac with Cmake

Error in Cmake configuration for VTK

I am a beginner building the lib environment for ITK/VTK/QT for medical imaging analysis. The problem comes in when try to install VTK.

  1. On my OSX 10.14.5, I already installed QT5 with brew install.
  2. make install the ITK lib successful and tested it without VTK.
  3. In the Cmake interface, I configure the correct qt5 path for vtk and start the configuration. But there is error happened after a while. Part of the error information showed as following.

I am not sure this error is linked to qt or other dependency? Is it the problem of the OpenGL2 or others?

I would be very appreciated if you could help me through this issue.

Group Qt modules:
vtkGUISupportQt;vtkGUISupportQtSQL;vtkRenderingQt;vtkViewsQt
Group Rendering modules:
vtkGeovisCore;vtkIOExport;vtkIOExportPDF;vtkInteractionImage;vtkInteractionStyle;vtkInteractionWidgets;vtkRenderingAnnotation;vtkRenderingContext2D;vtkRenderingCore;vtkRenderingFreeType;vtkRenderingImage;vtkRenderingLOD;vtkRenderingLabel;vtkRenderingVolume;vtkViewsContext2D;vtkViewsCore;vtkViewsInfovis Group Tk modules: vtkRenderingTk Group Views modules: vtkViewsContext2D;vtkViewsGeovis Group Web modules: vtkWebCore;vtkWebPython;vtkWebGLExporter Backend OpenGL2 modules: vtkDomainsChemistryOpenGL2;vtkIOExportOpenGL2;vtkImagingOpenGL2;vtkRenderingContextOpenGL2;vtkRenderingGL2PSOpenGL2;vtkRenderingLICOpenGL2;vtkRenderingOpenGL2;vtkRenderingOpenVR;vtkRenderingVolumeOpenGL2

Enabling modules for OpenGL2.
CMake Error at CMakeLists.txt:156 (export):
  export EXPORT or TARGETS specifier missing.

Configuring incomplete, errors occurred!
See also "/Users/morse/VTK-8.2.0/build/CMakeFiles/CMakeOutput.log".
See also "/Users/morse/VTK-8.2.0/build/CMakeFiles/CMakeError.log".

Upvotes: 2

Views: 2865

Answers (1)

Allorong
Allorong

Reputation: 11

Try this!

Open CMakeList.txt and modify as following, Cut and paste lines from 156~157 to 154~155. Final code like this :

# Add a virtual target that can be used to build all compile tools.
add_custom_target(vtkCompileTools)
if (_vtk_compiletools_targets)
  list(REMOVE_DUPLICATES _vtk_compiletools_targets)
  export(TARGETS ${_vtk_compiletools_targets}
    FILE ${VTK_BINARY_DIR}/VTKCompileToolsConfig.cmake)
  add_dependencies(vtkCompileTools ${_vtk_compiletools_targets})
endif()

unset(_vtk_targets)
unset(_vtk_compiletools_targets)
unset(_vtk_all_targets)

Good luck~!

Upvotes: 1

Related Questions