ir0098
ir0098

Reputation: 149

CMake error: ItkVtkGlue

I built VTK-8.0.0 (using msvc2017_64) and ITK-4.12.0 (using msvc2017_64). During the ITK-build as below:


1) building VTK (CMake3.9.0)

2) building ITK (CMake3.9.0): Module_ITKVtkGlue + VTK_DIR this path C:\VTK\8.0.0\build\msvc2017_64

3) Compiling VTK using msvc2017 (in Release mode)

4) Create a new environment variable VTK_DIR with the value C:\VTK\8.0.0\build\msvc2017_64

5) Add to the path: %VTK_DIR%\bin\Release

6) Compiling ITK using msvc2017 (in Release mode)

7) Creating a new environment variable ITK_DIR with the value C:\ITK\4.12.0\build\msvc2017_64

8) Add to the path: %ITK_DIR%\bin\Release


And now, I only want to build and compile a very simple project from the link below: https://itk.org/Wiki/ITK/Examples/IO/ImageToVTKImageFilter

however, I can't configure the project getting the error below in CMake:

***************************************************************

CMake Error at C:/ITK/4.12.0/build/msvc2017_64/lib/cmake/ITK-4.12/Modules/ITKVtkGlue.cmake:14 (set):
  Syntax error in cmake code at

    C:/ITK/4.12.0/build/msvc2017_64/lib/cmake/ITK-4.12/Modules/ITKVtkGlue.cmake:14

  when parsing string

    C:\VTK\8.0.0\build\msvc2017_64

  Invalid escape sequence \V
Call Stack (most recent call first):
  C:/ITK/4.12.0/src/CMake/ITKModuleAPI.cmake:54 (include)
  C:/ITK/4.12.0/src/CMake/ITKModuleAPI.cmake:26 (itk_module_load)
  C:/ITK/4.12.0/src/CMake/ITKModuleAPI.cmake:84 (_itk_module_config_recurse)
  C:/ITK/4.12.0/build/msvc2017_64/ITKConfig.cmake:74 (itk_module_config)
  CMakeLists.txt:6 (find_package)


Configuring incomplete, errors occurred!
See also "C:/new_dev/tests/ImageToVTKImageFilter/build/CMakeFiles/CMakeOutput.log".
***************************************************************

To solve this problem, at first, I tried to add an Entry with ItkVtkGlue path but the same error was achieved. Then, I created ItkVtkGlue.lib individually and added added a new environment variable ItkVtkGlue_DIR with the value C:\ItkVtkGlue\build\Release and also added to the path and again creating an Entry for ItkVtkGlue, but I got the same error.

I would appreciate any help... Deeply looking forward to your advice ...

Upvotes: 0

Views: 562

Answers (1)

ir0098
ir0098

Reputation: 149

The issue went back to the VTK_DIR which was defined by "\". First, I tried to replace all "\" in my environment variable VTK_DIR with "/" but it resulted in the same error. Then I defined VTK_DIR as an Entry in CMake and a path with "/" was dedicated, again the same error. In fact the problem was due to the ITKVtkGlue.cmake. The VTK_DIR was set by "\" and I manually replaced them by "/", and now ITK+VTK goes well...

Upvotes: 1

Related Questions