1

After I successfully implemented my first JVMTI agent and the building completes with the g++ compiler I want to go over integrate the building process into my Qt project.

However I am facing some build process configuration issues:

The parameters I would run with the g++ compiler looks like this:

g++ -fPIC -shared agent.cpp -o libagent.so -I /usr/lib/jvm/java-6-openjdk/include -I /usr/lib/jvm/java-6-openjdk/include/linux

This works very well. Now to qmake:

I am aware of the parameter CXXFLAGS to add further parameters to the C++ compiler used by qmake, but how can I convert this parametrized compiler call into qmake?

Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143

2 Answers2

2

With the help of Qt Undocumented qmake I figured out a custom configuration in qmake. However, it is not flawless, it produces now a libagent.so and a agent.o which is not needed.

SOURCES_AGENT = agent.cpp
agent.name = agent
agent.input = SOURCES_AGENT
agent.dependency_type = TYPE_C
agent.variable_out = OBJECTS
agent.output = libagent.so
agent.commands = $${QMAKE_CXX} $(CXXFLAGS) -fPIC -shared  -o libagent.so $(INCPATH) ${QMAKE_FILE_IN}
QMAKE_EXTRA_COMPILERS += agent
Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
1

I don't know the specific answer but...

As JVMTI agents are "usually" headless are you using qmake because your project has a head that you are developing in kdevelop/qtcreator? Is the head using the attach API?

If not and it is purely headless then would not a different editor/cmake be better? qmake is now a preproc for cmake, for the MOC stuff, no?

I must admit I'm a bit fuzzy on q/cmake although I'm hoping to move to cmake for my work.

  • @paul-anderson: Yes, I want to to develop a profiler with a graphical user interface on the Qt framework. I could seperate it from the building process, but this should be more elegant and improve the building process in development. – Konrad Reiche Mar 14 '11 at 21:55
  • I agree, QT is a great choice, will it be open source? .... want a hand writing it ? – Paul Anderson Mar 15 '11 at 09:00
  • It will be open source, but it's topic of my bachelor thesis, for now – Konrad Reiche Mar 15 '11 at 09:06