Showing posts with label cmake. Show all posts
Showing posts with label cmake. Show all posts

Wednesday, April 8, 2009

Improvement for cmake options

When I was writing my last post, I realized that the cmake options should be improved more. So I read cmake files, I found 3 improvements.

1. MKSPECS

Because I use non-default Qt, I should be set cmake options not only QT_QMAKE_EXECUTABLE but also QT_MKSPECS_DIR that indicates root path of all mkspecs.

2. QTWEBKIT

QtWebkit libraries can be built. So ENABLE_QTWEBKIT_SMOKE and ENABLE_QTWEBKIT_RUBY are able to be on.

3. QTSCRIPT

QtScript libraries can be built. So ENABLE_QTSCRIPT_SMOKE and ENABLE_QTSCRIPT are able to be on.

Full cmake instructions with these improvements are below:
>cmake \
> -DCMAKE_INSTALL_PREFIX=/opt/ruby-1.9.1 \
> -DRUBY_EXECUTABLE=/opt/ruby-1.9.1/bin/ruby \
> -DRUBY_LIBRARY=/opt/ruby-1.9.1/lib/libruby.so.1.9.1 \
> -DRUBY_INCLUDE_PATH=/opt/ruby-1.9.1/include/ruby-1.9.1 \
> -DQT_QMAKE_EXECUTABLE=/opt/qtsdk-2009.01/qt/bin/qmake \
> -DQT_MKSPECS_DIR=/opt/qtsdk-2009.01/qt/mkspecs \
> -Wno-dev \
> -DENABLE_SMOKE=on \
> -DENABLE_QTRUBY=on \
> -DENABLE_QTWEBKIT_SMOKE=on \
> -DENABLE_QTSCRIPT_SMOKE=on \
> -DENABLE_QTUITOOLS_SMOKE=on \
> -DENABLE_QTTEST_SMOKE=off \
> -DENABLE_PHONON_SMOKE=off \
> -DENABLE_QSCI_SMOKE=off \
> -DENABLE_QWT_SMOKE=off \
> -DENABLE_KDE_SMOKE=off \
> -DENABLE_KDEVPLATFORM_SMOKE=off \
> -DENABLE_KHTML_SMOKE=off \
> -DENABLE_KTEXTEDITOR_SMOKE=off \
> -DENABLE_SOLID_SMOKE=off \
> -DENABLE_PLASMA_SMOKE=off \
> -DENABLE_QTWEBKIT_RUBY=on \
> -DENABLE_QTUITOOLS_RUBY=on \
> -DENABLE_QTSCRIPT=on \
> -DENABLE_QTTEST=off \
> -DENABLE_PHONON_RUBY=off \
> -DENABLE_QSCINTILLA_RUBY=off \
> -DENABLE_QWT_RUBY=off \
> -DENABLE_SOPRANO_RUBY=off \
> -DENABLE_KDEVPLATFORM_RUBY=off \
> -DENABLE_KORUNDUM_RUBY=off \
> -DENABLE_KHTML_RUBY=off \
> -DENABLE_KTEXTEDITOR_RUBY=off \
> -DENABLE_SOLID_RUBY=off \
> -DENABLE_KROSSRUBY=off \
> -DENABLE_PLASMA_RUBY=off \
> -DENABLE_QIMAGEBLITZ_SMOKE=off

Monday, April 6, 2009

Another usage of UI File from QtRuby #2

