View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0013313 | CMake | CMake | public | 2012-06-18 09:31 | 2012-08-09 19:39 | ||||
Reporter | Eric Beuque | ||||||||
Assigned To | Alex Neundorf | ||||||||
Priority | high | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | Win32 | OS | Windows | OS Version | Windows 7 | ||||
Product Version | CMake 2.8.8 | ||||||||
Target Version | CMake 2.8.9 | Fixed in Version | CMake 2.8.9 | ||||||
Summary | 0013313: [Eclipse CDT] The MinGW include pathentry are not added to the .cproject | ||||||||
Description | I'm using a Windows 7 under Virtualbox from a Linux host. When building a simple project with cmake to generate an Eclipse project, the include path are not added to the .cproject. This has effect that all c++ standard headers are not found by eclipse, but the compilation success. A strange thing is that it works depending on the sources folder: - In a directory like C:\Users\Me\Devel\cmaketest: it doesn't work - In a directory like C:\Me\cmaketest: it doesn't work - In a directory like E:\Devel\cmaketest: it works The only difference I see is the filesystem type: - E: is a shared folder by VBox from the host which have a filesystem type Ext4 - C: is a standard NTFS partition | ||||||||
Steps To Reproduce | - Add to PATH the cmake and mingw bin path. - Unzip my archive - Run bootstrap.bat | ||||||||
Additional Information | I attach the two generated .cproject. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | cmaketest.zip [^] (90,019 bytes) 2012-06-18 09:31 bad.cproject [^] (22,209 bytes) 2012-06-18 09:33 good.cproject [^] (22,812 bytes) 2012-06-18 09:34 gcc-result-good.txt [^] (10,189 bytes) 2012-06-19 02:56 [Show Content] gcc-result-bad.txt [^] (10,456 bytes) 2012-06-19 02:57 [Show Content] CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake [^] (4,757 bytes) 2012-06-25 17:11 | ||||||||
Relationships | ||||||
|
Relationships |
Notes | |
(0029733) Alex Neundorf (developer) 2012-06-18 16:43 |
Please run the following command for your mingw C++ compiler and post the output here. Simply do "touch dummy.cpp" and then run the command: $ gcc -v -E -x c++ -dD dummy.cpp This is what is executed by cmake, and then cmake tries to extract the include dirs from there. Alex |
(0029738) Eric Beuque (reporter) 2012-06-19 03:00 edited on: 2012-06-19 05:58 |
OK this is maybe a locale issue, I don't know why, but i got a different output in a different locale depending on the directory, where i compile. The wrong output has a french locale and the good has an english locale. See result of the command gcc-result-good.txt and gcc-result-bad.txt. So this is probably a problem between the cmake parser and the french locale. |
(0029786) Alex Neundorf (developer) 2012-06-20 16:27 edited on: 2012-06-20 16:39 |
Oui :-) The cmake module which parses the output already tries to set it to default (C) by setting the LC_ALL, LC_MESSAGES and LANG environment variables to "C". Can you find out manually which environment variables have to be set to what to get plain english output ? Maybe also LANGUAGE ? Or LOCALE ? Maybe "C" doesn't work under Windows, but "en" does ? |
(0029793) Eric Beuque (reporter) 2012-06-21 03:07 |
Actually, SET LANG=C or "C" works fine. It also working if i try with LC_ALL, LC_MESSAGES of LANGUAGE variable, but not with LOCALE. I still don't understand why i got a different default locale on a different directory. ************************************************* C:\>gcc -v -E -x c++ -dD dummy.cpp gcc: erreur: dummy.cpp: No such file or directory gcc: attention : '-x c++' after last input file has no effect Utilisation des specs internes. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe Target: mingw32 Configuré avec: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Modèle de thread: win32 gcc version 4.6.2 (GCC) E:\>gcc -v -E -x c++ -dD dummy.cpp gcc: error: dummy.cpp: No such file or directory gcc: warning: '-x c++' after last input file has no effect Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-lib s --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.6.2 (GCC) ************************************************* C:\Users\ebeuque\Devel\testing.mingw32>gcc -v -E -x c++ -dD dummy.cpp gcc: erreur: dummy.cpp: No such file or directory gcc: attention : '-x c++' after last input file has no effect Utilisation des specs internes. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe Target: mingw32 Configuré avec: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Modèle de thread: win32 gcc version 4.6.2 (GCC) C:\Users\ebeuque\Devel\testing.mingw32>set LANG=C C:\Users\ebeuque\Devel\testing.mingw32>gcc -v -E -x c++ -dD dummy.cpp gcc: error: dummy.cpp: No such file or directory gcc: warning: '-x c++' after last input file has no effect Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-lib s --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.6.2 (GCC) C:\Users\ebeuque\Devel\testing.mingw32>set LANG=fr C:\Users\ebeuque\Devel\testing.mingw32>gcc -v -E -x c++ -dD dummy.cpp gcc: erreur: dummy.cpp: No such file or directory gcc: attention : '-x c++' after last input file has no effect Utilisation des specs internes. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe Target: mingw32 Configuré avec: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Modèle de thread: win32 gcc version 4.6.2 (GCC) C:\Users\ebeuque\Devel\testing.mingw32>set LANG=en C:\Users\ebeuque\Devel\testing.mingw32>gcc -v -E -x c++ -dD dummy.cpp gcc: error: dummy.cpp: No such file or directory gcc: warning: '-x c++' after last input file has no effect Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-lib s --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.6.2 (GCC) |
(0029805) Alex Neundorf (developer) 2012-06-21 16:06 |
This is with cmake 2.8.8, or are you using some older version ? The thing is, in the file Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake the LC_ALL, LC_MESSAGES and LANG environment variables are all set to "C". Have a look at this file, and maybe play around with it to figure out what's going wrong (I don't have a Windows around). |
(0029818) Eric Beuque (reporter) 2012-06-25 03:52 |
Yes, this cmake 2.8.8. I found the problem, in your Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake. The following code doesn't work: SET(_orig_lc_all $ENV{LC_ALL}) SET(_orig_lc_messages $ENV{LC_MESSAGES}) SET(_orig_lang $ENV{LANG}) IF(_orig_lc_all) SET(ENV{LC_ALL} C) ENDIF() IF(_orig_lc_messages) SET(ENV{LC_MESSAGES} C) ENDIF() IF(_orig_lang) SET(ENV{LANG} C) ENDIF() The fact is i have none of these environment variables defined on my system, so the if condition always fail, and the environment variable is never set. If define an environment variable for example LANG on my system, it works, my include are correctly set in the .cproject. Maybe you should define one of these if none is defined, and undef it when no more needed. |
(0029833) Alex Neundorf (developer) 2012-06-25 14:53 |
So it works if you set LANG to "C" ? |
(0029834) Alex Neundorf (developer) 2012-06-25 17:12 |
Can you please verify that the attached CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake makes it work for you ? We have to hurry a bit if we still want to have this in 2.8.9. Alex |
(0029835) Eric Beuque (reporter) 2012-06-26 03:22 |
Yes, your file works fine, i correctly retrieve my includes in the .cproject. Thank you. |
(0029850) Alex Neundorf (developer) 2012-06-27 17:43 |
I merged the fix in the EclipseFixIncludeDirDetectionMinGW branch into next, I hope it will still make it into 2.8.9. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2012-06-18 09:31 | Eric Beuque | New Issue | |
2012-06-18 09:31 | Eric Beuque | File Added: cmaketest.zip | |
2012-06-18 09:33 | Eric Beuque | File Added: bad.cproject | |
2012-06-18 09:34 | Eric Beuque | File Added: good.cproject | |
2012-06-18 16:38 | Alex Neundorf | Assigned To | => Alex Neundorf |
2012-06-18 16:38 | Alex Neundorf | Status | new => assigned |
2012-06-18 16:43 | Alex Neundorf | Note Added: 0029733 | |
2012-06-19 02:56 | Eric Beuque | File Added: gcc-result-good.txt | |
2012-06-19 02:57 | Eric Beuque | File Added: gcc-result-bad.txt | |
2012-06-19 03:00 | Eric Beuque | Note Added: 0029738 | |
2012-06-19 03:00 | Eric Beuque | Note Edited: 0029738 | |
2012-06-19 05:58 | Eric Beuque | Note Edited: 0029738 | |
2012-06-20 16:27 | Alex Neundorf | Note Added: 0029786 | |
2012-06-20 16:39 | Alex Neundorf | Note Edited: 0029786 | |
2012-06-21 03:07 | Eric Beuque | Note Added: 0029793 | |
2012-06-21 16:06 | Alex Neundorf | Note Added: 0029805 | |
2012-06-25 03:52 | Eric Beuque | Note Added: 0029818 | |
2012-06-25 14:53 | Alex Neundorf | Note Added: 0029833 | |
2012-06-25 17:11 | Alex Neundorf | File Added: CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake | |
2012-06-25 17:12 | Alex Neundorf | Note Added: 0029834 | |
2012-06-25 17:12 | Alex Neundorf | Relationship added | related to 0009122 |
2012-06-26 03:22 | Eric Beuque | Note Added: 0029835 | |
2012-06-27 17:43 | Alex Neundorf | Note Added: 0029850 | |
2012-06-27 17:43 | Alex Neundorf | Status | assigned => closed |
2012-06-27 17:43 | Alex Neundorf | Resolution | open => fixed |
2012-08-09 19:39 | David Cole | Fixed in Version | => CMake 2.8.9 |
2012-08-09 19:39 | David Cole | Target Version | => CMake 2.8.9 |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |