[Scummvm-cvs-logs] SF.net SVN: scummvm:[45383] scummvm/trunk/tools/create_msvc

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Oct 26 00:14:15 CET 2009


Revision: 45383
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45383&view=rev
Author:   lordhoto
Date:     2009-10-25 23:14:15 +0000 (Sun, 25 Oct 2009)

Log Message:
-----------
Allow overwriting the file prefix in the relative path arguments of MSVC project files.

Modified Paths:
--------------
    scummvm/trunk/tools/create_msvc/create_msvc.cpp
    scummvm/trunk/tools/create_msvc/create_msvc.h

Modified: scummvm/trunk/tools/create_msvc/create_msvc.cpp
===================================================================
--- scummvm/trunk/tools/create_msvc/create_msvc.cpp	2009-10-25 23:12:46 UTC (rev 45382)
+++ scummvm/trunk/tools/create_msvc/create_msvc.cpp	2009-10-25 23:14:15 UTC (rev 45383)
@@ -84,7 +84,7 @@
 	const std::string srcDir = argv[1];
 
 	BuildSetup setup;
-	setup.srcDir = unifyPath(srcDir);
+	setup.filePrefix = setup.srcDir = unifyPath(srcDir);
 	setup.engines = parseConfigure(setup.srcDir);
 	setup.features = getAllFeatures();
 
@@ -159,6 +159,13 @@
 
 				feature->enable = false;
 			}
