[glideplan_swproj] Re: CMake

  • From: Kuba Marek <blue.cube@xxxxxxxxx>
  • To: glideplan_swproj@xxxxxxxxxxxxx
  • Date: Sun, 1 Jan 2012 22:46:02 +0100

Yeah, it runs for me. Although it's really sluggish and the map doesn't
show most of the time.
I had to add two ifdefs, to scenemanager.cpp to make it run, but it
doesn't sound like using them on windouws would help you at all (but
still please try them if it compiles on windows with the linux part
enabled)

And one last thing to the warnings problem:
It seems that msvc doesn't have an equivalent of gcc's -isystem flag.
We should make header files that disable and enable warnings (both
compilers have pragmas for that) and wrap qt includes in those.
http://stackoverflow.com/questions/1741816/isystem-for-ms-visual-studio-c-compiler
http://stackoverflow.com/questions/3205923/is-there-any-way-i-can-make-g-only-emit-warnings-pertaining-to-my-files
I'll take a look at it later.

K

> The warnings came from Qt or Windows header files included in our
> cpps. I thought that they occur only when moc files are built, but
> they also occur in our files (it has nothing to do with moc files)
> Example of warnings:
> 4>c:\qtsdk\desktop\qt\4.7.4\msvc2008\include\qtgui\qformlayout.h(157) :
> 4>warning C4626: 'QFormLayout' : assignment operator could not be
> 4>generated because a base class assignment operator is inaccessible
> 3>C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\include\QtGui/qstyleoption.h(744) :
> 3>warning C4820: 'QStyleOptionSpinBox' : '3' bytes padding added
> 3>after data member 'QStyleOptionSpinBox::frame'
> 6>C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\include\QtGui/qtextoption.h(152) :
> 6>warning C4365: '=' : conversion from 'int' to 'uint',
> 6>signed/unsigned mismatch
> 6>C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\include\QtGui/qtextoption.h(97) :
> 6>warning C4365: 'argument' : conversion from 'const uint' to 'int',
> 6>signed/unsigned mismatch
> 4>C:\Program Files (x86)\Microsoft Visual Studio
> 4>9.0\VC\include\wchar.h(539) : warning C4820: '_stat64i32' : '2'
> 4>bytes padding added after data member '_stat64i32::st_gid'
> 3>C:\Program Files (x86)\Microsoft Visual Studio
> 3>9.0\VC\include\wchar.h(509) : warning C4820: 'stat' : '2' bytes
> 3>padding added after data member 'stat::st_gid'
> 
> There were more than 23000 of such messages. It also significantly
> slowed down build process. (without warnings it took 1:40 (min:sec),
> with warnings it took almost 3 minutes)
> 
> I found some discussion about this topic:
> http://stackoverflow.com/questions/4001736/what-with-the-thousands-of-warnings-in-standard-headers-in-msvc-wall
> 
> I think that there shouldn't be this option in cmakelist at all.
> We can discuss the warning level sometime, but in my opinion it's not
> the vital problem...the problem, we should concentrate on, is that
> when the application starts, it fails immediately.
> Before Christmas it was running. Are you able (on Linux) to run the
> last version properly also with map rendering???
> 
> Tom
> 
> > ------------ Původní zpráva ------------
> > Od: Kuba Marek <blue.cube@xxxxxxxxx>
> > Předmět: [glideplan_swproj] Re: CMake
> > Datum: 01.1.2012 21:42:55
> > ----------------------------------------
> > I think the list of osgearth libraries came from maria's code, but
> > I'm really not sure.
> > 
> > The cmake code you posted here checks if the flag -Wall works in the
> > current compiler and adds it if it does. I thought it would only
> > work on gcc, though.
> > I think warnings should be enabled on all platflorms. If the code
> > generated by moc causes warnings we should either try to fix it or
> > silence warnings only from those files.
> > 
> > K
> > 
> > > Hi Kuba!
> > > 1)
> > > I removed the build directory, run cmake, build application in VS.
> > > Some functions were missing (linker errors) ...I added osgGA
> > > library to required set of libraries in cmakelists and now it
> > > works well. How do you know, that this subset of osg libraries is
> > > the right one? ...did you search the library dependencies?
> > > 
> > > 2)
> > > When I commented out these lines in the cmakelists (the commit
> > > with wall flag)
> > > 
> > > #INCLUDE(CheckCXXCompilerFlag)
> > > #CHECK_CXX_COMPILER_FLAG(-Wall HAS_WALL)
> > > #IF(HAS_WALL)
> > > #  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
> > > #ENDIF(HAS_WALL)
> > > 
> > > warning disappeared and everything builds well.
> > > Why are these lines in cmakelists?
> > > If it is for "Enable compiler warnings on linux" as you mentioned
> > > in commit, there should be statement:
> > > IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
> > > ...I'm going to add it now...please test it, if it works on linux.
> > > 
> > > Tom
> > 
> > > To visit archive or unsubscribe, follow:
> > > http://www.freelists.org/list/glideplan_swproj
> > 
> > 
> > 
> 
> To visit archive or unsubscribe, follow:
> http://www.freelists.org/list/glideplan_swproj

Other related posts: