[cmake-developers] [CMake 0012155]: Header file list generated for CDT is missing one header

Mantis Bug Tracker mantis at public.kitware.com
Wed May 4 18:59:57 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12155 
====================================================================== 
Reported By:                saravanan
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12155
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-05-04 18:59 EDT
Last Modified:              2011-05-04 18:59 EDT
====================================================================== 
Summary:                    Header file list generated for CDT is missing one
header
Description: 
In the list of headers that GCC/ICC includes by default, CMake always leaves the
last header from being included in CMAKE_ECLIPSE_CXX_SYSTEM_INCLUDE_DIRS when
generating the Makefiles for Eclipse CDT4.

Steps to Reproduce: 
If the following CMakeLists.txt file
PROJECT(HELLO)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
IF("${CMAKE_EXTRA_GENERATOR}" MATCHES "Eclipse")
   MESSAGE(STATUS "Using CMake Version
${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
   IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)
      INCLUDE(${CMAKE_ROOT}/Modules/CMakeFindEclipseCDT4.cmake)
      MESSAGE(STATUS "${CMAKE_ECLIPSE_CXX_SYSTEM_INCLUDE_DIRS}")
   ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)
ENDIF("${CMAKE_EXTRA_GENERATOR}" MATCHES "Eclipse")

the output generated looks like

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CMake Version 2.8
--
/usr/include/c++/4.1.2;/usr/include/c++/4.1.2/x86_64-suse-linux;/usr/include/c++/4.1.2/backward;/usr/local/include;/usr/lib64/gcc/x86_64-suse-linux/4.1.2/include;/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/include
-- Configuring done
-- Generating done

However when the default includes are identified using "/usr/bin/g++ -v -E -x
c++ -dD ~/dummy.c", the (relevant section of the) output looks like:

#include <...> search starts here:
 /usr/include/c++/4.1.2
 /usr/include/c++/4.1.2/x86_64-suse-linux
 /usr/include/c++/4.1.2/backward
 /usr/local/include
 /usr/lib64/gcc/x86_64-suse-linux/4.1.2/include
 /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/include
 /usr/include
End of search list.

It can be seen that the last header "/usr/include" is missing from being
included in CMAKE_ECLIPSE_CXX_SYSTEM_INCLUDE_DIRS





Additional Information: 
In the file CMakeFindEclipseCDT4.cmake, if the regular expression in the
statement
IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of
(search) list" )

is changed to 
IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of
(search) list" )

then the last header should probably not get ignored
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-04 18:59 saravanan      New Issue                                    
======================================================================




More information about the cmake-developers mailing list