Skip to content

Commit 0843999

Browse files
author
jef
committed
fix #2822
git-svn-id: http://svn.osgeo.org/qgis/trunk@13792 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent c8247ae commit 0843999

File tree

11 files changed

+55
-43
lines changed

11 files changed

+55
-43
lines changed

CMakeLists.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo
234234

235235
IF (WIN32)
236236
SET (DEFAULT_LIB_SUBDIR lib)
237+
SET (DEFAULT_LIBEXEC_SUBDIR .)
237238
SET (DEFAULT_DATA_SUBDIR .)
238239
SET (DEFAULT_PLUGIN_SUBDIR plugins)
239240
SET (DEFAULT_INCLUDE_SUBDIR include)
@@ -279,7 +280,8 @@ ELSE (WIN32)
279280
SET (DEFAULT_BIN_SUBDIR bin)
280281
SET (DEFAULT_LIB_SUBDIR lib${LIB_SUFFIX})
281282
SET (DEFAULT_DATA_SUBDIR share/qgis)
282-
SET (DEFAULT_PLUGIN_SUBDIR lib${LIB_SUFFIX}/qgis)
283+
SET (DEFAULT_LIBEXEC_SUBDIR lib${LIB_SUFFIX}/qgis)
284+
SET (DEFAULT_PLUGIN_SUBDIR lib${LIB_SUFFIX}/qgis/plugins)
283285
SET (DEFAULT_INCLUDE_SUBDIR include/qgis)
284286

285287
ENDIF (WIN32)
@@ -324,17 +326,19 @@ ENDIF (WIN32)
324326

325327
SET (QGIS_BIN_SUBDIR ${DEFAULT_BIN_SUBDIR} CACHE STRING "Subdirectory where executables will be installed")
326328
SET (QGIS_LIB_SUBDIR ${DEFAULT_LIB_SUBDIR} CACHE STRING "Subdirectory where libraries will be installed")
329+
SET (QGIS_LIBEXEC_SUBDIR ${DEFAULT_LIBEXEC_SUBDIR} CACHE STRING "Subdirectory where private executables will be installed")
327330
SET (QGIS_DATA_SUBDIR ${DEFAULT_DATA_SUBDIR} CACHE STRING "Subdirectory where QGIS data will be installed")
328331
SET (QGIS_PLUGIN_SUBDIR ${DEFAULT_PLUGIN_SUBDIR} CACHE STRING "Subdirectory where plugins will be installed")
329332
SET (QGIS_INCLUDE_SUBDIR ${DEFAULT_INCLUDE_SUBDIR} CACHE STRING "Subdirectory where header files will be installed")
330333

331334
# mark *_SUBDIR variables as advanced as this is not something
332335
# that an average user would use
333-
MARK_AS_ADVANCED (QGIS_BIN_SUBDIR QGIS_LIB_SUBDIR QGIS_DATA_SUBDIR QGIS_PLUGIN_SUBDIR QGIS_INCLUDE_SUBDIR)
336+
MARK_AS_ADVANCED (QGIS_BIN_SUBDIR QGIS_LIB_SUBDIR QGIS_LIBEXEC_SUBDIR QGIS_DATA_SUBDIR QGIS_PLUGIN_SUBDIR QGIS_INCLUDE_SUBDIR)
334337

335338
# full paths for the installation
336339
SET (QGIS_BIN_DIR ${QGIS_BIN_SUBDIR})
337340
SET (QGIS_LIB_DIR ${QGIS_LIB_SUBDIR})
341+
SET (QGIS_LIBEXEC_DIR ${QGIS_LIBEXEC_SUBDIR})
338342
SET (QGIS_DATA_DIR ${QGIS_DATA_SUBDIR})
339343
SET (QGIS_PLUGIN_DIR ${QGIS_PLUGIN_SUBDIR})
340344
SET (QGIS_INCLUDE_DIR ${QGIS_INCLUDE_SUBDIR})

cmake_templates/qgsconfig.h.in

