From 30d00ceb075adaa945a5176a3272982a856f0a9b Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 14 Apr 2010 20:17:44 +0000 Subject: Fludi IDE: now supporting header files for OS X. If those are included for a library, the resulting framework will receive a copy of the headers, allowing Xcode to simply include the file into any new project. frameworks must be installed in /Library?Frameworks to be found automatically. A little more fixing is required. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7504 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/ide_xcode.cxx | 256 +++++++++++++++++----------------------------------- 1 file changed, 81 insertions(+), 175 deletions(-) (limited to 'fluid/ide_xcode.cxx') diff --git a/fluid/ide_xcode.cxx b/fluid/ide_xcode.cxx index fdc24d346..8735460bf 100644 --- a/fluid/ide_xcode.cxx +++ b/fluid/ide_xcode.cxx @@ -25,8 +25,6 @@ // http://www.fltk.org/str.php // -#define XCODE_DEFAULT 1 - /* XCODE 3.0 IDE FILES @@ -171,6 +169,21 @@ public: const char *fullName = fileDB.fullName(); fprintf(out, "\t\t%s /* %s in Sources */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };\n", xcBuildFileID, fullName, xcFileID, fullName); } + // --- write all references to headers from the given target + Fl_Preferences headersDB(targetDB, "headers"); + n = headersDB.groups(); + for (i=0; i\";\n"); + fprintf(out, "\t\t};\n"); + return 0; + } + /* * */ @@ -554,6 +598,13 @@ public: fprintf(out, "\t\t\tisa = PBXGroup;\n"); fprintf(out, "\t\t\tchildren = (\n"); + Fl_Preferences headersDB(targetDB, "headers"); + int nHeaders = headersDB.groups(); + if (nHeaders) { + MAKE_XCID(xcTargetHeadersGroupID, targetDB); + fprintf(out, "\t\t\t\t%s /* Headers */,\n", xcTargetHeadersGroupID); + } + MAKE_XCID(xcProductID, targetDB); Fl_Preferences sourcesDB(targetDB, "sources"); int j, n = sourcesDB.groups(); @@ -592,6 +643,9 @@ public: fprintf(out, "\t\t\tname = %s;\n", name); fprintf(out, "\t\t\tsourceTree = \"\";\n"); fprintf(out, "\t\t};\n"); + + writeTargetHeaders(out, targetDB); + return 0; } @@ -711,19 +765,20 @@ public: fprintf(out, "\t\t\tisa = PBXHeadersBuildPhase;\n"); fprintf(out, "\t\t\tbuildActionMask = 2147483647;\n"); fprintf(out, "\t\t\tfiles = (\n"); -#if 0 - // FIXME: list all required headers - Fl_Preferences libsDB(targetDB, "libs"); - int i, n = libsDB.groups(); - for (i=0; i\n"); fprintf(f, "\t\n"); } - fprintf(f, "\tCFBundleExecutable\n"); - fprintf(f, "\t${EXECUTABLE_NAME}\n"); + if (fmwk) { + fprintf(f, "\tCFBundleName\n"); + fprintf(f, "\t${PRODUCT_NAME}\n"); + } else { + fprintf(f, "\tCFBundleExecutable\n"); + fprintf(f, "\t${EXECUTABLE_NAME}\n"); + } // find the first suitable icon file if there is one Fl_Preferences extsDB(target_db, "externals"); int i, n = extsDB.groups(); @@ -1596,6 +1498,10 @@ public: fprintf(f, "\tFLTK\n"); fprintf(f, "\tCFBundleVersion\n"); fprintf(f, "\t1.0\n"); + fprintf(f, "\tNSHumanReadableCopyright\n"); + fprintf(f, "\tCopyright 1998-2010 by Bill Spitzak and others.\n"); + fprintf(f, "\tCFBundleGetInfoString\n"); + fprintf(f, "\tPart of the FLTK library. Please visit www.fltk.org.\n"); fprintf(f, "\n"); fprintf(f, "\t\n"); fclose(f); -- cgit v1.2.3