mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Clear XXX_FOUND in Find<XXX>.cmake prior to searching.
- This protects against a client project which invokes find_package(Ceres) after having called find_package(Foo) with their own version of FindFoo.cmake which conflicts with Ceres’ exported version and defines FOO_FOUND, but not the other variables Ceres’ FindFoo.cmake is expecting which can break the detection logic. Change-Id: I9fe7bfa8a34bb58b09ffe34446da973912cf5587
This commit is contained in:
@@ -103,6 +103,12 @@ macro(CXSPARSE_REPORT_NOT_FOUND REASON_MSG)
|
||||
return()
|
||||
endmacro(CXSPARSE_REPORT_NOT_FOUND)
|
||||
|
||||
# Protect against any alternative find_package scripts for this library having
|
||||
# been called previously (in a client project) which set CXSPARSE_FOUND, but not
|
||||
# the other variables we require / set here which could cause the search logic
|
||||
# here to fail.
|
||||
unset(CXSPARSE_FOUND)
|
||||
|
||||
# Handle possible presence of lib prefix for libraries on MSVC, see
|
||||
# also CXSPARSE_RESET_FIND_LIBRARY_PREFIX().
|
||||
if (MSVC)
|
||||
|
||||
@@ -83,6 +83,12 @@ macro(EIGEN_REPORT_NOT_FOUND REASON_MSG)
|
||||
return()
|
||||
endmacro(EIGEN_REPORT_NOT_FOUND)
|
||||
|
||||
# Protect against any alternative find_package scripts for this library having
|
||||
# been called previously (in a client project) which set EIGEN_FOUND, but not
|
||||
# the other variables we require / set here which could cause the search logic
|
||||
# here to fail.
|
||||
unset(EIGEN_FOUND)
|
||||
|
||||
# Search user-installed locations first, so that we prefer user installs
|
||||
# to system installs where both exist.
|
||||
#
|
||||
|
||||
@@ -271,6 +271,12 @@ function(GFLAGS_CHECK_GFLAGS_NAMESPACE_USING_REGEX)
|
||||
endif()
|
||||
endfunction(GFLAGS_CHECK_GFLAGS_NAMESPACE_USING_REGEX)
|
||||
|
||||
# Protect against any alternative find_package scripts for this library having
|
||||
# been called previously (in a client project) which set GFLAGS_FOUND, but not
|
||||
# the other variables we require / set here which could cause the search logic
|
||||
# here to fail.
|
||||
unset(GFLAGS_FOUND)
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# By default, if the user has expressed no preference for using an exported
|
||||
# gflags CMake configuration over performing a search for the installed
|
||||
|
||||
@@ -109,6 +109,12 @@ macro(GLOG_REPORT_NOT_FOUND REASON_MSG)
|
||||
return()
|
||||
endmacro(GLOG_REPORT_NOT_FOUND)
|
||||
|
||||
# Protect against any alternative find_package scripts for this library having
|
||||
# been called previously (in a client project) which set GLOG_FOUND, but not
|
||||
# the other variables we require / set here which could cause the search logic
|
||||
# here to fail.
|
||||
unset(GLOG_FOUND)
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# By default, if the user has expressed no preference for using an exported
|
||||
# glog CMake configuration over performing a search for the installed
|
||||
|
||||
@@ -152,6 +152,12 @@ macro(SUITESPARSE_REPORT_NOT_FOUND REASON_MSG)
|
||||
# the first.
|
||||
endmacro(SUITESPARSE_REPORT_NOT_FOUND)
|
||||
|
||||
# Protect against any alternative find_package scripts for this library having
|
||||
# been called previously (in a client project) which set SUITESPARSE_FOUND, but
|
||||
# not the other variables we require / set here which could cause the search
|
||||
# logic here to fail.
|
||||
unset(SUITESPARSE_FOUND)
|
||||
|
||||
# Handle possible presence of lib prefix for libraries on MSVC, see
|
||||
# also SUITESPARSE_RESET_FIND_LIBRARY_PREFIX().
|
||||
if (MSVC)
|
||||
|
||||
Reference in New Issue
Block a user