Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix #2822
git-svn-id: http://svn.osgeo.org/qgis/trunk@13792 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 23, 2010
1 parent c8247ae commit 0843999
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 43 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Expand Up @@ -234,6 +234,7 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo

IF (WIN32)
SET (DEFAULT_LIB_SUBDIR lib)
SET (DEFAULT_LIBEXEC_SUBDIR .)
SET (DEFAULT_DATA_SUBDIR .)
SET (DEFAULT_PLUGIN_SUBDIR plugins)
SET (DEFAULT_INCLUDE_SUBDIR include)
Expand Down Expand Up @@ -279,7 +280,8 @@ ELSE (WIN32)
SET (DEFAULT_BIN_SUBDIR bin)
SET (DEFAULT_LIB_SUBDIR lib${LIB_SUFFIX})
SET (DEFAULT_DATA_SUBDIR share/qgis)
SET (DEFAULT_PLUGIN_SUBDIR lib${LIB_SUFFIX}/qgis)
SET (DEFAULT_LIBEXEC_SUBDIR lib${LIB_SUFFIX}/qgis)
SET (DEFAULT_PLUGIN_SUBDIR lib${LIB_SUFFIX}/qgis/plugins)
SET (DEFAULT_INCLUDE_SUBDIR include/qgis)

ENDIF (WIN32)
Expand Down Expand Up @@ -324,17 +326,19 @@ ENDIF (WIN32)

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

# mark *_SUBDIR variables as advanced as this is not something
# that an average user would use
MARK_AS_ADVANCED (QGIS_BIN_SUBDIR QGIS_LIB_SUBDIR QGIS_DATA_SUBDIR QGIS_PLUGIN_SUBDIR QGIS_INCLUDE_SUBDIR)
MARK_AS_ADVANCED (QGIS_BIN_SUBDIR QGIS_LIB_SUBDIR QGIS_LIBEXEC_SUBDIR QGIS_DATA_SUBDIR QGIS_PLUGIN_SUBDIR QGIS_INCLUDE_SUBDIR)

# full paths for the installation
SET (QGIS_BIN_DIR ${QGIS_BIN_SUBDIR})
SET (QGIS_LIB_DIR ${QGIS_LIB_SUBDIR})
SET (QGIS_LIBEXEC_DIR ${QGIS_LIBEXEC_SUBDIR})
SET (QGIS_DATA_DIR ${QGIS_DATA_SUBDIR})
SET (QGIS_PLUGIN_DIR ${QGIS_PLUGIN_SUBDIR})
SET (QGIS_INCLUDE_DIR ${QGIS_INCLUDE_SUBDIR})
Expand Down
67 changes: 34 additions & 33 deletions cmake_templates/qgsconfig.h.in
@@ -1,33 +1,34 @@

// QGSCONFIG.H

#ifndef QGSCONFIG_H
#define QGSCONFIG_H

// Version must be specified according to
// <int>.<int>.<int>-<any text>.
// or else upgrading old project file will not work
// reliably.
#define VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${RELEASE_NAME}"

//used in vim src/core/qgis.cpp
//The way below should work but it resolves to a number like 0110 which the compiler treats as octal I think
//because debuggin it out shows the decimal number 72 which results in incorrect version status.
//As a short term fix I (Tim) am defining the version in top level cmake. It would be good to
//reinstate this more generic approach below at some point though
//#define VERSION_INT ${CPACK_PACKAGE_VERSION_MAJOR}${CPACK_PACKAGE_VERSION_MINOR}${CPACK_PACKAGE_VERSION_PATCH}
#define VERSION_INT ${QGIS_VERSION_INT}
//used in main.cpp and anywhere else where the release name is needed
#define RELEASE_NAME "${RELEASE_NAME}"

#define QGIS_PLUGIN_SUBDIR "${QGIS_PLUGIN_SUBDIR}"
#define QGIS_DATA_SUBDIR "${QGIS_DATA_SUBDIR}"

#cmakedefine HAVE_POSTGRESQL

#cmakedefine HAVE_SPATIALITE

#cmakedefine HAVE_PYTHON

#endif


// QGSCONFIG.H

#ifndef QGSCONFIG_H
#define QGSCONFIG_H

// Version must be specified according to
// <int>.<int>.<int>-<any text>.
// or else upgrading old project file will not work
// reliably.
#define VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${RELEASE_NAME}"

//used in vim src/core/qgis.cpp
//The way below should work but it resolves to a number like 0110 which the compiler treats as octal I think
//because debuggin it out shows the decimal number 72 which results in incorrect version status.
//As a short term fix I (Tim) am defining the version in top level cmake. It would be good to
//reinstate this more generic approach below at some point though
//#define VERSION_INT ${CPACK_PACKAGE_VERSION_MAJOR}${CPACK_PACKAGE_VERSION_MINOR}${CPACK_PACKAGE_VERSION_PATCH}
#define VERSION_INT ${QGIS_VERSION_INT}
//used in main.cpp and anywhere else where the release name is needed
#define RELEASE_NAME "${RELEASE_NAME}"

#define QGIS_PLUGIN_SUBDIR "${QGIS_PLUGIN_SUBDIR}"
#define QGIS_DATA_SUBDIR "${QGIS_DATA_SUBDIR}"
#define QGIS_LIBEXEC_SUBDIR "${QGIS_LIBEXEC_SUBDIR}"

#cmakedefine HAVE_POSTGRESQL

#cmakedefine HAVE_SPATIALITE

#cmakedefine HAVE_PYTHON

#endif

