Skip to content

Commit

Permalink
Relax config search mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Dec 5, 2024
1 parent eab9f66 commit dca0378
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion parse-files/mrpt-xxx-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,26 @@ if(NOT "${CMAKE_CURRENT_LIST_DIR}/../" IN_LIST CMAKE_PREFIX_PATH)
endif()
cmake_policy(POP)

# Prefer config instead of the old FindXXX() files
set(_BCK_CMAKE_FIND_PACKAGE_PREFER_CONFIG ${CMAKE_FIND_PACKAGE_PREFER_CONFIG})
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)

# Search for dependencies first:
set(_deps "@ALL_DEPS_LIST@")
foreach(_dep ${_deps}) # NO quotes for the list to be a CMake list!
if (${_dep}_FOUND)
continue() # already found
endif()
find_dependency(${_dep} CONFIG) # Don't look for old FindXXX() files
find_dependency(${_dep})
if(${_dep}_FOUND)
mark_as_advanced(${_dep}_DIR)
endif()
endforeach()
@EXTRA_CONFIG_CMDS@

# Restore user's settings:
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ${_BCK_CMAKE_FIND_PACKAGE_PREFER_CONFIG})
unset(_BCK_CMAKE_FIND_PACKAGE_PREFER_CONFIG)

# Include targets for this library:
include(${CMAKE_CURRENT_LIST_DIR}/mrpt-@MRPT_MODULE_NAME@-targets.cmake)

0 comments on commit dca0378

Please # to comment.