Results 1 to 4 of 4

Thread: using a third party Makefile

  1. #1
    Join Date
    Oct 2013
    Location
    Bangalore,India
    Posts
    64
    Thanks
    21
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default using a third party Makefile

    I am trying to develop a Qt Widget GUI based application.
    I already have a console based application with a Makefile and now want to make some changes to make it a button driven application.
    My makefile is as follows:
    Qt Code:
    1. # Makefile for Basler Pylon sample program
    2. .PHONY : all clean
    3.  
    4. # the program to build
    5. NAME := Grab
    6.  
    7. # Build tools and flags
    8. CXX := /usr/bin/g++
    9. LD := /usr/bin/g++
    10. CPPFLAGS := -I$(GENICAM_ROOT_V2_1)/library/CPP/include \
    11. -I$(PYLON_ROOT)/include -DUSE_GIGE
    12. CXXFLAGS := -g -O0 #e.g., CXXFLAGS=-g -O0 for debugging
    13.  
    14. # To keep the makefile for 32 and 64 in sync we add 64 and 32-bit library paths
    15. # If you are targeting only 32 bit for you can remove the entries containing "64"
    16. LDFLAGS := -L$(PYLON_ROOT)/lib64 \
    17. -L$(PYLON_ROOT)/lib \
    18. -L$(GENICAM_ROOT_V2_1)/bin/Linux64_x64 \
    19. -L$(GENICAM_ROOT_V2_1)/bin/Linux64_x64/GenApi/Generic \
    20. -L$(GENICAM_ROOT_V2_1)/bin/Linux32_i86 \
    21. -L$(GENICAM_ROOT_V2_1)/bin/Linux32_i86/GenApi/Generic \
    22. -Wl,-E
    23. LIBS := -lpylonbase
    24.  
    25. all : $(NAME)
    26.  
    27. $(NAME) : $(NAME).o
    28. $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) -lGCBase_gcc40_v2_1
    29.  
    30. $(NAME).o : $(NAME).cpp
    31. $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
    32.  
    33. clean :
    34. $(RM) $(NAME).o $(NAME)
    To copy to clipboard, switch view to plain text mode 

    I have set the IncludePath in my pro file as:
    Qt Code:
    1. INCLUDEPATH += /opt/pylon/include \
    2. /opt/pylon/genicam/library/CPP/include
    To copy to clipboard, switch view to plain text mode 

    Can someone tell what other settings i need to make in my .pro file to make it work

    I am using Ubuntu 12.04 32-bit desktop edition using QTCreator 2.4.1 (based on QT 4.8.0 32-bit)

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: using a third party Makefile

    Why do you want to modify the Makefile ? With Qt you need to play with .pro files.

    As far as your problem is concerned, you will need to add QT += gui in your .pro file. Or remove the QT -= gui from the pro file of your console application ( in case you are modifying the console application itself to a gui application )

  3. #3
    Join Date
    Oct 2013
    Location
    Bangalore,India
    Posts
    64
    Thanks
    21
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: using a third party Makefile

    I do not want to modify my Makefile,just want to know how to add libraries and LD_FLAG path to my .pro file.
    I already have Qt+= gui in my .pro file.
    Here is the complete .pro file:
    Qt Code:
    1. QT += core gui
    2.  
    3. TARGET = abc
    4. TEMPLATE = app
    5.  
    6. INCLUDEPATH += /opt/pylon/include \
    7. /opt/pylon/genicam/library/CPP/include
    8. SOURCES += main.cpp\
    9. mainwindow.cpp \
    10. hellothread.cpp \
    11. ../projects/Grab/Grab.cpp
    12.  
    13. HEADERS += mainwindow.h \
    14. hellothread.h
    15.  
    16. FORMS += mainwindow.ui
    17.  
    18. OTHER_FILES +=
    19.  
    20. RESOURCES += \
    21. res.qrc
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Feb 2011
    Location
    Bangalore
    Posts
    207
    Thanks
    20
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: using a third party Makefile

    Use LIBS += etc.
    If you are using Qt Creator, right click on your project and click add library.. that will guide you with your library. Don;t make changes to makefile if you are using qmake.
    Makefile is generated and will overwrite all changes you have made to it.

  5. The following user says thank you to pkj for this useful post:

    prkhr4u (17th October 2013)

Similar Threads

  1. Replies: 1
    Last Post: 24th June 2011, 13:44
  2. Replies: 1
    Last Post: 31st March 2011, 19:38
  3. Replies: 0
    Last Post: 12th October 2010, 05:14
  4. Using third-party libraries in qt
    By apj in forum Newbie
    Replies: 1
    Last Post: 15th May 2009, 23:27
  5. using third party libs
    By jay in forum Qt Programming
    Replies: 13
    Last Post: 14th April 2009, 16:52

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.