mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
simplified compilation of Qt sources with custom rules
git-svn-id: http://svn.osgeo.org/qgis/trunk@10312 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
66d4068300
commit
a9c94ed119
File diff suppressed because one or more lines are too long
@ -29,21 +29,34 @@ Cmake files can't be used to dynamically generate source lists in the Xcode targ
|
||||
\ul generated\ulnone - intermediate sources generated by bison, flex, moc, uic, rcc in script phases. Subfolders will start empty of files, and contents appear red in the project until generated.\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
|
||||
\cf0 \
|
||||
\'95\'a0Generated sources\
|
||||
\'95 Custom Rules\
|
||||
\
|
||||
Xcode doesn't handle its dependency calculations well with intermediate sources created with custom rules (needed for bison, flex, moc, uic, rcc). The result is excessive recompilation. bison and flex need custom rules, though there are Xcode rules for those, because those don't handle C++ file extensions.\
|
||||
- moc\
|
||||
\
|
||||
So, script phases are used instead and timestamps are compared manually in them.\
|
||||
source file names matching: *.h\
|
||||
script: $QTMOC $QT_CXXFLAGS -o "$DERIVED_FILES_DIR/moc_$INPUT_FILE_BASE.cpp" "$INPUT_FILE_PATH"\
|
||||
with output files: $(DERIVED_FILES_DIR)/moc_$(INPUT_FILE_BASE).cpp\
|
||||
\
|
||||
\'95 Adding core/gui/app moc sources\
|
||||
- qrc\
|
||||
\
|
||||
1. add source to moc_sources.xcconfig\
|
||||
sources: *.qrc\
|
||||
script: $QTRCC -name $INPUT_FILE_BASE -o "$DERIVED_FILES_DIR/qrc_$INPUT_FILE_BASE.cpp" "$INPUT_FILE_PATH"\
|
||||
output: $(DERIVED_FILES_DIR)/qrc_$(INPUT_FILE_BASE).cpp\
|
||||
\
|
||||
2. build the moc target only\
|
||||
- ui\
|
||||
\
|
||||
3. find the new moc source in the 'generated' subfolder in the project folder in the Finder. Drag it into the project's corresponding 'generated/*' folder (remember to add relative to project).\
|
||||
do ui generation in a script phase because:\
|
||||
\
|
||||
4. add this source to the corresponding core/gui/app target\
|
||||
- Xcode will attempt to process generated *.h with moc rule\
|
||||
- parallel processing might not finish ui's before a cpp source needs it\
|
||||
\
|
||||
plugins need a user-defined setting to set the TARGET_PLUGINDIR of the plugin.\
|
||||
\
|
||||
\'95 Header paths\
|
||||
\
|
||||
- to access ui headers in qgis_gui from other targets:\
|
||||
\
|
||||
"$(TARGET_TEMP_DIR)/../qgis_gui.build/DerivedSources"\
|
||||
\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
|
||||
@ -53,11 +66,11 @@ So, script phases are used instead and timestamps are compared manually in them.
|
||||
\
|
||||
There is no way to conditionaly compile whole targets, or individual sources. So fo now, all conditional sources are required. Conditional targets must be built manually.\
|
||||
\
|
||||
Linked libraries can be conditionalize in the config file.\
|
||||
Linked libraries can be conditionalized in the config file.\
|
||||
\
|
||||
Sources can be conditionalized inside the source, with one big #ifdef block.\
|
||||
\
|
||||
Another possibility is to indirectly add sources in a script phase as generated - copy the true source if condition true, dump dummy empty source if false. The target always compiles the generated source.\
|
||||
Another possibility is to indirectly add sources in a script phase as generated - copy the true source if condition true, dump dummy empty source if false. The target always compiles the generated source. Wouldn't work for whole targets, as bogus binary is generated.\
|
||||
\
|
||||
\
|
||||
Targets can be destructive (most are) - for example, everything is built directly into the application bundle, which is really the domain of the Qgis.app target. This simplifies packaging for optional plugins. This means that if just the app target is cleaned, all link and copy phases of all other targets must be redone.\
|
||||
@ -78,29 +91,15 @@ libqgispython must be in MacOS/lib. Qgis attempts to load it dynamically, with
|
||||
\
|
||||
2. Duplicate provider or plugin template target and rename\
|
||||
\
|
||||
3. Edit Generate Sources phase script\
|
||||
- set QTUIC_FILES to names of ui files without extensions\
|
||||
- set QTMOC_FILES to names of moc files without extensions\
|
||||
- set QTRCC_FILE to name of qrc file without extension\
|
||||
- set LIBNAME and DIRNAME\
|
||||
- set LIBTYPE\
|
||||
3. Add sources to target\
|
||||
\
|
||||
4. if any of moc/uic/rcc have files to process:\
|
||||
\
|
||||
a. Build target (without sources) to generate sources.\
|
||||
\
|
||||
b. Drag folder created into project \ul generated\ulnone group (add as relative to project).\
|
||||
\
|
||||
c. add rm command to \ul extra clean\ulnone target script.\
|
||||
\
|
||||
5. Add sources to target\
|
||||
\
|
||||
6. Edit target settings:\
|
||||
4. Edit target settings:\
|
||||
\
|
||||
a. Product Name\
|
||||
b. Header Search Paths - add extra source folders needed, and config _INC vars\
|
||||
c. Other Linker Flags - add config _LIB vars as needed\
|
||||
c. Other Linker Flags - add config *_LIB vars as needed\
|
||||
d. Preprocessor Macros - add extra defs if needed\
|
||||
e. TARGET_PLUGINDIR - name of folder of plugin source\
|
||||
\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
|
||||
|
@ -10,7 +10,7 @@
|
||||
\b0\fs24 \cf0 \
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
|
||||
|
||||
\i \cf0 2.1.0 2009-2-16\
|
||||
\i \cf0 2.1.2 2009-3-19\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
|
||||
|
||||
\i0 \cf0 \
|
||||
@ -21,9 +21,9 @@
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
|
||||
|
||||
\b0 \cf0 \
|
||||
This builds QGIS, as an alternative to the CLI Unix build (both build the Mac application). By default everything is built universal for both PPC and Intel.\
|
||||
This builds QGIS, as an alternative to the CLI Unix build (both build the Mac application). By default everything is built for the native architecture.\
|
||||
\
|
||||
Dependent libraries are optionally copied into the application bundle and embedded library paths are adjusted.\
|
||||
Dependent libraries are optionally copied into the application bundle and embedded library paths are adjusted. Some dependent libraries are always copied for stability reasons (Qt, PyQt).\
|
||||
\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
|
||||
@ -127,7 +127,9 @@ ln -s /Users/Shared/unix /Developer/SDKs/MacOSX10.4u.sdk/Users/Shared/unix
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
|
||||
|
||||
\f1\fs20 \cf0 QTDIR
|
||||
\f0\fs24 is where the Qt command-line programs are found. The default is for a binary installation of Qt. If built from source, you may need to change this.\
|
||||
\f0\fs24 is where the Qt applications and plugins are installed.
|
||||
\f1\fs20 QTBIN
|
||||
\f0\fs24 is where the Qt command-line programs are found. The default is for a binary installation of Qt. If built from source, you may need to change these.\
|
||||
\
|
||||
|
||||
\f1\fs20 BISON
|
||||
@ -188,7 +190,7 @@ Some of the bundle targets don't exist yet, but can easily be created as needed.
|
||||
\f1\fs20 static
|
||||
\f0\fs24 forms in the settings.\
|
||||
\
|
||||
- GRASS - GRASS.app \ul must\ulnone be installed in /Applications directly, as it was built, not in a subfolder in /Applications or some other folder. This goes for building Qgis as well as running it to use full GRASS support.\
|
||||
- GRASS - GRASS.app \ul must\ulnone be installed as it was built. If it was moved or renamed after installation, GRASS support in Qgis won't work. This goes for building Qgis as well as running it to use full GRASS support.\
|
||||
\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
|
||||
@ -203,11 +205,11 @@ Xcode doesn't have a way to conditionally build targets, just code within source
|
||||
\i will
|
||||
\i0 try to keep building as much as it can after errors. The last target built is the Qgis application itself, which has all the bundling and cleanup steps. So, if a dependency is missing for a plugin, it will have errors and fail to build, then the app bundling and cleanup will work with what succeeded.\
|
||||
\
|
||||
\ul Cleaning\ulnone - the clean the project, first set the \ul extra clean\ulnone target as active and build it. Then
|
||||
\ul Cleaning\ulnone - to clean the project
|
||||
\b Clean All
|
||||
\b0 .\
|
||||
\b0 . This actually leaves qgsconfig.h and qgssvnversion.h in the build folder.\
|
||||
\
|
||||
Or instead, trash the build and generated folders from the project folder (NOT from the project itself!).\
|
||||
For a complete clean, trash the build folder from the project folder (NOT from the project itself!).\
|
||||
\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
|
||||
|
@ -1,6 +1,6 @@
|
||||
// QGIS Xcode project common build settings
|
||||
|
||||
CURRENT_PROJECT_VERSION = 2.1.1
|
||||
CURRENT_PROJECT_VERSION = 2.1.2
|
||||
|
||||
// SDK not required for native universal build, but recommended,
|
||||
// and allows building multiple SDK builds side-by-side
|
||||
@ -18,7 +18,7 @@ QGIS_RELEASE_NAME = Unstable-trunk
|
||||
QGIS_VERSION_MAJOR = 1
|
||||
QGIS_VERSION_MINOR = 1
|
||||
QGIS_VERSION_PATCH = 0
|
||||
QGIS_VERSION_BUILD = 20090223
|
||||
QGIS_VERSION_BUILD = 20090319
|
||||
QGIS_VERSION_FULL = $(QGIS_VERSION_MAJOR).$(QGIS_VERSION_MINOR).$(QGIS_VERSION_PATCH)-$(QGIS_VERSION_BUILD)
|
||||
QGIS_VERSION_INT = 10100
|
||||
|
||||
@ -140,17 +140,18 @@ SYMROOT_ = build/native
|
||||
SYMROOT = $(SYMROOT_$(SDKSYS))
|
||||
INSTALL_PREFIX = /Applications
|
||||
QGIS_APP_NAME = Qgis.app
|
||||
PROJECT_TARGET_APP_DIR = $(CONFIGURATION_BUILD_DIR)/$(QGIS_PREFIX)
|
||||
PROJECT_TARGET_DIR = $(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PROJECT_TARGET_APP_DIR = $(PROJECT_TARGET_DIR)/$(QGIS_PREFIX)
|
||||
QGIS_PREFIX = $(QGIS_APP_NAME)/Contents
|
||||
QGIS_INSTALL_PATH = $(INSTALL_PREFIX)/$(QGIS_PREFIX)
|
||||
QGIS_BUILD_PATH = $(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/$(QGIS_PREFIX)
|
||||
QGIS_BUILD_PATH = $(PROJECT_TARGET_DIR)/$(QGIS_PREFIX)
|
||||
// subdirs are relative to MacOS dir, as if MacOS is unix "prefix"
|
||||
QGIS_BIN_SUBDIR = bin // leave this alone for now
|
||||
QGIS_FW_SUBDIR = ../Frameworks
|
||||
QGIS_LIB_SUBDIR = lib // qgispython lib MUST be in MacOS/lib
|
||||
QGIS_DATA_SUBDIR = ../Resources
|
||||
QGIS_PLUGIN_SUBDIR = ../PlugIns/qgis
|
||||
HEADER_SEARCH_PATHS = generated
|
||||
HEADER_SEARCH_PATHS = $(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/include
|
||||
//LIBRARY_SEARCH_PATHS = $(PROJECT_TARGET_APP_DIR)/../Frameworks
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
USE_HEADERMAP = NO // else headers with same name cause confusion
|
||||
@ -284,4 +285,3 @@ PYTHON_HAVE = $(PYTHON_HAVE_$(PYTHON_FORM)_$(SDKSYS))
|
||||
PYTHON = $(PYTHON_PREFIX)/bin/python
|
||||
|
||||
#include "qgis_user.xcconfig"
|
||||
#include "moc_sources.xcconfig"
|
||||
|
Loading…
x
Reference in New Issue
Block a user