{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \vieww10500\viewh12500\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc\pardirnatural \f0\b\fs36 \cf0 QGIS Xcode Project\ Developer Notes\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \b0\fs24 \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \b \cf0 Sources\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \b0 \cf0 \ \'95 Adding sources and other files and folders to the project.\ \ Always use \ul Relative to Project\ulnone reference type.\ \ Cmake files can't be used to dynamically generate source lists in the Xcode targets. Any additions and deletions of source files in the cmake configuration must be manually mirrored in the Xcode project.\ \ \'95\'a0Layout\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-360\ql\qnatural\pardirnatural \cf0 \ul \ulc0 Configuration Files\ulnone - Xcode config files. dependency config, system target, core moc lists set here.\ \ul Sources\ulnone - standard Qgis sources\ \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\ \ 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.\ \ So, script phases are used instead and timestamps are compared manually in them.\ \ \'95 Adding core/gui/app moc sources\ \ 1. add source to moc_sources.xcconfig\ \ 2. build the moc target only\ \ 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).\ \ 4. add this source to the corresponding core/gui/app target\ \ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \b \cf0 Targets \b0 \ \ 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.\ \ 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.\ \ \ 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.\ \ \ The app target must be built last. This is so that the Qt bundling phase install_name_tool step will get all built libraries and plugins. Also, the bundled and stripped-of-headers Qt frameworks would interfere with building all other targets.\ \ \ libqgispython must be in MacOS/lib. Qgis attempts to load it dynamically, with a hardwired path.\ \ \ \b Adding Providers and Plugins (C++)\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \b0 \cf0 \ 1. Add sources to project\ \ 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\ \ 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:\ \ 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\ d. Preprocessor Macros - add extra defs if needed\ \ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \cf0 - William Kyngesburye\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural {\field{\*\fldinst{HYPERLINK "mailto:kyngchaos@kyngchaos.com"}}{\fldrslt \cf0 kyngchaos@kyngchaos.com}} \fs20 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural {\field{\*\fldinst{HYPERLINK "http://www.kyngchaos.com"}}{\fldrslt \fs24 \cf0 http://www.kyngchaos.com/}} \fs24 \ }