Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake failed if I have installed the different version VTK #4926

Open
Abo-go opened this issue Aug 31, 2021 · 0 comments · May be fixed by #5223
Open

CMake failed if I have installed the different version VTK #4926

Abo-go opened this issue Aug 31, 2021 · 0 comments · May be fixed by #5223
Labels
kind: compile error Type of issue status: triage Labels incomplete

Comments

@Abo-go
Copy link

Abo-go commented Aug 31, 2021

Describe the error

CMake failed if I have installed the different version VTK.

To Reproduce

I have installed VTK-9.0 already, then I installed pcl-1.11.1(VTK-8.2). It was failed in CMake when I want to link pcl into my project. I looked into this and find pcl can't overwrite VTK_DIR which has already set.

Screenshots/Code snippets/Build information

PCLConfig.cmake:

macro(find_VTK)
  message(STATUS ${PCL_ALL_IN_ONE_INSTALLER})
  message(STATUS "Before Set${VTK_DIR}")
  if(PCL_ALL_IN_ONE_INSTALLER AND NOT ANDROID)
    if(EXISTS "${PCL_ROOT}/3rdParty/VTK/lib/cmake")
      set(VTK_DIR "${PCL_ROOT}/3rdParty/VTK/lib/cmake/vtk-8.2" CACHE PATH "The directory containing VTKConfig.cmake")
	  message(STATUS "${PCL_ROOT}/3rdParty/VTK/lib/cmake/vtk-8.2")
	  message(STATUS "After Set${VTK_DIR}")
    else()
      set(VTK_DIR "${PCL_ROOT}/3rdParty/VTK/lib/vtk-8.2" CACHE PATH "The directory containing VTKConfig.cmake")
    endif()
  elseif(NOT VTK_DIR AND NOT ANDROID)
    set(VTK_DIR "C:/Program Files/VTK/lib/cmake/vtk-8.2" CACHE PATH "The directory containing VTKConfig.cmake")
  endif()

Print by CMake which the path didn't set success

ON
Before SetC:/Program Files/VTK/lib/cmake/vtk-9.0
D:/Program Files/PCL 1.11.1/3rdParty/VTK/lib/cmake/vtk-8.2
After SetC:/Program Files/VTK/lib/cmake/vtk-9.0

If I add FORCE behind

set(VTK_DIR "${PCL_ROOT}/3rdParty/VTK/lib/cmake/vtk-8.2" CACHE PATH "The directory containing VTKConfig.cmake" FORCE)

Path set success.

ON
Before SetC:/Program Files/VTK/lib/cmake/vtk-9.0
D:/Program Files/PCL 1.11.1/3rdParty/VTK/lib/cmake/vtk-8.2
After SetD:/Program Files/PCL 1.11.1/3rdParty/VTK/lib/cmake/vtk-8.2

Your Environment (please complete the following information):

  • OS: Win10
  • Compiler: Visual Studio 2019 X64
  • PCL Version 1.11.1
  • PCL Type:Installed
@Abo-go Abo-go added kind: compile error Type of issue status: triage Labels incomplete labels Aug 31, 2021
@fmigneault fmigneault linked a pull request Apr 12, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: compile error Type of issue status: triage Labels incomplete
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant