Skip to content

Commit

Permalink
Added version info
Browse files Browse the repository at this point in the history
  • Loading branch information
SokoloffA committed Jan 26, 2013
1 parent bd02cff commit 0b1100c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 11 deletions.
24 changes: 20 additions & 4 deletions CMakeLists.txt
Expand Up @@ -2,6 +2,17 @@ cmake_minimum_required( VERSION 2.6 )


project(boomaga) project(boomaga)


set(MAJOR_VERSION 0)
set(MINOR_VERSION 1)
set(PATCH_VERSION 0)
set(FULL_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})

add_definitions(-DMAJOR_VERSION=\"${MAJOR_VERSION}\")
add_definitions(-DMINOR_VERSION=\"${MINOR_VERSION}\")
add_definitions(-DPATCH_VERSION=\"${PATCH_VERSION}\")
add_definitions(-DFULL_VERSION=\"${FULL_VERSION}\")


# Linux *************************************** # Linux ***************************************
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")


Expand All @@ -20,13 +31,16 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")


endif() endif()


set(GUI_DIR ${CMAKE_INSTALL_PREFIX}/lib/boomaga) set(GUI_DIR ${CMAKE_INSTALL_PREFIX}/bin)
add_definitions(-DGUI_DIR=\"${GUI_DIR}\") add_definitions(-DGUI_DIR=\"${GUI_DIR}\")



set(GUI_PROGRAM ${GUI_DIR}/boomaga) set(GUI_PROGRAM ${GUI_DIR}/boomaga)
add_definitions(-DGUI_PROGRAM=\"${GUI_PROGRAM}\") add_definitions(-DGUI_PROGRAM=\"${GUI_PROGRAM}\")


set(GUI_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/boomaga)
add_definitions(-DGUI_SHARE_DIR=\"${GUI_SHARE_DIR}\")




set(CUPS_BACKEND_URI "boomaga:/") set(CUPS_BACKEND_URI "boomaga:/")
add_definitions(-DCUPS_BACKEND_URI=\"${CUPS_BACKEND_URI}\") add_definitions(-DCUPS_BACKEND_URI=\"${CUPS_BACKEND_URI}\")
Expand Down Expand Up @@ -64,11 +78,13 @@ add_subdirectory(cups)
add_subdirectory(gui) add_subdirectory(gui)


message(STATUS "*****************************************************") message(STATUS "*****************************************************")
message(STATUS "** You can change next directories using cmake options like.") message(STATUS "* boomaga ver. ${FULL_VERSION}")
message(STATUS "*")
message(STATUS "* You can change next directories using cmake options like.")
message(STATUS "* cmake -DCUPS_BACKEND_DIR=your_path") message(STATUS "* cmake -DCUPS_BACKEND_DIR=your_path")
message(STATUS "*") message(STATUS "*")
message(STATUS "* CUPS_BACKEND_DIR = ${CUPS_BACKEND_DIR}") message(STATUS "* CUPS_BACKEND_DIR = ${CUPS_BACKEND_DIR}")
message(STATUS "* CUPS_PPD_DIR = ${CUPS_PPD_DIR}") message(STATUS "* CUPS_PPD_DIR = ${CUPS_PPD_DIR}")
message(STATUS "* DBUS_MACINE_ID_DIR = ${DBUS_MACINE_ID_DIR}") message(STATUS "* DBUS_MACINE_ID_DIR = ${DBUS_MACINE_ID_DIR}")
message(STATUS "* DBUS_SERVICE_DIR = ${DBUS_SERVICE_DIR}") message(STATUS "* DBUS_SERVICE_DIR = ${DBUS_SERVICE_DIR}")
message(STATUS "*****************************************************") message(STATUS "*****************************************************")
7 changes: 7 additions & 0 deletions cups/boomaga
@@ -1,4 +1,11 @@
#!/bin/bash #!/bin/bash
#
# Ver. @FULL_VERSION@
#
# Boomaga provides a virtual printer for CUPS.
# This can be used for print preview or for print booklets.
#



TMP_DIR="/tmp" TMP_DIR="/tmp"


Expand Down
6 changes: 1 addition & 5 deletions gui/CMakeLists.txt
Expand Up @@ -70,12 +70,8 @@ file (GLOB TS_FILES
translations/*.ts translations/*.ts
) )


set(DATA_DIR
${CMAKE_INSTALL_PREFIX}/share/boomaga
)

set(TRANSLATIONS_DIR set(TRANSLATIONS_DIR
"${DATA_DIR}/translations" "${GUI_SHARE_DIR}/translations"
) )
add_definitions(-DTRANSLATIONS_DIR=\"${TRANSLATIONS_DIR}\") add_definitions(-DTRANSLATIONS_DIR=\"${TRANSLATIONS_DIR}\")


Expand Down
34 changes: 32 additions & 2 deletions gui/main.cpp
Expand Up @@ -38,20 +38,25 @@
#include <QDebug> #include <QDebug>
#include <QProcessEnvironment> #include <QProcessEnvironment>


/************************************************
************************************************/
void printHelp() void printHelp()
{ {
QTextStream out(stdout); QTextStream out(stdout);
out << "Usage: boomaga [options] [file]" << endl; out << "Usage: boomaga [options] [file]" << endl;
out << endl; out << endl;


out << "Print poscript file as booklet" << endl; out << "Boomaga provides a virtual printer for CUPS. This can be used" << endl;
out << "for print preview or for print booklets." << endl;
out << endl; out << endl;


out << "Options:" << endl; out << "Options:" << endl;
//out << " --debug Keep output results from scripts" << endl; //out << " --debug Keep output results from scripts" << endl;
out << " -h, --help Show help about options" << endl; out << " -h, --help Show help about options" << endl;
out << " -t, --title <title> The job name/title" << endl; out << " -t, --title <title> The job name/title" << endl;
out << " -n, --num <copies> Sets the number of copies to print" << endl; out << " -n, --num <copies> Sets the number of copies to print" << endl;
out << " -V, --version Print program version" << endl;
out << endl; out << endl;


out << "Arguments:" << endl; out << "Arguments:" << endl;
Expand All @@ -60,6 +65,20 @@ void printHelp()


} }



/************************************************
************************************************/
void printVersion()
{
QTextStream out(stdout);
out << "boomaga " << FULL_VERSION << endl;
}


/************************************************
************************************************/
int printError(const QString &msg) int printError(const QString &msg)
{ {
QTextStream out(stdout); QTextStream out(stdout);
Expand All @@ -68,6 +87,10 @@ int printError(const QString &msg)
return 1; return 1;
} }



/************************************************
************************************************/
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication application(argc, argv); QApplication application(argc, argv);
Expand All @@ -92,12 +115,19 @@ int main(int argc, char *argv[])
QString arg = args.at(i); QString arg = args.at(i);


//************************************************* //*************************************************
if (arg == "--help" || arg == "-h") if (arg == "-h" || arg == "--help")
{ {
printHelp(); printHelp();
return 0; return 0;
} }


//*************************************************
if (arg == "-V" || arg == "--version")
{
printVersion();
return 0;
}

//************************************************* //*************************************************
if (arg == "-t" || arg == "--title") if (arg == "-t" || arg == "--title")
{ {
Expand Down

0 comments on commit 0b1100c

Please sign in to comment.