~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to tools/qgis_config/qgis_config.cpp

  • Committer: Bazaar Package Importer
  • Author(s): William Grant
  • Date: 2007-05-06 13:42:32 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070506134232-pyli6t388w5asd8x
Tags: 0.8.0-3ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules, debian/qgis.install, debian/qgis.dirs debian/qgis.desktop:
    Add and install .desktop.
* debian/qgis.desktop: Remove Applications category; it's not real.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *   (at your option) any later version.                                   *
19
19
 *                                                                         *
20
20
 ***************************************************************************/
21
 
/*  $Id: qgis_config.cpp,v 1.3 2004/05/05 19:29:13 jobi Exp $ */
 
21
/*  $Id: qgis_config.cpp 5587 2006-07-12 09:48:06Z g_j_m $ */
22
22
 
23
23
#include <iostream>
24
24
#include <getopt.h>
68
68
    {"cflags", no_argument, 0, 'c'},
69
69
    {"libs", no_argument, 0, 'l'},
70
70
    {"plugindir", no_argument, 0, 'w'},
71
 
    {"major_version", no_argument, 0, 'v1'},
72
 
    {"minor_version", no_argument, 0, 'v2'},
73
 
    {"micro_version", no_argument, 0, 'v3'},
74
 
    {"extra_version", no_argument, 0, 'v4'},
 
71
    {"major_version", no_argument, 0, '1'},
 
72
    {"minor_version", no_argument, 0, '2'},
 
73
    {"micro_version", no_argument, 0, '3'},
 
74
    {"extra_version", no_argument, 0, '4'},
75
75
    {0, 0, 0, 0}
76
76
  };
77
77
  // If no argument is given, show hint
78
78
  if(argc == 1)
79
79
  {
80
 
    std::cout << "qgis_config: argument required" << std::endl; 
81
 
    std::cout << "Try \"qgis_config --help\" for more information." << std::endl; 
 
80
    std::cout << "qgis_config: argument required\n" 
 
81
              << "Try \"qgis_config --help\" for more information.\n";
82
82
  }else
83
83
  {
84
84
    // One or more arguments supplied
97
97
      switch (optionChar)
98
98
      {
99
99
        case 'p':
100
 
          std::cout << PREFIX << std::endl; 
 
100
          std::cout << PREFIX << '\n'; 
101
101
          break;
102
102
 
103
103
        case 'b':
104
 
          std::cout << BIN_DIR << std::endl; 
 
104
          std::cout << BIN_DIR << '\n'; 
105
105
          break;
106
106
 
107
107
        case 'c':
108
 
          std::cout << "-I" << INCLUDE_DIR << " ";
109
 
                                        std::cout << "-I" << INCLUDE_DIR << "/qgis" << std::endl; 
 
108
          std::cout << "-I" << INCLUDE_DIR << " "
 
109
                    << "-I" << INCLUDE_DIR << "/qgis\n"; 
110
110
          break;
111
111
 
112
112
        case 'l':
113
 
          std::cout << "-L" << LIB_DIR << " ";
114
 
                                        std::cout << " -lqgis" << std::endl; 
 
113
          std::cout << "-L" << LIB_DIR 
 
114
                    << " -lqgis_core -lqgis_gui -lqgis_composer"
 
115
                    << " -lqgisgrass -lqgis_legend -lqgis_raster\n";
115
116
          break;
116
117
 
117
118
        case 'w':
118
 
          std::cout << PLUGIN_DIR << std::endl; 
119
 
          break;
120
 
 
121
 
        case 'v1':
122
 
          std::cout << MAJOR_VERSION << std::endl; 
123
 
          break;
124
 
 
125
 
        case 'v2':
126
 
          std::cout << MINOR_VERSION << std::endl; 
127
 
          break;
128
 
 
129
 
        case 'v3':
130
 
          std::cout << MICRO_VERSION << std::endl; 
131
 
          break;
132
 
 
133
 
        case 'v4':
134
 
          std::cout << EXTRA_VERSION << std::endl; 
 
119
          std::cout << PLUGIN_DIR << '\n'; 
 
120
          break;
 
121
 
 
122
        case '1':
 
123
          std::cout << MAJOR_VERSION << '\n'; 
 
124
          break;
 
125
 
 
126
        case '2':
 
127
          std::cout << MINOR_VERSION << '\n'; 
 
128
          break;
 
129
 
 
130
        case '3':
 
131
          std::cout << MICRO_VERSION << '\n'; 
 
132
          break;
 
133
 
 
134
        case '4':
 
135
          std::cout << EXTRA_VERSION << '\n'; 
135
136
          break;
136
137
 
137
138
        case 'h':
140
141
          break;
141
142
 
142
143
        default:
143
 
          std::cout << "Try \"qgis_config --help\" for more information." 
144
 
            << std::endl; 
 
144
          std::cout << "Try \"qgis_config --help\" for more information.\n"; 
145
145
          return 1;  
146
146
      }
147
147
    }