`try_compile` ignores `INCLUDE_DIRECTORIES` in the `CHECK_INCLUDE_FILE` from the `TEST_BIG_ENDIAN`
platform: windows 7
cmake: 3.14.5-rc4
compiler: Visual Studio 2015 Update 3
I am trying to build a library which basically build for the Linux. In the Windows the cmake produces this error:
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - not found
-- Looking for stdint.h
-- Looking for stdint.h - not found
-- Looking for stddef.h
-- Looking for stddef.h - not found
-- Check size of unsigned short
-- Check size of unsigned short - failed
-- Check size of unsigned int
-- Check size of unsigned int - failed
-- Check size of unsigned long
-- Check size of unsigned long - failed
CMake Error at .../CMake/share/cmake-3.14/Modules/TestBigEndian.cmake:50 (message):
no suitable type found
I have tried to dig in and found that the function try_compile
just ignores the value CHECK_INCLUDE_FILE_C_INCLUDE_DIRS
in file CheckIncludeFile.cmake
at line 101.
In the Windows I have to use the CMAKE_REQUIRED_INCLUDES
to address the Visual Studio include directories to find related include files:
cmake .. -G "Visual Studio 14 2015" "-DCMAKE_REQUIRED_INCLUDES=.../Visual Studio 14.0/VC/INCLUDE;..."
But this does not work.
Edited by Andrey