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

force setting cmake predefind VTK dir #5223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fmigneault
Copy link

I encountered error #4926 when trying to link PCL with another library when it was compiled using a self-provided VTK (same as in issue).

I found 2 workarounds.
First, being to NOT provide VTK_DIR to cmake (or remove from cache if already there even if empty) and leaving PCL set it.
The second is to FORCE setting the value, basically ignoring what was provided by the user.

Since the displayed error happens when VTK_DIR is specified, it is safe to assume it is already too late for case 1.

fixes #4926

@@ -239,7 +239,7 @@ macro(find_VTK)
set(VTK_DIR "${PCL_ROOT}/3rdParty/VTK/lib/vtk-@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@" CACHE PATH "The directory containing VTKConfig.cmake")
endif()
elseif(NOT VTK_DIR AND NOT ANDROID)
set(VTK_DIR "@VTK_DIR@" CACHE PATH "The directory containing VTKConfig.cmake")
set(VTK_DIR "@VTK_DIR@" CACHE PATH "The directory containing VTKConfig.cmake" FORCE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late replay, but you sure its here you want the Force?
This is where VTK_DIR is not set to any value, I guess it should be able to update it?
The issue you link to, uses the All-In-One installer, which are line 237 and 239 - which probably make sense, since the All-in-one installer is build with that specific version.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so.
The intention to add it in this file is that it would end up generating the PCLConfig.cmake mentioned in #4926
With FORCE, it allows the user to override the cache even if a value was already defined for VTK_DIR, which it does because it was added by the installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMake failed if I have installed the different version VTK
3 participants