[CMake] Add SKIP_FIND_PACKAGE argument to Octopus_FindPackage
Description
Currently Libxc in Debian is incorrectly packaged and is lacking the Fortran target descriptor files. Octopus, by default, tries a native find_package()
call before attempting to find the packages through pkgconfig
and, finally (in the case of Libxc) building from source. Since the problem is with the CMake files themselves, this causes configuration to break (as opposed to when a package is simply not found and configuration proceeds normally). This change works around this issue in two steps
1 - An optional parameter is added to Octopus_findPackage
which, if present, causes it to skip calling find_package
entirely
2 - In cmake/FindLibxc.cmake
, a test is made to detect this broken packaging. If CMake finds the main configuration file but not the Fortran specific target descriptors, the flag is then passed to the call, making it skip the problematic step
In a Debian system with the broken package installed, this will cause it to be found through pkgConfig instead
News snippet
[CMake] Ignore broken Libxc Cmake Package files on Debian systems