[Cmake] Searching for the header files

Bill Hoffman bill . hoffman at kitware . com
Thu, 19 Jun 2003 07:55:33 -0400


Yes, there is.
Modules/CheckIncludeFileCXX.cmake
Modules/CheckIncludeFile.cmake


Those files define macros that use try-compile with the compiler
to test for the existence of header files.

For example:

INCLUDE(${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake)
CHECK_INCLUDE_FILE_CXX("sstream" CMAKE_HAS_ANSI_STRING_STREAM)

BTW, there are some STL and STD tests in the modules directory,
like these:

INCLUDE(${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake)


-Bill

At 02:52 AM 6/19/2003, David Svoboda wrote:
>Does exist something like AC_CHECK_HEADER (from autoconf)? I'd like to
>search for some header files. I know there is a command FIND_FILE, but it
>doesn't searches all the include paths in my computer. And setting the
>absolute path for FIND_FILE command is quite cumbersome, because e.g. STD
>and STL files are stored at different places at different platforms.
>
>-David
>
>_______________________________________________
>Cmake mailing list
>Cmake at public . kitware . com
>http://public . kitware . com/mailman/listinfo/cmake