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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions PCLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ macro(find_boost)
elseif(NOT BOOST_INCLUDEDIR)
set(BOOST_INCLUDEDIR "@Boost_INCLUDE_DIR@")
endif()

set(Boost_ADDITIONAL_VERSIONS
"@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@.@Boost_SUBMINOR_VERSION@" "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@"
"1.78.0" "1.78" "1.77.0" "1.77" "1.76.0" "1.76" "1.75.0" "1.75"
"1.78.0" "1.78" "1.77.0" "1.77" "1.76.0" "1.76" "1.75.0" "1.75"
"1.74.0" "1.74" "1.73.0" "1.73" "1.72.0" "1.72" "1.71.0" "1.71" "1.70.0" "1.70"
"1.69.0" "1.69" "1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65")

find_package(Boost 1.65.0 ${QUIET_} COMPONENTS @PCLCONFIG_AVAILABLE_BOOST_MODULES@)

set(BOOST_FOUND ${Boost_FOUND})
Expand Down Expand Up @@ -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.

endif()
if(NOT ANDROID)
find_package(VTK ${QUIET_} COMPONENTS ${PCL_VTK_COMPONENTS})
Expand Down Expand Up @@ -305,13 +305,13 @@ macro(find_external_library _component _lib _is_optional)
string(REGEX REPLACE "[.-]" "_" LIB ${LIB})
if(${LIB}_FOUND)
list(APPEND PCL_${COMPONENT}_INCLUDE_DIRS ${${LIB}_INCLUDE_DIRS})

if(${LIB} MATCHES "VTK")
if(${${LIB}_VERSION_MAJOR} GREATER_EQUAL 9)
set(ISVTK9ORGREATER TRUE)
endif()
endif()

if(${LIB}_USE_FILE AND NOT ISVTK9ORGREATER )
include(${${LIB}_USE_FILE})
else()
Expand Down