2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -2500,7 +2500,7 @@ void QgisApp::about()
whatsNew += "<h3>" + tr( "API Updates" ) + "</h3>";
whatsNew += "<ul>";
whatsNew += " <li>" + tr( "QgsDataProvider &amp; QgsMapLayer: add dataChanged() signal, so that a provider can signal that the datasource changed" ) + "</li>";
whatsNew += " <li>" + tr( "Use QNetworkAccessManager instead of QgsHttpTransaction (including caching and dynamic authentification to website and proxies)" ) + "</li>";
whatsNew += " <li>" + tr( "Use QNetworkAccessManager instead of QgsHttpTransaction (including caching and dynamic authentication to website and proxies)" ) + "</li>";
whatsNew += " <li>" + tr( "Allow opening layer properties from plugins" ) + "</li>";
whatsNew += " <li>" + tr( "Support for custom plugin layers." ) + "</li>";
whatsNew += " <li>" + tr( "Allow refreshing of plugins programmatically" ) + "</li>";
Expand Down
2 changes: 2 additions & 0 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -224,10 +224,12 @@ QgsRasterLayer::QgsRasterLayer( int dummy,
// TODO: Connect signals from the dataprovider to the qgisapp

// Do a passthrough for the status bar text
#if 0
connect(
mDataProvider, SIGNAL( statusChanged( QString ) ),
this, SLOT( showStatusMessage( QString ) )
);
#endif
QgsDebugMsg( "(8 arguments) exiting." );

emit statusChanged( tr( "QgsRasterLayer created" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/CMakeLists.txt
Expand Up @@ -174,6 +174,6 @@ INSTALL (FILES ${GMLS} images/world.png
DESTINATION ${QGIS_DATA_DIR}/grass)

INSTALL(TARGETS qgis.g.browser
RUNTIME DESTINATION ${QGIS_DATA_DIR}/grass/bin
RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR}/grass/bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
3 changes: 2 additions & 1 deletion src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -21,6 +21,7 @@
#include "qgsgrassprovider.h"
#include "qgsgrassutils.h"
#include "qgsgrass.h"
#include "qgsconfig.h"

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

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

// Warning: it is not useful to write requested region to WIND file and
// reset then to original beacuse it is reset before
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/grass/qgsgrassshell.cpp
Expand Up @@ -21,6 +21,7 @@
#include "qgsapplication.h"
#include "qtermwidget/qtermwidget.h"
#include "qgsgrass.h"
#include "qgsconfig.h"

#include "qgsgrassshell.h"

Expand Down Expand Up @@ -94,7 +95,7 @@ void QgsGrassShell::initTerminal( QTermWidget *terminal )
env << "TERM=vt100";
env << "GISRC_MODE_MEMORY";
// TODO: we should check if these environment variable were set by user before QGIS was started
env << "GRASS_HTML_BROWSER=" + QgsApplication::pkgDataPath() + "/grass/bin/qgis.g.browser";
env << "GRASS_HTML_BROWSER=" + QgsApplication::prefixPath() + "/" QGIS_LIBEXEC_SUBDIR "/grass/bin/qgis.g.browser";
env << "GRASS_WISH=wish";
env << "GRASS_TCLSH=tclsh";
env << "GRASS_PYTHON=python";
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/grass/qgsgrasstools.cpp
Expand Up @@ -19,6 +19,7 @@
#include "qgsgrassmodule.h"
#include "qgsgrassshell.h"
#include "qgsgrass.h"
#include "qgsconfig.h"

#include "qgisinterface.h"
#include "qgsapplication.h"
Expand Down Expand Up @@ -140,7 +141,7 @@ void QgsGrassTools::runModule( QString name )
if ( name == "shell" )
{
#ifdef WIN32
QgsGrass::putEnv( "GRASS_HTML_BROWSER", QgsApplication::pkgDataPath() + "/grass/bin/qgis.g.browser" );
QgsGrass::putEnv( "GRASS_HTML_BROWSER", QgsApplication::prefixPath() + "/" QGIS_LIBEXEC_SUBDIR "/grass/bin/qgis.g.browser" );
if ( !QProcess::startDetached( getenv( "COMSPEC" ) ) )
{
QMessageBox::warning( 0, "Warning", tr( "Cannot start command shell (%1)" ).arg( getenv( "COMSPEC" ) ) );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/CMakeLists.txt
Expand Up @@ -106,6 +106,6 @@ INSTALL(TARGETS grassrasterprovider
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})

INSTALL(TARGETS qgis.d.rast qgis.g.info
RUNTIME DESTINATION ${QGIS_DATA_DIR}/grass/modules
RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR}/grass/modules
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
3 changes: 2 additions & 1 deletion src/providers/grass/qgsgrass.cpp
Expand Up @@ -21,6 +21,7 @@
#include "qgsapplication.h"
#include "qgscoordinatereferencesystem.h"
#include "qgsrectangle.h"
#include "qgsconfig.h"

#include <QFileDialog>
#include <QMessageBox>
Expand Down Expand Up @@ -1099,7 +1100,7 @@ QString GRASS_EXPORT QgsGrass::getInfo( QString info, QString gisdbase, QString

QStringList arguments;

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

arguments.append( "info=" + info );
if ( !map.isNull() )
Expand Down
3 changes: 2 additions & 1 deletion src/providers/grass/qgsgrassrasterprovider.cpp
Expand Up @@ -21,6 +21,7 @@
#include "qgslogger.h"
#include "qgsgrass.h"
#include "qgsgrassrasterprovider.h"
#include "qgsconfig.h"

#include <math.h>

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

0 comments on commit 0843999

Please sign in to comment.