check_include_file: cannot find headers in /usr/include?
Hello, I don't understand how to use check_include_file correctly. For example, I have C project with:
cmake_minimum_required(VERSION 3.14)
project(example LANGUAGES C)
include(CheckIncludeFile)
check_include_file("fcntl.h" HAVE_FCNTL_H)
Configuration said me:
-- Looking for fcntl.h
-- Looking for fcntl.h - not found
But
ls /usr/include/ | grep 'fcntl.h'
fcntl.h
File exists but cmake could not find it, I also tried set(CMAKE_REQUIRED_INCLUDES /usr/include)
but it did not help. What I do wrong? Thanks