Skip to content

CMake find_library always called twice with and without NO_DEFAULT_PATH

In several find modules of dune, the commands find_library, find_path, and find_program are called twice:

  1. with option NO_DEFAULT_PATH that enabled all NO_* options, i.e., only search in HINTS and PATHS that are specified in the find_xxx commands.
  2. without the option NO_DEFAULT_PATH

This is a non-standard behaviour and essential means that the paths fixed in the commands are always preferred. Is there any reason for this, that I do not see? Or is it historical, because the behaviour in cmake changed?