trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: January 2012

Re: [trinity-devel] tdelibs FTBFS with tqt3

From: Darrell Anderson <humanreadable@...>
Date: Tue, 24 Jan 2012 16:36:52 -0800 (PST)
> > OK, I see the problem.  Now to figure out why it
> happens... :-)
> >
> > In the tqtinterface qtinterface/CMakeLists.txt file,
> there is an if
> > statement that looks like this:
> >
> > if ( NOT HAVE_REAL_TQT )
> >
> > For anything to work properly on native tqt3,
> HAVE_REAL_TQT *must* be set.
> >  Yet in the CMakeCache.txt file you sent earlier,
> HAVE_REAL_TQT does not
> > show up anywhere.
> >
> > If HAVE_REAL_TQT was set, the string "Native TQt3
> detected" needs to show
> > up in the tqtinterface build log.  Once again I
> don't see it anywhere in
> > the build log you sent earlier.
> >
> > There is a chunk of logic in the tqtinterface
> ConfigureChecks.cmake file
> > that looks like this:
> >
> > if( NOT DEFINED QT_INCLUDE_DIR )
> >   if( QT_PREFIX_DIR STREQUAL "/usr" )
> >     if( EXISTS
> "${QT_PREFIX_DIR}/include/tqt${QT_VERSION}" )
> >       set( QT_INCLUDE_DIR
> "${QT_PREFIX_DIR}/include/tqt${QT_VERSION}" )
> >       set( HAVE_REAL_TQT ON
> CACHE BOOL "Native TQt3 detected" )
> >
> > Note the number of ways that the set(HAVE_REAL_TQT)
> statement can be
> > bypassed.  This logic is incomplete and needs to
> be repaired.
> >
> > Specifically, I will need to figure out a way for CMake
> to load the
> > qglobal.h file and unambiguously determine the nature
> of the Qt version
> > installed.

Yup, I see the problem now that you pointed me to the cmake logic. The cmake logic is like this:

if( NOT DEFINED QT_INCLUDE_DIR )
  if( QT_PREFIX_DIR STREQUAL "/usr" )
    if( EXISTS "${QT_PREFIX_DIR}/include/tqt${QT_VERSION}" )
      set( QT_INCLUDE_DIR "${QT_PREFIX_DIR}/include/tqt${QT_VERSION}" )
      set( HAVE_REAL_TQT ON CACHE BOOL "Native TQt3 detected" )
    else( )
      set( QT_INCLUDE_DIR "${QT_PREFIX_DIR}/include/qt${QT_VERSION}" )
    endif( )
  else( )
    set( QT_INCLUDE_DIR "${QT_PREFIX_DIR}/include" )
  endif( )
endif( )
qt_message( "  QT_INCLUDE_DIR: ${QT_INCLUDE_DIR}" )

I don't have a ${PREFIX}/include/(t)qt${QT_VERSION} because my build script installs the header files to ${PREFIX}/include. I did not specify -headerdir in my (t)qt3 configure options. The logic tests fail without that specific include directory name.

I notice a few things:

1) I can specify -headerdir to the expected location. If that is the only test, then we need to update the wiki to ensure everybody always specifies -headerdir = ${PREFIX}/include/(t)qt${QT_VERSION}.

2) To detect when a user builds to install the header files to ${PREFIX}/include rather than ${PREFIX}/include/(t)qt${QT_VERSION}, a different test is needed. Possibly detect whether qt-mt.pc or tqt-mt.pc is installed in the $PKGCONFIG locations.  The other day you showed me how to use pkg-config --cflags-only-I, so perhaps that is the better test to determine where the header files are installed and which version of (t)qt3.

3) In Slackware, and probably some other distros too, the traditional installation location for qt3 was ${PREFIX}/lib${LIBDIRSUFFIX}/${PRGNAM}-${VERSION}. A challenge with that location is the requirement to create several sym links to standard locations. Therefore I changed a lot of that in my new GIT (t)qt3 build scripts to avoid needing to create all of those sym links. Yet even with that install location, there will not be an ${PREFIX}/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/include/(t)qt{$VERSION} directory, only ${PREFIX}/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/include. So perhaps the pkg-config option is best.

For now the solution might be as easy as building both qt3 and tqt3 with -headerdir specified to ${PREFIX}/include/(t)qt${QT_VERSION}. I will try that tonight and post the results. :)

Thanks for your help!

Darrell