Skip to content

Commit

Permalink
build fixes for plugin manual
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Aug 8, 2012
1 parent 5d0280e commit 8d5a948
Show file tree
Hide file tree
Showing 54 changed files with 33,673 additions and 42,618 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ applebuild
*.qm
share/manual/en
share/manual/de
share/manual/plugins
Doc
DocLib
build.qt5
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,14 @@ add_custom_target(lrelease
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)

add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/plugins
COMMAND genManual ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}
DEPENDS genManual
)

add_custom_target(install_plugins_manual
COMMAND ${PROJECT_BINARY_DIR}/manual/genManual ${PROJECT_SOURCE_DIR} /usr/local/${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}manual
)

install(CODE "execute_process(COMMAND make install_plugins_manual)")

2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ release: revision
..; \
make lrelease; \
make -j ${CPUS}; \
./manual/genManual .. \


debug:
Expand All @@ -44,7 +43,6 @@ debug:
..; \
make lrelease; \
make -j ${CPUS}; \
./manual/genManual .. \


qt5:
Expand Down
19 changes: 14 additions & 5 deletions manual/genManual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <stdio.h>

QString srcPath;
QString dstPath;

//---------------------------------------------------------
// Prop
Expand Down Expand Up @@ -298,10 +299,10 @@ static void writeOutput()
}
addFooter(out);

QString ofile = srcPath + "/share/manual/plugins/" + cl.name.toLower() + ".html";
QString ofile = dstPath + "/plugins/" + cl.name.toLower() + ".html";
QFile of(ofile);
if (!of.open(QIODevice::WriteOnly)) {
printf("open <%s> failed\n", qPrintable(ofile));
printf("open <%s> failed: %s\n", qPrintable(ofile), qPrintable(of.errorString()));
exit(-4);
}
of.write(out.toUtf8());
Expand All @@ -322,7 +323,7 @@ static void writeOutput()
}
addFooter(out);

QString ofile = srcPath + "/share/manual/plugins/plugins.html";
QString ofile = dstPath + "/plugins/plugins.html";
QFile of(ofile);
if (!of.open(QIODevice::WriteOnly)) {
printf("open <%s> failed\n", qPrintable(ofile));
Expand All @@ -339,7 +340,7 @@ static void writeOutput()
static void usage(const char* program, const char* hint)
{
fprintf(stderr, "%s: %s\n", program, hint);
fprintf(stderr, "usage: %s [options] srcPath\n", program);
fprintf(stderr, "usage: %s [options] srcPath dstPath\n", program);
fprintf(stderr, "options: -v print version\n"
);
}
Expand Down Expand Up @@ -374,11 +375,12 @@ int main(int argc, char* argv[])
}
argc -= optind;
argv += optind;
if (argc != 1) {
if (argc != 2) {
usage(prog, "bad arguments");
return -1;
}
srcPath = argv[0];
dstPath = argv[1];
QStringList files;
files << "mscore/plugins.h";

Expand All @@ -403,6 +405,13 @@ int main(int argc, char* argv[])
scanFile(in);
inFile.close();
}
QDir dir;
QString opath = dstPath + "/plugins";
if (!dir.mkpath(opath)) {
fprintf(stderr, "%s: cannot create destination path: <%s>\n",
argv[0], qPrintable(dstPath));
return -3;
}
writeOutput();
return 0;
}
Expand Down
7 changes: 0 additions & 7 deletions mscore/pluginCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,6 @@ QString PluginCreator::manualPath()
{
QString path = mscoreGlobalShare;
path += "/manual/plugins/plugins.html";

QString p1 = QDir::homePath(); // hack for debugging
p1 += "/mscore/share/manual/plugins/plugins.html";
if (QFile(p1).exists()) {
printf("PluginManual: found <%s>\n", qPrintable(p1));
return p1;
}
return path;
}

Expand Down
2 changes: 1 addition & 1 deletion mscore/revision.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6c8c240
5d0280e
Loading

0 comments on commit 8d5a948

Please sign in to comment.