+34-33
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
2-
// QGSCONFIG.H
3-
4-
#ifndef QGSCONFIG_H
5-
#define QGSCONFIG_H
6-
7-
// Version must be specified according to
8-
// <int>.<int>.<int>-<any text>.
9-
// or else upgrading old project file will not work
10-
// reliably.
11-
#define VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${RELEASE_NAME}"
12-
13-
//used in vim src/core/qgis.cpp
14-
//The way below should work but it resolves to a number like 0110 which the compiler treats as octal I think
15-
//because debuggin it out shows the decimal number 72 which results in incorrect version status.
16-
//As a short term fix I (Tim) am defining the version in top level cmake. It would be good to
17-
//reinstate this more generic approach below at some point though
18-
//#define VERSION_INT ${CPACK_PACKAGE_VERSION_MAJOR}${CPACK_PACKAGE_VERSION_MINOR}${CPACK_PACKAGE_VERSION_PATCH}
19-
#define VERSION_INT ${QGIS_VERSION_INT}
20-
//used in main.cpp and anywhere else where the release name is needed
21-
#define RELEASE_NAME "${RELEASE_NAME}"
22-
23-
#define QGIS_PLUGIN_SUBDIR "${QGIS_PLUGIN_SUBDIR}"
24-
#define QGIS_DATA_SUBDIR "${QGIS_DATA_SUBDIR}"
25-
26-
#cmakedefine HAVE_POSTGRESQL
27-
28-
#cmakedefine HAVE_SPATIALITE
29-
30-
#cmakedefine HAVE_PYTHON
31-
32-
#endif
33-
1+
2+
// QGSCONFIG.H
3+
4+
#ifndef QGSCONFIG_H
5+
#define QGSCONFIG_H
6+
7+
// Version must be specified according to
8+
// <int>.<int>.<int>-<any text>.
9+
// or else upgrading old project file will not work
10+
// reliably.
11+
#define VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${RELEASE_NAME}"
12+
13+
//used in vim src/core/qgis.cpp
14+
//The way below should work but it resolves to a number like 0110 which the compiler treats as octal I think
15+
//because debuggin it out shows the decimal number 72 which results in incorrect version status.
16+
//As a short term fix I (Tim) am defining the version in top level cmake. It would be good to
17+
//reinstate this more generic approach below at some point though
18+
//#define VERSION_INT ${CPACK_PACKAGE_VERSION_MAJOR}${CPACK_PACKAGE_VERSION_MINOR}${CPACK_PACKAGE_VERSION_PATCH}
19+
#define VERSION_INT ${QGIS_VERSION_INT}
20+
//used in main.cpp and anywhere else where the release name is needed
21+
#define RELEASE_NAME "${RELEASE_NAME}"
22+
23+
#define QGIS_PLUGIN_SUBDIR "${QGIS_PLUGIN_SUBDIR}"
24+
#define QGIS_DATA_SUBDIR "${QGIS_DATA_SUBDIR}"
25+
#define QGIS_LIBEXEC_SUBDIR "${QGIS_LIBEXEC_SUBDIR}"
26+
27+
#cmakedefine HAVE_POSTGRESQL
28+
29+
#cmakedefine HAVE_SPATIALITE
30+
31+
#cmakedefine HAVE_PYTHON
32+
33+
#endif
34+

src/app/qgisapp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2500,7 +2500,7 @@ void QgisApp::about()
25002500
whatsNew += "<h3>" + tr( "API Updates" ) + "</h3>";
25012501
whatsNew += "<ul>";
25022502
whatsNew += " <li>" + tr( "QgsDataProvider &amp; QgsMapLayer: add dataChanged() signal, so that a provider can signal that the datasource changed" ) + "</li>";
2503-
whatsNew += " <li>" + tr( "Use QNetworkAccessManager instead of QgsHttpTransaction (including caching and dynamic authentification to website and proxies)" ) + "</li>";
2503+
whatsNew += " <li>" + tr( "Use QNetworkAccessManager instead of QgsHttpTransaction (including caching and dynamic authentication to website and proxies)" ) + "</li>";
25042504
whatsNew += " <li>" + tr( "Allow opening layer properties from plugins" ) + "</li>";
25052505
whatsNew += " <li>" + tr( "Support for custom plugin layers." ) + "</li>";
25062506
whatsNew += " <li>" + tr( "Allow refreshing of plugins programmatically" ) + "</li>";

src/core/raster/qgsrasterlayer.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,12 @@ QgsRasterLayer::QgsRasterLayer( int dummy,
224224
// TODO: Connect signals from the dataprovider to the qgisapp
225225

226226
// Do a passthrough for the status bar text
227+
#if 0
227228
connect(
228229
mDataProvider, SIGNAL( statusChanged( QString ) ),
229230
this, SLOT( showStatusMessage( QString ) )
230231
);
232+
#endif
231233
QgsDebugMsg( "(8 arguments) exiting." );
232234

233235
emit statusChanged( tr( "QgsRasterLayer created" ) );

src/plugins/grass/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,6 @@ INSTALL (FILES ${GMLS} images/world.png
174174
DESTINATION ${QGIS_DATA_DIR}/grass)
175175

176176
INSTALL(TARGETS qgis.g.browser
177-
RUNTIME DESTINATION ${QGIS_DATA_DIR}/grass/bin
177+
RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR}/grass/bin
178178
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
179179
)

src/plugins/grass/qgsgrassmodule.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "qgsgrassprovider.h"
2222
#include "qgsgrassutils.h"
2323
#include "qgsgrass.h"
24+
#include "qgsconfig.h"
2425

2526
#include "qgisinterface.h"
2627
#include "qgsapplication.h"
@@ -1302,7 +1303,7 @@ void QgsGrassModule::run()
13021303
mOutputTextBrowser->append( "<B>" + commandHtml + "</B>" );
13031304

