Advertisement
Guest User

Qt Sample Makefile

a guest
May 16th, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 2.96 KB | None | 0 0
  1. #The compiler that will be used
  2. CC=cl.exe
  3.  
  4. #Source directory
  5. SRCDIR = .\src
  6.  
  7. #Directory where the common source files are located
  8. COMMONDIR = .\Common\src
  9.  
  10. INTERFACEDIR = .\Interface\src
  11.  
  12. #Declare the MetaObject Compiler
  13. MOC = C:\OpenCASCADE6.7.1\qt462-vc9-32\bin\moc.exe
  14.  
  15.  
  16. #Store the output of the MOC in this directory
  17. MOCDIR = .\src\moc
  18.  
  19. PROJECT_INCLUDES = -I$(COMMONDIR) -I$(INTERFACEDIR)
  20.  
  21. CASCADE_INCLUDES = -IC:\OpenCASCADE6.7.1\qt462-vc9-32\include \
  22.                    -IC:\OpenCASCADE6.7.1\opencascade-6.7.1\inc
  23.                    #-IC:\OpenCASCADE6.7.1\opencascade-6.7.1\src
  24.                  
  25.  
  26. WIN_SDK_INCLUDES = -IC:\Program\ Files\ (x86)\Microsoft\ Visual\ Studio\ 11.0\VC\INCLUDE \
  27.                    -IC:\Program\ Files\ (x86)\Windows\ Kits\8.0\include\shared           \
  28.                    -IC:\Program\ Files\ (x86)\Windows\ Kits\8.0\include\um               \
  29.                    -IC:\Program\ Files\ (x86)\Windows\ Kits\8.0\include\winrt
  30.  
  31. QT_INCLUDES = -IC:\OpenCASCADE6.7.1\qt462-vc9-32\include\Qt \
  32.               -IC:\OpenCASCADE6.7.1\qt462-vc9-32\include\QtGui \
  33.               -IC:\OpenCASCADE6.7.1\qt462-vc9-32\include\QtCore
  34.  
  35. LIB  += -LC:\Program\ Files\ (x86)\Microsoft\ Visual\ Studio\ 11.0\VC\LIB \
  36.         -LC:\Program\ Files\ (x86)\Windows\ Kits\8.0\lib\win8\um\x86 \
  37.         -LC:\OpenCASCADE6.7.1\opencascade-6.7.1\win32\vc9\lib
  38.  
  39. DEFINES = -DWIN32  \
  40.           -DCSFDB  \
  41.           -DNDEBUG \
  42.           -DWNT    \
  43.           -DNO_COMMONSAMPLE_EXPORTS \
  44.           -DNO_IESAMPLE_EXPORTS \
  45.           -DQT_DLL \
  46.           -DQT_NO_DEBUG \
  47.           -DQT_GUI_LIB \
  48.           -DQT_CORE_LIB \
  49.           -DQT_THREAD_SUPPORT
  50.  
  51. ALL_INCLUDES = $(PROJECT_INCLUDES) $(CASCADE_INCLUDES) $(WIN_SDK_INCLUDES) $(QT_INCLUDES)
  52.  
  53. #This target has one dependency but no rules
  54. all: tutorial
  55.  
  56.  
  57. #If a target does not have any dependencies just write targetname: <CR> and
  58. #Then the target directives
  59.  
  60. tutorial: Main.o ApplicationTut.o DocumentTut.o MakeBottle.o
  61.     $(CC) Main.o ApplicationTut.o DocumentTut.o MakeBottle.o -o tutorial
  62.  
  63. Main.o: moc_ApplicationCommon.cpp
  64.     $(CC) $(DEFINES) $(ALL_INCLUDES) $(SRCDIR)\Main.cxx
  65.  
  66. moc_ApplicationCommon.cpp:
  67.     $(MOC) -o $(MOCDIR)\moc_ApplicationCommon.cpp $(COMMONDIR)\ApplicationCommon.h
  68.  
  69. #DocumentTut utilises the Q_OBJECT directive, so we must invoke the MOC
  70. #The actual object is created by using the cpp and the MOC produced source
  71. DocumentTut.o: moc_DocumentTut.cpp
  72.     $(CC) -c $(SRCDIR)\DocumentTut.cxx $(MOCDIR)\moc_DocumentTut.cpp
  73.  
  74. #Write the dependency for the MOC source code
  75. moc_DocumentTut.cpp:
  76.     $(MOC) -o $(MOCDIR)\moc_DocumentTut.cpp $(SRCDIR)\DocumentTut.h
  77.  
  78. #Perform the same thing for the ApplicationTut
  79. ApplicationTut.o: ApplicationTut.cxx moc_ApplicationTut.cpp
  80.     $(CC) ApplicationTut.cxx moc_ApplicationTut.cpp
  81.  
  82. moc_ApplicationTut.cpp:
  83.     $(MOC) -o $(MOCDIR)\moc_ApplicationTut.cpp $(SRCDIR)\ApplicationTut.h
  84.  
  85. MakeBottle.o:
  86.     $(CC) $(DEFINES) $(ALL_INCLUDES) $(SRCDIR)\MakeBottle.cxx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement