CMake does not find headers installed in /usr/local/include by default. On
FreeBSD this is the default location for libunwind.h though. Define
CMAKE_REQUIERED_INCLUDE to include both /usr/local/include and /usr/include.
This change only affects FreeBSD. Also FreeBSD (like Darwin) does not work with
_DEFAULT_SOURCE or _POSIX_C_SOURCE defined. Closes #547
include(CheckStructHasMember)
include(CheckTypeSize)
-if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
+if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+ set(CMAKE_REQUIRED_INCLUDES "/usr/local/include" "/usr/include")
+elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(CMAKE_REQUIRED_DEFINITIONS "-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L")
endif()
check_include_files(ieeefp.h HAVE_IEEEFP_H)