Skip to content

Commit 53bd594

Browse files
author
g_j_m
committedJul 12, 2006
Fix for ticket #184. Also includes some tweaks to resolve some
compiler warnings, and to avoid flushing cout unnecessarily. git-svn-id: http://svn.osgeo.org/qgis/trunk@5587 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 863c74a commit 53bd594

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed
 

‎tools/qgis_config/qgis_config.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ int main(int argc, char **argv)
6868
{"cflags", no_argument, 0, 'c'},
6969
{"libs", no_argument, 0, 'l'},
7070
{"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'},
7575
{0, 0, 0, 0}
7676
};
7777
// If no argument is given, show hint
7878
if(argc == 1)
7979
{
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";
8282
}else
8383
{
8484
// One or more arguments supplied
@@ -97,41 +97,42 @@ int main(int argc, char **argv)
9797
switch (optionChar)
9898
{
9999
case 'p':
100-
std::cout << PREFIX << std::endl;
100+
std::cout << PREFIX << '\n';
101101
break;
102102

103103
case 'b':
104-
std::cout << BIN_DIR << std::endl;
104+
std::cout << BIN_DIR << '\n';
105105
break;
106106

107107
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";
110110
break;
111111

112112
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";
115116
break;
116117

117118
case 'w':
118-
std::cout << PLUGIN_DIR << std::endl;
119+
std::cout << PLUGIN_DIR << '\n';
119120
break;
120121

121-
case 'v1':
122-
std::cout << MAJOR_VERSION << std::endl;
122+
case '1':
123+
std::cout << MAJOR_VERSION << '\n';
123124
break;
124125

125-
case 'v2':
126-
std::cout << MINOR_VERSION << std::endl;
126+
case '2':
127+
std::cout << MINOR_VERSION << '\n';
127128
break;
128129

129-
case 'v3':
130-
std::cout << MICRO_VERSION << std::endl;
130+
case '3':
131+
std::cout << MICRO_VERSION << '\n';
131132
break;
132133

133-
case 'v4':
134-
std::cout << EXTRA_VERSION << std::endl;
134+
case '4':
135+
std::cout << EXTRA_VERSION << '\n';
135136
break;
136137

137138
case 'h':
@@ -140,8 +141,7 @@ int main(int argc, char **argv)
140141
break;
141142

142143
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";
145145
return 1;
146146
}
147147
}

0 commit comments

Comments
 (0)