The following issue has been SUBMITTED. ====================================================================== https://cmake.org/Bug/view.php?id=16092 ====================================================================== Reported By: Antonio Assigned To: ====================================================================== Project: CMake Issue ID: 16092 Category: CMake Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2016-05-03 05:10 EDT Last Modified: 2016-05-03 05:10 EDT ====================================================================== Summary: Module CheckIncludeFile should notify in case of compiler flag errors Description: (Problem was first mentioned in mailing list 2 weeks ago, although there was no feedback)
CheckIncludeFile will return "header not found" if some wrong compiler flags is set (not accepted by the compiler). I noticed the problem when having a "check include" failure even if I was certain the include file should be found in the include paths I had set. When I hacked into: CheckIncludeFile.cmake this line: message(STATUS "OUTPUT=${OUTPUT}") it turned out the problem was not in including file, but in the flags that were passed to the compiler, causing a failure that the module interprets as "the header could not be found". I think an error message should be printed instead in this case. This could be handled in 2 ways: a) Either checking first of all if, with the given flags, the compiler will succeed in compiling a source file containing JUST an empty main function. For efficiency, this check might even be done AFTER the first try_compile fails. b) Or, in case of failure, checking that the error returned is JUST the cannot find error message. Option a) seems to have the advantage of being extremely easy to implement, although might introduce some overhead. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2016-05-03 05:10 Antonio New Issue ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers