How do I make cmake ignore a directory when doing find_path? I'm trying to find the system's freetype2 library, but instead it is finding the one that inside my project. How do I get it to ignore that?
Here's what my FindFreeTypeTwo.cmake looks like
FIND_PATH(_FREETYPE2_INCLUDE_DIR ft2build.h PATH_SUFFIXES freetype2)
FIND_LIBRARY(_FREETYPE2_LIBRARIES NAMES freetype)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype2 DEFAULT_MSG _FREETYPE2_LIBRARIES _FREETYPE2_INCLUDE_DIR)
if (FREETYPE2_FOUND)
set (FREETYPE2_INCLUDE_DIR ${_FREETYPE2_INCLUDE_DIR})
set (FREETYPE2_LIBRARIES ${_FREETYPE2_LIBRARIES})
endif (FREETYPE2_FOUND)
This is what my file structure looks like.
\
\ src
| CMakeLists.tst
\ build
\ cmake_config
\ find_packages
| FindFreeTypeTwo.cmake
\ (folder to exclude)
\ (other folders)