June 16, 2012

tallia1 tallia1
Lab Rat
58 posts

qmake: import an OSX framework from ~/Library/Frameworks

 

Hey guys,

I am wondering whether you think this is the simplest way to include
an OSX framework which is deployed in the user folder “~/Library/Frameworks”

  1. TARGET = taucs_demo
  2. TEMPLATE = app
  3. QT -= core gui
  4. CONFIG += console
  5. CONFIG -= app_bundle
  6.  
  7. # Import framework
  8. QMAKE_CXXFLAGS += -F$$(HOME)/Library/Frameworks
  9. QMAKE_LFLAGS += -F$$(HOME)/Library/Frameworks
  10. LIBS += -framework Taucs
  11.  
  12. SOURCES += main.cpp

I have also experimented with setting DYLD_FRAMEWORK_PATH
in my “~/.bashrc” or inside the Qt Creator variables without
much luck…

Don’t you think the QMAKE_CXXFLAGS/QMAKE_LFLAGS combo
is particularly ugly? I wish there was something like:

  1. FRAMEWORKPATH += ....

Thoughts?

3 replies

June 16, 2012

tucnak tucnak
Robot Herder
384 posts

Advice

  1. Don’t use QMAKE in state of label: [QMAKE]. Yust like this: qmake: Import a framework from ~/Library/Frameworks. Label must be [SOLVED] or [SELF-SOLVED].

Solution

 Signature 

Qt Developer (upper-intermediate)
PHP/JS Developer (intermediate)

June 23, 2012

Volker Volker
Robot Herder
5428 posts

In order to include frameworks to your project, you need to add to both, the include path and the library path. I would try this:

  1. INCLUDEPATH += -F$$(HOME)/Library/Frameworks
  2. LIBS += -F$$(HOME)/Library/Frameworks -framework Taucs

I didn’t test this, though. I would need to setup a test case with a framework in a non-standard path. Everything in /System is found anyways :-)

June 25, 2012

tallia1 tallia1
Lab Rat
58 posts

Thanks Volker. I still think that is still sort of badly designed…

Let me add something else, I wish Qt created its own “framework” structure, which a qt user could then use to organize his project in a cross platform fashion… Perhaps with the ability to contain compiled binaries for a number of operating systems.

I find it terribly annoying that Qt goes a long way toward cross-platform, yet it stops one step short…

 
  ‹‹ [SELF-SOLVED] QTabBar and QSS      [SOLVED] Simple socket client inside app ››

You must log in to post a reply. Not a member yet? Register here!