aboutsummaryrefslogtreecommitdiff
path: root/tools/create_project/msvc.cpp
diff options
context:
space:
mode:
authorJulien Templier2010-11-19 14:12:33 +0000
committerJulien Templier2010-11-19 14:12:33 +0000
commitec9ad50c145be10985666b08ee2dbf0f9129c551 (patch)
tree9f84b20270845e23d7a7ee9cfa2a044e523f1ab7 /tools/create_project/msvc.cpp
parent6aa770751fbb830436f305d64369b4332cbc8d86 (diff)
downloadscummvm-rg350-ec9ad50c145be10985666b08ee2dbf0f9129c551.tar.gz
scummvm-rg350-ec9ad50c145be10985666b08ee2dbf0f9129c551.tar.bz2
scummvm-rg350-ec9ad50c145be10985666b08ee2dbf0f9129c551.zip
TOOLS: Move Visual Studio pre/post build events scripts to external files
svn-id: r54381
Diffstat (limited to 'tools/create_project/msvc.cpp')
-rw-r--r--tools/create_project/msvc.cpp44
1 files changed, 17 insertions, 27 deletions
diff --git a/tools/create_project/msvc.cpp b/tools/create_project/msvc.cpp
index 5d951f9d48..c6174f7bd4 100644
--- a/tools/create_project/msvc.cpp
+++ b/tools/create_project/msvc.cpp
@@ -142,40 +142,30 @@ void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
outputGlobalPropFile(properties, 64, x64Defines, convertPathToWin(setup.filePrefix));
}
-std::string MSVCProvider::getRevisionToolCommandLine() const {
+std::string MSVCProvider::getPreBuildEvent() const {
std::string cmdLine = "";
cmdLine = "@echo off\n"
- "ECHO Generating revision number\n"
- "IF NOT EXIST "$(SolutionDir)../../.svn/" GOTO working_copy\n"
- "SubWCRev.exe "$(SolutionDir)../.." "$(SolutionDir)../../base/internal_version.h.tpl" "$(SolutionDir)../../base/internal_version.h"\n"
- "IF NOT %errorlevel%==0 GOTO error\n"
- ":working_copy\n"
- "ECHO Not a working copy, skipping...\n"
- "EXIT /B0\n"
- ":error\n"
- "ECHO SubWCRev not found, skipping...\n"
+ "echo Executing Pre-Build script...\n"
+ "echo.\n"
+ "@call "$(SolutionDir)../../tools/create_project/scripts/prebuild.cmd" "$(SolutionDir)/../.."\n"
"EXIT /B0";
return cmdLine;
}
-std::string MSVCProvider::getCopyDataCommandLine(bool isWin32) const {
+std::string MSVCProvider::getPostBuildEvent(bool isWin32) const {
std::string cmdLine = "";
- // Copy data files and themes
cmdLine = "@echo off\n"
- "ECHO Copying data files\n"
- "xcopy /F /Y "$(SolutionDir)../engine-data/*.dat" $(OutDir)\n"
- "xcopy /F /Y "$(SolutionDir)../engine-data/*.tbl" $(OutDir)\n"
- "xcopy /F /Y "$(SolutionDir)../engine-data/*.cpt" $(OutDir)\n"
- "xcopy /F /Y "$(SolutionDir)../engine-data/README" $(OutDir)\n"
- "xcopy /F /Y "$(SolutionDir)../../gui/themes/*.zip" $(OutDir)\n"
- "xcopy /F /Y "$(SolutionDir)../../gui/themes/translations.dat" $(OutDir)\n";
-
- cmdLine += "xcopy /F /Y "$(SCUMMVM_LIBS)/lib/";
- cmdLine += (isWin32 ? "x86" : "x64");
- cmdLine += "/SDL.dll" $(OutDir)";
+ "echo Executing Post-Build script...\n"
+ "echo.\n"
+ "@call "$(SolutionDir)../../tools/create_project/scripts/postbuild.cmd" "$(SolutionDir)/../.." "$(OutDir)" ";
+
+ cmdLine += (isWin32) ? "x86" : "x64";
+
+ cmdLine += "\n"
+ "EXIT /B0";
return cmdLine;
}
@@ -222,10 +212,10 @@ int VisualStudioProvider::getVisualStudioVersion() {
"\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
"\t\t\t/>\n" \
"\t\t\t<Tool\tName=\"VCPreBuildEventTool\"\n" \
- "\t\t\t\tCommandLine=\"" << getRevisionToolCommandLine() << "\"\n" \
+ "\t\t\t\tCommandLine=\"" << getPreBuildEvent() << "\"\n" \
"\t\t\t/>\n" \
"\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n" \
- "\t\t\t\tCommandLine=\"" << getCopyDataCommandLine(isWin32) << "\"\n" \
+ "\t\t\t\tCommandLine=\"" << getPostBuildEvent(isWin32) << "\"\n" \
"\t\t\t/>\n" \
"\t\t</Configuration>\n"; \
}
@@ -760,14 +750,14 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
if (!isRelease) {
project << "\t\t<PreBuildEvent>\n"
"\t\t\t<Message>Generate internal_version.h</Message>\n"
- "\t\t\t<Command>" << getRevisionToolCommandLine() << "</Command>\n"
+ "\t\t\t<Command>" << getPreBuildEvent() << "</Command>\n"
"\t\t</PreBuildEvent>\n";
}
// Copy data files to the build folder
project << "\t\t<PostBuildEvent>\n"
"\t\t\t<Message>Copy data files to the build folder</Message>\n"
- "\t\t\t<Command>" << getCopyDataCommandLine(isWin32) << "</Command>\n"
+ "\t\t\t<Command>" << getPostBuildEvent(isWin32) << "</Command>\n"
"\t\t</PostBuildEvent>\n";
}