I have a cmake project for a third-party library which targets both Windows and macOS (let's call it Foo
) which I hope to include with a cmake Find module. The library stashes its includes in ${CMAKE_SOURCE_DIR}/ThirdParty/include/Foo
, and I'm calling find_path
to define Foo_INCLUDE_DIR
as follows:
find_path(Foo_INCLUDE_DIR
NAMES "Foo/version.hpp"
PATHS "${CMAKE_SOURCE_DIR}/ThirdParty/include"
NO_DEFAULT_PATH
)
Now, the problem is that even though the project has the same exact dir tree on both macOS and Windows, the above call sets Foo_INCLUDE_DIR
as Foo_INCLUDE_DIR-NOTFOUND"
.
Does anyone have any idea why the above call to find_path
only works on Windows?