You can use macros not exactly what you ask but still can help you to detect certain header file.
#if __has_include
https://en.cppreference.com/w/cpp/preprocessor/include (https://en.cppreference.com/w/cpp/preprocessor/include)
eg.:
#if __has_include("SFML/System/Vector2.hpp")
#include <SFML/System/Vector2.hpp>
#define has_sfVector 1
#else if
#define has_sfVector 0
#endif // __has_include("SFML/System/Vector2.hpp")