Class: RakeOE::QtSettings
- Inherits:
-
Object
- Object
- RakeOE::QtSettings
- Defined in:
- lib/rakeoe/qt_settings.rb
Overview
Qt specific compilation and linker settings
Instance Attribute Summary collapse
-
#lib_infix ⇒ String
Library infix dependent on if either Qt Embedded is used or Desktop Qt.
Instance Method Summary collapse
-
#cflags ⇒ String
Returns the cflags configuration for the Qt compilation.
-
#check ⇒ Object
Check if all mandatory files and paths are present.
-
#check_once ⇒ bool
Check only once our sanity.
-
#initialize(toolchain) ⇒ QtSettings
constructor
A new instance of QtSettings.
-
#ldflags ⇒ String
Returns the ldflags configuration for the Qt linkage.
-
#libs ⇒ String
Returns the libs used for the Qt application linkage.
-
#read_config(file) ⇒ KeyValueReader
Reads and parses the qt configuration.
Constructor Details
#initialize(toolchain) ⇒ QtSettings
Returns a new instance of QtSettings.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rakeoe/qt_settings.rb', line 14 def initialize(toolchain) @tc = toolchain @qt_file_macros = %w[OE_QMAKE_MOC OE_QMAKE_UIC OE_QMAKE_UIC3 OE_QMAKE_RCC OE_QMAKE_QDBUSCPP2XML OE_QMAKE_QDBUSXML2CPP OE_QMAKE_QT_CONFIG ] @qt_path_macros = %w[OE_QMAKE_LIBDIR_QT OE_QMAKE_INCDIR_QT QMAKESPEC] @checked = false if check_once @cfg_file = read_config(@tc.settings['OE_QMAKE_QT_CONFIG']) if @cfg_file @lib_infix = @cfg_file.env['QT_LIBINFIX'] else @lib_infix = '' end end end |
Instance Attribute Details
#lib_infix ⇒ String
Returns Library infix dependent on if either Qt Embedded is used or Desktop Qt.
11 12 13 |
# File 'lib/rakeoe/qt_settings.rb', line 11 def lib_infix @lib_infix end |
Instance Method Details
#cflags ⇒ String
Returns the cflags configuration for the Qt compilation
69 70 71 |
# File 'lib/rakeoe/qt_settings.rb', line 69 def cflags " -I#{@tc.settings['OE_QMAKE_INCDIR_QT']} -I#{@tc.settings['OE_QMAKE_INCDIR_QT']}/QtCore -I#{@tc.settings['OE_QMAKE_INCDIR_QT']}/Qt -I#{@tc.settings['OE_QMAKE_INCDIR_QT']}/QtNetwork -I#{@tc.settings['OE_QMAKE_INCDIR_QT']}/QtDBus" end |
#check ⇒ Object
Check if all mandatory files and paths are present
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rakeoe/qt_settings.rb', line 30 def check @prerequisites_resolved = true @qt_file_macros.each do |macro| macro_value = @tc.settings[macro] if macro_value && !File.exist?(macro_value) @prerequisites_resolved = false end end @qt_path_macros.each do |macro| macro_value = @tc.settings[macro] if macro_value && !Dir.exist?(macro_value) @prerequisites_resolved = false end end @checked = true end |
#check_once ⇒ bool
Check only once our sanity
51 52 53 54 |
# File 'lib/rakeoe/qt_settings.rb', line 51 def check_once check unless @checked @prerequisites_resolved end |
#ldflags ⇒ String
Returns the ldflags configuration for the Qt linkage
75 76 77 |
# File 'lib/rakeoe/qt_settings.rb', line 75 def ldflags " -L#{@tc.settings['OE_QMAKE_LIBDIR_QT']}" end |
#libs ⇒ String
Returns the libs used for the Qt application linkage
82 83 84 |
# File 'lib/rakeoe/qt_settings.rb', line 82 def libs " QtCore#{@lib_infix} QtNetwork#{@lib_infix} QtDBus#{@lib_infix}" end |
#read_config(file) ⇒ KeyValueReader
Reads and parses the qt configuration
61 62 63 64 65 |
# File 'lib/rakeoe/qt_settings.rb', line 61 def read_config(file) if file && !file.empty? KeyValueReader.new(file) end end |