2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
6 import platform as PLATFORM
8 # Version of this package (even if built as a child)
12 GTKMM2EXT_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
14 # Library version (UNIX style major, minor, micro)
15 # major increment <=> incompatible changes
16 # minor increment <=> compatible changes (additions)
17 # micro increment <=> no interface changes
18 GTKMM2EXT_LIB_VERSION = '0.8.3'
20 # Variables for 'waf dist'
22 VERSION = GTKMM2EXT_VERSION
23 I18N_PACKAGE = 'gtkmm2ext3'
31 'cell_renderer_color_selector.cc',
32 'cell_renderer_pixbuf_multi.cc',
33 'cell_renderer_pixbuf_toggle.cc',
44 'persistent_tooltip.cc',
48 'visibility_tracker.cc',
57 path_prefix = 'libs/gtkmm2ext/'
60 autowaf.set_options(opt)
63 conf.load('compiler_cxx')
64 autowaf.configure(conf)
65 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM', atleast_version='2.8')
66 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK', atleast_version='2.12.1')
70 # operate on copy to avoid adding sources twice
71 sources = list(gtkmm2ext_sources)
73 if bld.is_defined ('INTERNAL_SHARED_LIBS'):
74 obj = bld.shlib(features = 'c cxx cshlib cxxshlib', source=sources)
75 # defines for this library
76 obj.defines = [ 'LIBGTKMM2EXT_DLL_EXPORTS', 'ABSTRACT_UI_EXPORTS' ]
78 obj = bld.stlib(features = 'c cxx cstlib cxxstlib', source=sources)
79 obj.cxxflags = [ bld.env['compiler_flags_dict']['pic'] ]
82 obj.export_includes = ['.']
84 obj.name = 'libgtkmm2ext'
85 obj.target = 'gtkmm2ext'
86 obj.uselib = 'GTKMM GTK XML'
87 obj.use = [ 'libpbd' ]
88 obj.vnum = GTKMM2EXT_LIB_VERSION
89 obj.install_path = bld.env['LIBDIR']
91 'PACKAGE="' + I18N_PACKAGE + '"',
92 'LOCALEDIR="' + os.path.join(
93 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
94 if sys.platform == 'darwin':
95 obj.source += ['gtkapplication_quartz.mm', 'nsglview.mm']
97 obj.source += ['gtkapplication_x11.c']
100 if bld.is_defined('ENABLE_NLS'):
101 mo_files = bld.path.ant_glob('po/*.mo')
103 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
104 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
108 autowaf.build_i18n(bld, top, 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
112 autowaf.build_i18n_pot(bld, top, 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
116 autowaf.build_i18n_po(bld, top, 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
120 autowaf.build_i18n_mo(bld, top, 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,