MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0014654 | CMake | CMake | public | 2013-12-16 14:28 | 2014-04-01 03:58 |
|
Reporter | jschueller | |
Assigned To | | |
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | won't fix | |
Platform | GNU/Linux | OS | archlinux | OS Version | x86_64 |
Product Version | CMake 2.8.12.1 | |
Target Version | | Fixed in Version | | |
|
Summary | 0014654: mingw -isystem flag c header float.h conflict |
Description | When including the UseQt4 module combined with cross-compiling with mingw64,
cmake uses these includes (read in the .rsp file):
-isystem /usr/i686-w64-mingw32/include -isystem /usr/i686-w64-mingw32/include/QtGui -isystem /usr/i686-w64-mingw32/include/QtCore
... which prevent from using defines like DBL_EPSILON in float.h:
/usr/bin/i686-w64-mingw32-g++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG @CMakeFiles/main.dir/includes_CXX.rsp -o CMakeFiles/main.dir/main.cxx.obj -c .../main.cxx
...
error: ‘DBL_EPSILON’ was not declared in this scope
If I remove the -isystem flag, it builds fine.
The -isytem seems to come from
/usr/share/cmake-2.8/Modules/Compiler/GNU.cmake:55: set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
|
Steps To Reproduce | The minimal cmakelist using useqt4:
cmake_minimum_required ( VERSION 2.8 )
project ( mingw-test CXX )
find_package ( Qt4 REQUIRED QtCore)
include ( ${QT_USE_FILE} )
add_executable(main main.cxx)
Define a main.cxx:
#include <iostream>
#include "float.h"
int main( int argc, char **argv )
{
std::cout <<DBL_EPSILON<<std::endl;
return 0;
}
Also non-working from c:
#include <stdio.h>
#include <float.h>
int main() {
printf("%g", FLT_EPSILON);
return 0;
}
|
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2013-12-16 14:28 | jschueller | New Issue | |
2013-12-18 11:32 | Brad King | Assigned To | => Stephen Kelly |
2013-12-18 11:32 | Brad King | Status | new => assigned |
2013-12-18 13:44 | jschueller | Note Added: 0034796 | |
2013-12-18 18:56 | Stephen Kelly | Note Added: 0034814 | |
2013-12-18 18:56 | Stephen Kelly | Assigned To | Stephen Kelly => |
2013-12-18 18:56 | Stephen Kelly | Status | assigned => new |
2013-12-18 18:56 | Stephen Kelly | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=1339#r1339 |
2013-12-19 09:50 | Brad King | Note Added: 0034816 | |
2013-12-19 10:47 | Stephen Kelly | Note Added: 0034823 | |
2013-12-19 14:07 | Brad King | Note Added: 0034827 | |
2013-12-20 01:18 | jschueller | Note Added: 0034833 | |
2014-04-01 03:58 | jschueller | Note Added: 0035594 | |
2014-04-01 03:58 | jschueller | Status | new => closed |
2014-04-01 03:58 | jschueller | Resolution | open => won't fix |
Notes |
|
(0034796)
|
jschueller
|
2013-12-18 13:44
|
|
Here are some more infos:
the isystem flag seem to come Compiler/GNU.cmake,
it must not be qt specific
The configure output:
-- The CXX compiler identification is GNU 4.8.2
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/i686-w64-mingw32/bin/qmake (found version "4.8.5")
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_INSTALL_LIBDIR
INCLUDE_INSTALL_DIR
LIB_INSTALL_DIR
SHARE_INSTALL_DIR
SYSCONF_INSTALL_DIR
-- Build files have been written to: ..../pkgtest/build
The toochain file:
SET(CMAKE_SYSTEM_NAME Windows)
# specify the cross compiler
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# Make sure Qt can be detected by CMake
SET(QT_BINARY_DIR /usr/i686-w64-mingw32/bin /usr/bin)
# set the resource compiler (RHBZ #652435)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
# override boost library suffix which defaults to -mgw
SET(Boost_COMPILER -gcc47)
# These are needed for compiling lapack (RHBZ #753906)
SET(CMAKE_Fortran_COMPILER i686-w64-mingw32-gfortran)
SET(CMAKE_AR:FILEPATH i686-w64-mingw32-ar)
SET(CMAKE_RANLIB:FILEPATH i686-w64-mingw32-ranlib) |
|
|
(0034814)
|
Stephen Kelly
|
2013-12-18 18:56
|
|
Doesn't seem to be related to what I work on. |
|
|
(0034816)
|
Brad King
|
2013-12-19 09:50
|
|
The GNU.cmake entry is just a mapping that tells CMake what flag to use for system include paths with the GNU compiler. The -isystem flag is used because something in the Qt4 infrastructure tells CMake that the include path is a system include path. |
|
|
(0034823)
|
Stephen Kelly
|
2013-12-19 10:47
|
|
I can point to commit 691ac05d4049619407b6ff0b89207c5c77e21ae0 but don't know anythnig about this bug report beyond that. |
|
|
(0034827)
|
Brad King
|
2013-12-19 14:07
|
|
|
|
(0034833)
|
jschueller
|
2013-12-20 01:18
|
|
Ok, if I set -DQT_INCLUDE_DIRS_NO_SYSTEM=ON, it works fine.
QT_INCLUDE_DIRS_NO_SYSTEM is not set anywhere:
$ grep -nr QT_INCLUDE_DIRS_NO_SYSTEM /usr/share/cmake-2.8/
/usr/share/cmake-2.8/Modules/UseQt4.cmake:28:if(QT_INCLUDE_DIRS_NO_SYSTEM)
/usr/share/cmake-2.8/Modules/UseQt4.cmake:30:else(QT_INCLUDE_DIRS_NO_SYSTEM)
/usr/share/cmake-2.8/Modules/UseQt4.cmake:32:endif(QT_INCLUDE_DIRS_NO_SYSTEM)
/usr/share/cmake-2.8/Modules/UseQt4.cmake:96: if(QT_INCLUDE_DIRS_NO_SYSTEM)
/usr/share/cmake-2.8/Modules/UseQt4.cmake:98: else(QT_INCLUDE_DIRS_NO_SYSTEM)
/usr/share/cmake-2.8/Modules/UseQt4.cmake:100: endif(QT_INCLUDE_DIRS_NO_SYSTEM)
/usr/share/cmake-2.8/Modules/FindQt4.cmake:74:# QT_INCLUDE_DIRS_NO_SYSTEM |
|
|
(0035594)
|
jschueller
|
2014-04-01 03:58
|
|
SET(QT_INCLUDE_DIRS_NO_SYSTEM ON) fixed this |
|