using check_cxx_source_runs

Alexander Neundorf neundorf at kde.org
Thu Mar 12 21:12:26 CET 2009


On Thursday 12 March 2009, Leo Franchi wrote:
> On 12 Mar 2009, at 19:49, Alexander Neundorf wrote:
...
> > Can you please post a minimal example ?
> > So I can just try and see what goes wrong ?
>
> Yep, so the source that we are trying to compile is this:
> *
>   * Copyright (C) 2009 Ian Monroe <ian at monroe.nu>
>   * released under public domain or:
> (snipped)
> */
>
> #include <KDE/KApplication>
> #include <KDE/KAboutData>
> #include <KDE/KCmdLineArgs>
> #include <QtScript/QScriptEngine>
> #include <QtCore/QStringList>
>
> #define FAIL 0xA
>
> int main(int argc, char **argv)
> {
>      KAboutData about( "findgeneratorplugins", "", ki18n("Generator
> Exists?"), "1.0", ki18n("Find if the QtScript Plugins Are Installed"),
> KAboutData::License_LGPL_V2 );
>      KCmdLineArgs::init( argc, argv, &about );
>      KApplication app;
>
>      QStringList allowedBindings;
>      allowedBindings << "qt.core" << "qt.gui" << "qt.sql" << "qt.xml"
> << "qt.uitools" << "qt.network";
>      QScriptEngine engine;
>      foreach( QString binding, allowedBindings )
>      {
>          if( !engine.importExtension( binding ).isUndefined() )
>          { // undefined indiciates success
>              qDebug( binding.toLatin1() +  " not found" );
>              return FAIL;
>          }
>      }
>      return 0;
> }
>
>
> and the cmake stuff is this:
>
> include(CheckCXXSourceRuns)
>
> file( READ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/
> QtScriptBindingsTest.cpp" source )
> message(STATUS "Checking if the QtScript Qt Bindings are installed.")
>
> #set( BINDINGS_RUN_RESULT -10 )
> set(CMAKE_REQUIRED_DEFINTIONS ${QT_DEFINITIONS} ${KDE4_DEFINITIONS} )
> set(CMAKE_REQUIRED_INCLUDES ${QT_QTCORE_INCLUDE_DIR} $
> {QT_QTSCRIPT_INCLUDE_DIR} ${KDE4_INCLUDES})
> set(CMAKE_REQUIRED_LIBRARIES QtScript kdeui)

I guess you tried ${QT_QTSCRIPT_LIBRARY} and ${KDE4_KDEUI_LIBS} ?

Alex


More information about the Kde-buildsystem mailing list