(continued from phosphorescence: Another usage of UI File from QtRuby #1)

Previous messages indicate missing ruby module 'qtuitools'. Let's make sure of load path.
>/opt/ruby-1.9.1/bin/ruby -e 'puts $:'
/opt/ruby-1.9.1/lib/ruby/site_ruby/1.9.1
/opt/ruby-1.9.1/lib/ruby/site_ruby/1.9.1/x86_64-linux
/opt/ruby-1.9.1/lib/ruby/site_ruby
/opt/ruby-1.9.1/lib/ruby/vendor_ruby/1.9.1
/opt/ruby-1.9.1/lib/ruby/vendor_ruby/1.9.1/x86_64-linux
/opt/ruby-1.9.1/lib/ruby/vendor_ruby
/opt/ruby-1.9.1/lib/ruby/1.9.1
/opt/ruby-1.9.1/lib/ruby/1.9.1/x86_64-linux
.

In these directories, ruby module 'qtuitools' is not found. How should I do? Seek back in the post phosphorescence: qt4-qtruby 2.0.3 is released, two cmake options are found:
>... \
> -DENABLE_QTUITOOLS_SMOKE=off \
> ... \
> -DENABLE_QTUITOOLS_RUBY=off \
> ...

So these options switch turned on.
>... \
> -DENABLE_QTUITOOLS_SMOKE=on \
> ... \
> -DENABLE_QTUITOOLS_RUBY=on \
> ...

After CMMI instructions, retry "ui_loader_example.rb":
>/opt/ruby-1.9.1/bin/ruby ui_loader_example.rb

Then succeed this time and same GUI is shown.

Wednesday, March 25, 2009

qt4-qtruby 2.0.3 is released

A few hours ago, qt4-qtruby 2.0.3 is released. This release is built from svn trunk that I have tried to build(#1, #2, #3). So building instructions are mostly same. See below, full instructions.
>tar -zxf qt4-qtruby-2.0.3.tgz
>cd qt4-qtruby-2.0.3
>cmake \
> -DCMAKE_INSTALL_PREFIX=/opt/ruby-1.9.1 \
> -DRUBY_EXECUTABLE=/opt/ruby-1.9.1/bin/ruby \
> -DRUBY_LIBRARY=/opt/ruby-1.9.1/lib/libruby.so.1.9.1 \
> -DRUBY_INCLUDE_PATH=/opt/ruby-1.9.1/include/ruby-1.9.1 \
> -DQT_QMAKE_EXECUTABLE=/opt/qtsdk-2009.01/qt/bin/qmake \
> -Wno-dev \
> -DENABLE_SMOKE=on \
> -DENABLE_QTRUBY=on \
> -DENABLE_QTWEBKIT_SMOKE=off \
> -DENABLE_QTSCRIPT_SMOKE=off \
> -DENABLE_QTUITOOLS_SMOKE=off \
> -DENABLE_QTTEST_SMOKE=off \
> -DENABLE_PHONON_SMOKE=off \
> -DENABLE_QSCI_SMOKE=off \
> -DENABLE_QWT_SMOKE=off \
> -DENABLE_KDE_SMOKE=off \
> -DENABLE_KDEVPLATFORM_SMOKE=off \
> -DENABLE_KHTML_SMOKE=off \
> -DENABLE_KTEXTEDITOR_SMOKE=off \
> -DENABLE_SOLID_SMOKE=off \
> -DENABLE_PLASMA_SMOKE=off \
> -DENABLE_QTWEBKIT_RUBY=off \
> -DENABLE_QTUITOOLS_RUBY=off \
> -DENABLE_QTSCRIPT=off \
> -DENABLE_QTTEST=off \
> -DENABLE_PHONON_RUBY=off \
> -DENABLE_QSCINTILLA_RUBY=off \
> -DENABLE_QWT_RUBY=off \
> -DENABLE_SOPRANO_RUBY=off \
> -DENABLE_KDEVPLATFORM_RUBY=off \
> -DENABLE_KORUNDUM_RUBY=off \
> -DENABLE_KHTML_RUBY=off \
> -DENABLE_KTEXTEDITOR_RUBY=off \
> -DENABLE_SOLID_RUBY=off \
> -DENABLE_KROSSRUBY=off \
> -DENABLE_PLASMA_RUBY=off \
> -DENABLE_QIMAGEBLITZ_SMOKE=off
>make
>sudo make install

If shebang line or LD_LIBRARY_PATH must be edited, see also #3.

Let's check installation.
>/opt/ruby-1.9.1/bin/irb
irb(main):001:0> require 'Qt4'
=> true

And, let's check other commands.
>/opt/ruby-1.9.1/bin/rbrcc -version
Ruby Resource Compiler for Qt version 4.5.0
>/opt/ruby-1.9.1/bin/rbuic4 -v
Qt User Interface Compiler version 4.5.0
>/opt/ruby-1.9.1/bin/rbqtapi -v
QtRuby 2.0.3 using Qt-4.5.0

Saturday, March 21, 2009

Build QtRuby with Ruby 1.9.1 and Qt 4.5 #2

(continued from phosphorescence: Build QtRuby with Ruby 1.9.1 and Qt 4.5 #1)

First, cmake finds default Ruby.
-- Ruby found: /usr/lib64/libruby.so

I certainly set -DRUBY_EXECUTABLE=/opt/ruby-1.9.1/bin/ruby and -DRUBY_INCLUDE_PATH=/opt/ruby-1.9.1/include/ruby-1.9.1. What do I lack? I seek the file related to cmake's ruby options, then it's found: cmake/modules/FindRUBY.cmake. At line 80~82 in this file, notable block is found.
IF(NOT RUBY_FIND_QUIETLY)
  MESSAGE(STATUS "Ruby found: ${RUBY_LIBRARY}")
ENDIF(NOT RUBY_FIND_QUIETLY)

I guess cmake requires -DRUBY_LIBRARY, so I should set path to ruby 1.9.1's shared library.

I mentioned in phosphorescence: Install Ruby 1.9.1, I forgot --enable-shared option. So I again build ruby 1.9.1 with --enable-shared option, then shared library was created.

Second, cmake finds default Qt.
-- Found Qt-Version 4.4.3 (using /usr/bin/qmake)

I remember not to set cmake's Qt options, so I seek related file, then it's found: cmake/modules/FindQt4.cmake. At line 1423~1425 in this file, notable block is found.
IF( NOT Qt4_FIND_QUIETLY)
  MESSAGE(STATUS "Found Qt-Version ${QTVERSION} (using ${QT_QMAKE_EXECUTABLE})")
ENDIF( NOT Qt4_FIND_QUIETLY)

I guess cmake requires -DQT_QMAKE_EXECUTABLE, so I should set Qt 4.5's qmake path.

Clean and retry building QtRuby.
test -r Makefile && make clean
rm CMakeCache.txt CMakeFiles/*log

>cmake \
>-DCMAKE_INSTALL_PREFIX=/opt/ruby-1.9.1 \
>-DRUBY_EXECUTABLE=/opt/ruby-1.9.1/bin/ruby \
>-DRUBY_INCLUDE_PATH=/opt/ruby-1.9.1/include/ruby-1.9.1 \
>-DRUBY_LIBRARY=/opt/ruby-1.9.1/lib/libruby.so.1.9.1 \
>-DQT_QMAKE_EXECUTABLE=/opt/qtsdk-2009.01/qt/bin/qmake \
>...

Check the appropriate output.
-- Found Qt-Version 4.5.0 (using /opt/qtsdk-2009.01/qt/bin/qmake)
-- Ruby found: /opt/ruby-1.9.1/lib/libruby.so.1.9.1

That's OK. Rest instruction goes. It takes a few minutes.
make
sudo make install

CMMI instructions succeed at this time. Result is shown on standard output and install_manifest.txt file in current directory.

So let's begin happy QtRuby computing. Launch irb.
>/opt/ruby-1.9.1/bin/irb
irb(main):001:0> require 'Qt'
LoadError: /opt/ruby-1.9.1/lib/ruby/site_ruby/1.9.1/x86_64-linux/qtruby4.so: undefined symbol: IdToClassNameMap - /opt/ruby-1.9.1/lib/ruby/site_ruby/1.9.1/x86_64-linux/qtruby4.so
from /opt/ruby-1.9.1/lib/ruby/site_ruby/1.9.1/Qt.rb:1:in `require'
from /opt/ruby-1.9.1/lib/ruby/site_ruby/1.9.1/Qt.rb:1:in `'
from (irb):1:in `require'
from (irb):1
from /opt/ruby-1.9.1/bin/irb:12:in `
'

Well, It's still unhappy. to be continued...