Notes |
|
(0029733)
|
Alex Neundorf
|
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
|
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
|
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
|
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
|
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
|
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
|
2012-06-25 14:53
|
|
So it works if you set LANG to "C" ? |
|
|
(0029834)
|
Alex Neundorf
|
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
|
2012-06-26 03:22
|
|
Yes, your file works fine, i correctly retrieve my includes in the .cproject.
Thank you. |
|
|
(0029850)
|
Alex Neundorf
|
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.
|
|