0
votes

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 ...

1
Create a new environment variable VTK_DIR with the value 'C:\VTK\8.0.0\build\msvc2017_64' - When set path variables for CMake, do not use backslash in them, use forward slash instead: C:/VTK/8.0.0/build/msvc2017_64.Tsyvarev
First of all, thanks, I did it, again the same error. please have a look at ibb.co/cZNr9k *** just a kind reminder, when building an individual itk or vtk project, it goes well, but in the case of itk+vtk, I got such an error...ir0098
File /ITK/4.12.0/build/msvc2017_64/lib/cmake/ITK-4.12/Modules/IT‌​KVtkGlue.cmake is not an error log. This is a normal file, but its content depends on your machine (more precise, it depends on installation of VTK).Tsyvarev
You were right, the problem was about the VTK address in the IKVtkGlue.cmake. In fact, the VTK_DIR was set to "C:\VTK\8.0.0\build\msvc2017_64". II changed to set(VTK_DIR "C:/VTK/8.0.0/build/msvc2017_64") and it works now. Thanks Tsyvarev for your guides.ir0098

1 Answers

1
votes

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...