Exporting packages with a custom Find module

I would do something like this:

set(_mypackage_module_path_save "${CMAKE_MODULE_PATH}")
list(CMAKE_MODULE_PATH INSERT 0 "${CMAKE_CURRENT_LIST_DIR}/find_modules")

# Find modules

set(CMAKE_MODULE_PATH "${_mypackage_module_path_save}")
unset(_mypackage_module_path_save)
2 Likes