using check_cxx_source_runs
Leo Franchi
lfranchi at kde.org
Thu Mar 12 21:17:48 CET 2009
On 12 Mar 2009, at 20:12, Alexander Neundorf wrote:
> 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} ?
Yeah, but the weird thing is that I couldn't see them in the actual
log output. See: (with ${QT_QTSCRIPT_LIBRARY}):
/opt/ports/bin/cmake -E cmake_link_script CMakeFiles/
cmTryCompileExec.dir/link.txt --verbose=1
/usr/bin/g++-4.2 -fno-common -Woverloaded-virtual -
fvisibility=hidden -fvisibility-inlines-hidden -DBINDINGS_RUN_RESULT -
I/opt/ports/include/taglib -Wl,-search_paths_first -
headerpad_max_install_names -fPIC CMakeFiles/cmTryCompileExec.dir/
src.cxx.o -o cmTryCompileExec -lQtScript -lkdeui
ld: library not found for -lQtScript
collect2: ld returned 1 exit status
There should be the actual path to the library there (right before the
-lQtScript) , but there isn't. I don't get it.
leo
---
Leo Franchi (650) 704 3680
Tufts University 2010
lfranchi at kde.org
leonardo.franchi at tufts.edu
More information about the Kde-buildsystem
mailing list