From f2387696d17ab54c57b83cba9cc6bacb613a91c9 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 22 Oct 2010 12:28:38 +0200 Subject: [PATCH] OSX build fixes --- SConstruct | 3 ++- src/mitsuba/darwin_stub.mm | 1 + src/mitsuba/mtsutil.cpp | 14 +++++++++++--- src/qtgui/loaddlg.cpp | 4 +++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index 1eb66b9b..6211c66b 100644 --- a/SConstruct +++ b/SConstruct @@ -409,7 +409,6 @@ if sys.platform == 'win32': # Build the command-line+GUI interface mainEnv.Program('mtssrv', resources + ['src/mitsuba/mtssrv.cpp']) mainEnv.Program('mitsuba', resources + ['src/mitsuba/mitsuba.cpp']) -mainEnv.Program('mtsutil', resources + ['src/mitsuba/mtsutil.cpp']) if sys.platform == 'darwin': mainEnv_osx = mainEnv.Clone(); @@ -418,6 +417,8 @@ if sys.platform == 'darwin': mainEnv_osx['CXXFLAGS'].append('-fno-strict-aliasing'); darwinStub += [mainEnv_osx.StaticObject('src/mitsuba/darwin_stub.mm')] +mainEnv.Program('mtsutil', resources + darwinStub + ['src/mitsuba/mtsutil.cpp']) + env.Program('src/utils/joinrgb', ['src/utils/joinrgb.cpp']) env.Program('src/utils/ttest', ['src/utils/ttest.cpp']) env.Program('src/utils/createvol', ['src/utils/createvol.cpp']) diff --git a/src/mitsuba/darwin_stub.mm b/src/mitsuba/darwin_stub.mm index 6489633c..ecce710a 100644 --- a/src/mitsuba/darwin_stub.mm +++ b/src/mitsuba/darwin_stub.mm @@ -24,6 +24,7 @@ int main(int argc, char **argv) { // return NSApplicationMain(argc, (const char **) argv); NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [NSApplication sharedApplication]; /* Creates a connection to the windowing environment */ + [NSApp activateIgnoringOtherApps:YES]; /* Pop to front */ int retval = ubi_main(argc, argv); [pool release]; return retval; diff --git a/src/mitsuba/mtsutil.cpp b/src/mitsuba/mtsutil.cpp index 7ccbeba9..1cfaee33 100644 --- a/src/mitsuba/mtsutil.cpp +++ b/src/mitsuba/mtsutil.cpp @@ -121,7 +121,7 @@ void help() { } -int ubi_main(int argc, char **argv) { +int mtsutil(int argc, char **argv) { char optchar, *end_ptr = NULL; try { @@ -356,7 +356,7 @@ int ubi_main(int argc, char **argv) { return 0; } -int main(int argc, char **argv) { +int ubi_main(int argc, char **argv) { /* Initialize the core framework */ Class::staticInitialization(); PluginManager::staticInitialization(); @@ -390,7 +390,7 @@ int main(int argc, char **argv) { return -1; } - int retval = ubi_main(argc, argv); + int retval = mtsutil(argc, argv); XMLPlatformUtils::Terminate(); @@ -411,3 +411,11 @@ int main(int argc, char **argv) { return retval; } + +#if !defined(__OSX__) +int main(int argc, char **argv) { + return ubi_main(argc, argv); +} +#endif + + diff --git a/src/qtgui/loaddlg.cpp b/src/qtgui/loaddlg.cpp index d4dd5e80..5011e7eb 100644 --- a/src/qtgui/loaddlg.cpp +++ b/src/qtgui/loaddlg.cpp @@ -40,7 +40,9 @@ LoadDialog::LoadDialog(QWidget *parent) : font.setStyleHint(QFont::TypeWriter); #if defined(__OSX__) font.setPointSize(10); - ui->heading->font().setPointSize(14); + QFont headingFont = ui->heading->font(); + headingFont.setPointSize(14); + ui->heading->setFont(headingFont); #else font.setPointSize(8); #endif