13041305
QStringList environment = QProcess::systemEnvironment();
1305-
environment.append( "GRASS_HTML_BROWSER=" + QgsApplication::pkgDataPath() + "/grass/bin/qgis.g.browser" );
1306+
environment.append( "GRASS_HTML_BROWSER=" + QgsApplication::prefixPath() + "/" QGIS_LIBEXEC_SUBDIR "/grass/bin/qgis.g.browser" );
13061307

13071308
// Warning: it is not useful to write requested region to WIND file and
13081309
// reset then to original beacuse it is reset before

src/plugins/grass/qgsgrassshell.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "qgsapplication.h"
2222
#include "qtermwidget/qtermwidget.h"
2323
#include "qgsgrass.h"
24+
#include "qgsconfig.h"
2425

2526
#include "qgsgrassshell.h"
2627

@@ -94,7 +95,7 @@ void QgsGrassShell::initTerminal( QTermWidget *terminal )
9495
env << "TERM=vt100";
9596
env << "GISRC_MODE_MEMORY";
9697
// TODO: we should check if these environment variable were set by user before QGIS was started
97-
env << "GRASS_HTML_BROWSER=" + QgsApplication::pkgDataPath() + "/grass/bin/qgis.g.browser";
98+
env << "GRASS_HTML_BROWSER=" + QgsApplication::prefixPath() + "/" QGIS_LIBEXEC_SUBDIR "/grass/bin/qgis.g.browser";
9899
env << "GRASS_WISH=wish";
99100
env << "GRASS_TCLSH=tclsh";
100101
env << "GRASS_PYTHON=python";

src/plugins/grass/qgsgrasstools.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "qgsgrassmodule.h"
2020
#include "qgsgrassshell.h"
2121
#include "qgsgrass.h"
22+
#include "qgsconfig.h"
2223

2324
#include "qgisinterface.h"
2425
#include "qgsapplication.h"
@@ -140,7 +141,7 @@ void QgsGrassTools::runModule( QString name )
140141
if ( name == "shell" )
141142
{
142143
#ifdef WIN32
143-
QgsGrass::putEnv( "GRASS_HTML_BROWSER", QgsApplication::pkgDataPath() + "/grass/bin/qgis.g.browser" );
144+
QgsGrass::putEnv( "GRASS_HTML_BROWSER", QgsApplication::prefixPath() + "/" QGIS_LIBEXEC_SUBDIR "/grass/bin/qgis.g.browser" );
144145
if ( !QProcess::startDetached( getenv( "COMSPEC" ) ) )
145146
{
146147
QMessageBox::warning( 0, "Warning", tr( "Cannot start command shell (%1)" ).arg( getenv( "COMSPEC" ) ) );

src/providers/grass/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@ INSTALL(TARGETS grassrasterprovider
106106
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
107107

108108
INSTALL(TARGETS qgis.d.rast qgis.g.info
109-
RUNTIME DESTINATION ${QGIS_DATA_DIR}/grass/modules
109+
RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR}/grass/modules
110110
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
111111
)

src/providers/grass/qgsgrass.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "qgsapplication.h"
2222
#include "qgscoordinatereferencesystem.h"
2323
#include "qgsrectangle.h"
24+
#include "qgsconfig.h"
2425

2526
#include <QFileDialog>
2627
#include <QMessageBox>
@@ -1099,7 +1100,7 @@ QString GRASS_EXPORT QgsGrass::getInfo( QString info, QString gisdbase, QString
10991100

11001101
QStringList arguments;
11011102

1102-
QString cmd = QgsApplication::pkgDataPath() + "/grass/modules/qgis.g.info";
1103+
QString cmd = QgsApplication::prefixPath() + "/" QGIS_LIBEXEC_SUBDIR "/grass/modules/qgis.g.info";
11031104

11041105
arguments.append( "info=" + info );
11051106
if ( !map.isNull() )

src/providers/grass/qgsgrassrasterprovider.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "qgslogger.h"
2222
#include "qgsgrass.h"
2323
#include "qgsgrassrasterprovider.h"
24+
#include "qgsconfig.h"
2425

2526
#include <math.h>
2627

@@ -98,7 +99,7 @@ QImage* QgsGrassRasterProvider::draw( QgsRectangle const & viewExtent, int pixe
9899
.arg( viewExtent.xMaximum() ).arg( viewExtent.yMaximum() )
99100
.arg( pixelWidth ).arg( pixelHeight ) ) );
100101
QProcess process( this );
101-
QString cmd = QgsApplication::pkgDataPath() + "/grass/modules/qgis.d.rast";
102+
QString cmd = QgsApplication::prefixPath() + "/" QGIS_LIBEXEC_SUBDIR "/grass/modules/qgis.d.rast";
102103
QByteArray data;
103104
try
104105
{

0 commit comments

Comments
 (0)