Skip to content

Commit dca0378

Browse files
committed
Relax config search mode
1 parent eab9f66 commit dca0378

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

parse-files/mrpt-xxx-config.cmake.in

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,26 @@ if(NOT "${CMAKE_CURRENT_LIST_DIR}/../" IN_LIST CMAKE_PREFIX_PATH)
3434
endif()
3535
cmake_policy(POP)
3636

37+
# Prefer config instead of the old FindXXX() files
38+
set(_BCK_CMAKE_FIND_PACKAGE_PREFER_CONFIG ${CMAKE_FIND_PACKAGE_PREFER_CONFIG})
39+
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
40+
3741
# Search for dependencies first:
3842
set(_deps "@ALL_DEPS_LIST@")
3943
foreach(_dep ${_deps}) # NO quotes for the list to be a CMake list!
4044
if (${_dep}_FOUND)
4145
continue() # already found
4246
endif()
43-
find_dependency(${_dep} CONFIG) # Don't look for old FindXXX() files
47+
find_dependency(${_dep})
4448
if(${_dep}_FOUND)
4549
mark_as_advanced(${_dep}_DIR)
4650
endif()
4751
endforeach()
4852
@EXTRA_CONFIG_CMDS@
4953

54+
# Restore user's settings:
55+
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ${_BCK_CMAKE_FIND_PACKAGE_PREFER_CONFIG})
56+
unset(_BCK_CMAKE_FIND_PACKAGE_PREFER_CONFIG)
57+
5058
# Include targets for this library:
5159
include(${CMAKE_CURRENT_LIST_DIR}/mrpt-@[email protected])

0 commit comments

Comments
 (0)