+		} else if (!strcmp(argv[i], "--file-prefix")) {
+			if (i + 1 >= argc) {
+				std::cerr << "ERROR: Missing \"prefix\" parameter for \"--file-prefix\"!\n";
+				return -1;
+			}
+
+			setup.filePrefix = argv[++i];
 		} else {
 			std::cerr << "ERROR: Unknown parameter \"" << argv[i] << "\"\n";
 			return -1;
@@ -237,31 +244,34 @@
 	     << exe << " path\\to\\source [optional options]\n"
 	     << "\n"
 	     << " Creates MSVC project files for the ScummVM source locatd at \"path\\to\\source\".\n"
-		    " The project files will be created in the directory where tool is run from and\n"
-			" will include \"path\\to\\source\" for relative file paths, thus be sure that you\n"
-			" pass a relative file path like \"..\\..\\trunk\".\n"
-			"\n"
-			" Additionally there are the following switches for changing various settings:\n"
-			"\n"
-			"MSVC specifc settings:\n"
-			" --msvc-version version   sets the targeted MSVC version. Possible values:\n"
-			"                          8 stands for \"Visual Studio 2005\"\n"
-			"                          9 stands for \"Visual Studio 2008\"\n"
-			"                         The default is \"9\", thus \"Visual Studio 2008\"\n"
-			"\n"
-			"ScummVM engine settings:\n"
-			" --list-engines           lists all available engines and their default state\n"
-			" --enable-engine          enables building of the engine with the name \"engine\"\n"
-			" --disable-engine         disables building of the engine with the name \"engine\"\n"
-			" --enable-all-engines     enables building of all engines\n"
-			" --disable-all-engines    disables building of all engines\n"
-			"\n"
-			"ScummVM optional feature settings:\n"
-			" --enable-name            enables inclusion of the feature \"name\"\n"
-			" --disable-name           disables inclusion of the feature \"name\"\n"
-			"\n"
-			" There are the following features available:\n"
-			"\n";
+	        " The project files will be created in the directory where tool is run from and\n"
+	        " will include \"path\\to\\source\" for relative file paths, thus be sure that you\n"
+	        " pass a relative file path like \"..\\..\\trunk\".\n"
+	        "\n"
+	        " Additionally there are the following switches for changing various settings:\n"
+	        "\n"
+	        "MSVC specifc settings:\n"
+	        " --msvc-version version   sets the targeted MSVC version. Possible values:\n"
+	        "                           8 stands for \"Visual Studio 2005\"\n"
+	        "                           9 stands for \"Visual Studio 2008\"\n"
+	        "                           The default is \"9\", thus \"Visual Studio 2008\"\n"
+	        " --file-prefix prefix     allows overwriting of relative file prefix in the\n"
+	        "                          MSVC project files. By default the prefix is the\n"
+	        "                          \"path\\to\\source\" argument\n"
+	        "\n"
+	        "ScummVM engine settings:\n"
+	        " --list-engines           lists all available engines and their default state\n"
+	        " --enable-engine          enables building of the engine with the name \"engine\"\n"
+	        " --disable-engine         disables building of the engine with the name \"engine\"\n"
+	        " --enable-all-engines     enables building of all engines\n"
+	        " --disable-all-engines    disables building of all engines\n"
+	        "\n"
+	        "ScummVM optional feature settings:\n"
+	        " --enable-name            enables inclusion of the feature \"name\"\n"
+	        " --disable-name           disables inclusion of the feature \"name\"\n"
+	        "\n"
+	        " There are the following features available:\n"
+	        "\n";
 
 	cout << "   state  |       name      |     description\n\n";
 	const FeatureList features = getAllFeatures();
@@ -555,9 +565,11 @@
  * @param projectFile Output stream object, where all data should be written to.
  * @param includeList Files to include (must have a relative directory as prefix).
  * @param excludeList Files to exclude (must have a relative directory as prefix).
+ * @param filePrefix Prefix to use for relativ path arguments.
  */
 void addFilesToProject(const std::string &dir, std::ofstream &projectFile,
-                       const StringList &includeList, const StringList &excludeList);
+                       const StringList &includeList, const StringList &excludeList,
+					   const std::string &filePrefix);
 
 /**
  * Create the global project properties.
@@ -793,7 +805,7 @@
 	project << "\t</Configurations>\n"
 	           "\t<Files>\n";
 
-	addFilesToProject(moduleDir, project, includeList, excludeList);
+	addFilesToProject(moduleDir, project, includeList, excludeList, setup.filePrefix);
 
 	project << "\t</Files>\n"
 	           "</VisualStudioProject>\n";
@@ -1189,7 +1201,8 @@
 }
 
 void addFilesToProject(const std::string &dir, std::ofstream &projectFile,
-					   const StringList &includeList, const StringList &excludeList) {
+					   const StringList &includeList, const StringList &excludeList,
+					   const std::string &filePrefix) {
 	// Check for duplicate object file names
 	StringList duplicate;
 
@@ -1216,7 +1229,7 @@
 
 	FileNode *files = scanFiles(dir, includeList, excludeList);
 
-	writeFileListToProject(*files, projectFile, 0, duplicate, std::string(), dir + '/');
+	writeFileListToProject(*files, projectFile, 0, duplicate, std::string(), filePrefix + '/');
 
 	delete files;
 }

Modified: scummvm/trunk/tools/create_msvc/create_msvc.h
===================================================================
--- scummvm/trunk/tools/create_msvc/create_msvc.h	2009-10-25 23:12:46 UTC (rev 45382)
+++ scummvm/trunk/tools/create_msvc/create_msvc.h	2009-10-25 23:14:15 UTC (rev 45383)
@@ -171,13 +171,14 @@
  * It also contains the path to the ScummVM souce root.
  */
 struct BuildSetup {
-	std::string srcDir;     ///< Path to the ScummVM sources
+	std::string srcDir;     ///< Path to the ScummVM sources.
+	std::string filePrefix; ///< Prefix for the relativ path arugments in the project files.
 
-	EngineDescList engines; ///< Engine list for the build (this may contain engines, which are *not* enabled!)
-	FeatureList features;   ///< Feature list for the build (this may contain features, which are *not* enabled!)
+	EngineDescList engines; ///< Engine list for the build (this may contain engines, which are *not* enabled!).
+	FeatureList features;   ///< Feature list for the build (this may contain features, which are *not* enabled!).
 
-	StringList defines;   ///< List of all defines for the build
-	StringList libraries; ///< List of all external libraries required for the build
+	StringList defines;   ///< List of all defines for the build.
+	StringList libraries; ///< List of all external libraries required for the build.
 };
 
 /**


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list