util/projects.pro
changeset 7 f7bc934e204c
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
       
     1 #####################################################################
       
     2 # Main projectfile
       
     3 #####################################################################
       
     4 
       
     5 CONFIG += ordered
       
     6 TEMPLATE = subdirs
       
     7 
       
     8 cross_compile: CONFIG += nostrip
       
     9 
       
    10 isEmpty(QT_BUILD_PARTS) { #defaults
       
    11     symbian {
       
    12        QT_BUILD_PARTS = libs tools
       
    13     } else {
       
    14        QT_BUILD_PARTS = libs tools examples demos docs translations
       
    15     }
       
    16 } else { #make sure the order makes sense
       
    17    contains(QT_BUILD_PARTS, translations) {
       
    18        QT_BUILD_PARTS -= translations
       
    19        QT_BUILD_PARTS = translations $$QT_BUILD_PARTS
       
    20    }
       
    21    contains(QT_BUILD_PARTS, tools) {
       
    22        QT_BUILD_PARTS -= tools
       
    23        QT_BUILD_PARTS = tools $$QT_BUILD_PARTS
       
    24    }
       
    25    contains(QT_BUILD_PARTS, libs) {
       
    26        QT_BUILD_PARTS -= libs
       
    27        QT_BUILD_PARTS = libs $$QT_BUILD_PARTS
       
    28    }
       
    29    contains(QT_BUILD_PARTS, qmake) {
       
    30        QT_BUILD_PARTS -= qmake
       
    31        QT_BUILD_PARTS = qmake $$QT_BUILD_PARTS
       
    32    }
       
    33    symbian {
       
    34       #QTP: build libs only by default
       
    35       QT_BUILD_PARTS = libs
       
    36    }
       
    37 }
       
    38 
       
    39 #process the projects
       
    40 for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) {
       
    41     isEqual(PROJECT, tools) {
       
    42        SUBDIRS += tools
       
    43     } else:isEqual(PROJECT, examples) {
       
    44        SUBDIRS += examples
       
    45     } else:isEqual(PROJECT, demos) {
       
    46        SUBDIRS += demos
       
    47     } else:isEqual(PROJECT, tests) {
       
    48        SUBDIRS += tests
       
    49     } else:isEqual(PROJECT, libs) {
       
    50        include(src/src.pro)
       
    51     } else:isEqual(PROJECT, docs) {
       
    52        contains(QT_BUILD_PARTS, tools):include(doc/doc.pri)
       
    53     } else:isEqual(PROJECT, translations) {
       
    54        contains(QT_BUILD_PARTS, tools) {
       
    55           include(translations/translations.pri)  # ts targets
       
    56        } else {
       
    57           !wince*:!symbian:SUBDIRS += tools/linguist/lrelease
       
    58        }
       
    59        SUBDIRS += translations                    # qm build step
       
    60     } else:isEqual(PROJECT, qmake) {
       
    61 #      SUBDIRS += qmake
       
    62     } else {
       
    63        message(Unknown PROJECT: $$PROJECT)
       
    64     }
       
    65 }
       
    66 
       
    67 !symbian: confclean.depends += clean
       
    68 confclean.commands =
       
    69 unix:!symbian {
       
    70   confclean.commands += (cd config.tests/unix/stl && $(MAKE) distclean); \
       
    71 			(cd config.tests/unix/endian && $(MAKE) distclean); \
       
    72 			(cd config.tests/unix/ipv6 && $(MAKE) distclean); \
       
    73 			(cd config.tests/unix/largefile && $(MAKE) distclean); \
       
    74 			(cd config.tests/unix/ptrsize && $(MAKE) distclean); \
       
    75 			(cd config.tests/x11/notype && $(MAKE) distclean); \
       
    76 			(cd config.tests/unix/getaddrinfo && $(MAKE) distclean); \
       
    77 			(cd config.tests/unix/cups && $(MAKE) distclean); \
       
    78 			(cd config.tests/unix/psql && $(MAKE) distclean); \
       
    79 			(cd config.tests/unix/mysql && $(MAKE) distclean); \
       
    80  	 		(cd config.tests/unix/mysql_r && $(MAKE) distclean); \
       
    81 			(cd config.tests/unix/nis && $(MAKE) distclean); \
       
    82 			(cd config.tests/unix/nix && $(MAKE) distclean); \
       
    83 			(cd config.tests/unix/iodbc && $(MAKE) distclean); \
       
    84 			(cd config.tests/unix/odbc && $(MAKE) distclean); \
       
    85 			(cd config.tests/unix/oci && $(MAKE) distclean); \
       
    86 			(cd config.tests/unix/tds && $(MAKE) distclean); \
       
    87 			(cd config.tests/unix/db2 && $(MAKE) distclean); \
       
    88 			(cd config.tests/unix/ibase && $(MAKE) distclean); \
       
    89 			(cd config.tests/unix/ipv6ifname && $(MAKE) distclean); \
       
    90 			(cd config.tests/unix/zlib && $(MAKE) distclean); \
       
    91 			(cd config.tests/unix/libmng && $(MAKE) distclean); \
       
    92 			(cd config.tests/unix/sqlite2 && $(MAKE) distclean); \
       
    93 			(cd config.tests/unix/libjpeg && $(MAKE) distclean); \
       
    94 			(cd config.tests/unix/libpng && $(MAKE) distclean); \
       
    95 			(cd config.tests/x11/xcursor && $(MAKE) distclean); \
       
    96 			(cd config.tests/x11/xrender && $(MAKE) distclean); \
       
    97 			(cd config.tests/x11/xrandr && $(MAKE) distclean); \
       
    98 			(cd config.tests/x11/xkb && $(MAKE) distclean); \
       
    99 			(cd config.tests/x11/xinput && $(MAKE) distclean); \
       
   100 			(cd config.tests/x11/fontconfig && $(MAKE) distclean); \
       
   101 			(cd config.tests/x11/xinerama && $(MAKE) distclean); \
       
   102 			(cd config.tests/x11/sm && $(MAKE) distclean); \
       
   103 			(cd config.tests/x11/xshape && $(MAKE) distclean); \
       
   104 			(cd config.tests/x11/opengl && $(MAKE) distclean); \
       
   105                         $(DEL_FILE) config.tests/.qmake.cache; \
       
   106 			$(DEL_FILE) src/core/global/qconfig.h; \
       
   107 			$(DEL_FILE) src/core/global/qconfig.cpp; \
       
   108 			$(DEL_FILE) mkspecs/qconfig.pri; \
       
   109 			$(DEL_FILE) .qmake.cache; \
       
   110  			(cd qmake && $(MAKE) distclean);
       
   111 }
       
   112 win32 {
       
   113   confclean.commands += -$(DEL_FILE) src\core\global\qconfig.h $$escape_expand(\n\t) \
       
   114 			-$(DEL_FILE) src\core\global\qconfig.cpp $$escape_expand(\n\t) \
       
   115 			-$(DEL_FILE) mkspecs\qconfig.pri $$escape_expand(\n\t) \
       
   116 			-$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \
       
   117 			(cd qmake && $(MAKE) distclean)
       
   118 }
       
   119 symbian {
       
   120   confclean.depends += distclean
       
   121   confclean.commands += \
       
   122             (cd src\tools\moc && $(MAKE) distclean) $$escape_expand(\n\t) \
       
   123             (cd src\tools\rcc && $(MAKE) distclean) $$escape_expand(\n\t) \
       
   124             (cd src\tools\uic && $(MAKE) distclean) $$escape_expand(\n\t) \
       
   125             -$(DEL_FILE) src\corelib\global\qconfig.h $$escape_expand(\n\t) \
       
   126             -$(DEL_FILE) src\corelib\global\qconfig.cpp $$escape_expand(\n\t) \
       
   127             -$(DEL_FILE) mkspecs\qconfig.pri $$escape_expand(\n\t) \
       
   128             -$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \
       
   129             (cd qmake && $(MAKE) distclean)
       
   130             
       
   131 }
       
   132 QMAKE_EXTRA_TARGETS += confclean
       
   133 qmakeclean.commands += (cd qmake && $(MAKE) clean)
       
   134 QMAKE_EXTRA_TARGETS += qmakeclean
       
   135 CLEAN_DEPS += qmakeclean
       
   136 
       
   137 CONFIG -= qt
       
   138 
       
   139 ### installations ####
       
   140 
       
   141 #translations
       
   142 translations.path=$$[QT_INSTALL_TRANSLATIONS]
       
   143 translations.files = $$QT_SOURCE_TREE/translations/*.qm
       
   144 INSTALLS += translations
       
   145 
       
   146 #qmake
       
   147 qmake.path=$$[QT_INSTALL_BINS]
       
   148 win32 {
       
   149    qmake.files=$$QT_BUILD_TREE/bin/qmake.exe
       
   150 } else {
       
   151    qmake.files=$$QT_BUILD_TREE/bin/qmake
       
   152 }
       
   153 INSTALLS += qmake
       
   154 
       
   155 #mkspecs
       
   156 mkspecs.path=$$[QT_INSTALL_DATA]/mkspecs
       
   157 mkspecs.files=$$QT_BUILD_TREE/mkspecs/qconfig.pri $$QT_SOURCE_TREE/mkspecs/*
       
   158 unix { 
       
   159    DEFAULT_QMAKESPEC = $$QMAKESPEC
       
   160    DEFAULT_QMAKESPEC ~= s,^.*mkspecs/,,g
       
   161    mkspecs.commands += $(DEL_FILE) $(INSTALL_ROOT)$$mkspecs.path/default; $(SYMLINK) $$DEFAULT_QMAKESPEC $(INSTALL_ROOT)$$mkspecs.path/default
       
   162 }
       
   163 INSTALLS += mkspecs
       
   164 
       
   165 false:macx { #mac install location
       
   166     macdocs.files = $$htmldocs.files
       
   167     macdocs.path = /Developer/Documentation/Qt
       
   168     INSTALLS += macdocs
       
   169 }
       
   170