Skip to content

Commit 7454d87

Browse files
committedApr 13, 2016
doxygen: include sha in PROJECT_NUMBER
1 parent e023363 commit 7454d87

File tree

6 files changed

+91
-55
lines changed

6 files changed

+91
-55
lines changed
 

‎CMakeLists.txt

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,44 @@ ENDIF (APPLE)
1616

1717
# Note the version no is Mmmpp for Major/minor/patch, 0-padded, thus '10100' for 1.1.0
1818
MATH(EXPR QGIS_VERSION_INT "${CPACK_PACKAGE_VERSION_MAJOR}*10000+${CPACK_PACKAGE_VERSION_MINOR}*100+${CPACK_PACKAGE_VERSION_PATCH}")
19-
MESSAGE(STATUS "QGIS version: ${COMPLETE_VERSION} ${RELEASE_NAME} (${QGIS_VERSION_INT})")
19+
20+
#############################################################
21+
# create qgsversion.h
22+
IF (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
23+
FIND_PROGRAM(GITCOMMAND git PATHS c:/cygwin/bin)
24+
IF(GITCOMMAND)
25+
IF(WIN32)
26+
ADD_CUSTOM_COMMAND(
27+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
28+
COMMAND for /f \"usebackq tokens=1\" %%a in "(`\"${GITCOMMAND}\" log -n1 --oneline`)" do echo \#define QGSVERSION \"%%a\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h.temp
29+
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h.temp -DDST=${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
30+
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/.git/index
31+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
32+
)
33+
ELSE(WIN32)
34+
ADD_CUSTOM_COMMAND(
35+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
36+
COMMAND ${GITCOMMAND} log -n1 --pretty=\#define\\ QGSVERSION\\ \\"%h\\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h.temp
37+
COMMAND ${GITCOMMAND} config remote.$$\(${GITCOMMAND} config branch.$$\(${GITCOMMAND} name-rev --name-only HEAD\).remote\).url | sed -e 's/^/\#define QGS_GIT_REMOTE_URL \"/' -e 's/$$/\"/' >>${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h.temp
38+
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h.temp -DDST=${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
39+
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/.git/index
40+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
41+
)
42+
ENDIF(WIN32)
43+
ELSE(GITCOMMAND)
44+
MESSAGE(STATUS "git marker, but no git found - version will be unknown")
45+
SET(REVISION "unknown")
46+
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"unknown\"")
47+
ENDIF(GITCOMMAND)
48+
ELSE (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
49+
SET(REVISION "exported")
50+
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"exported\"")
51+
ENDIF (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
52+
53+
FILE(READ ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h VERSIONFILE)
54+
STRING(REGEX REPLACE "^.*#define QGSVERSION \"([^\"]+)\".*$" "\\1" QGSVERSION "${VERSIONFILE}")
55+
56+
MESSAGE(STATUS "QGIS version: ${COMPLETE_VERSION} ${RELEASE_NAME} (${QGIS_VERSION_INT} / ${QGSVERSION})")
2057

2158
#############################################################
2259
# CMake settings
@@ -735,39 +772,6 @@ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
735772
# that may be in the same install prefix
736773
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/src/core ${CMAKE_BINARY_DIR}/src/gui)
737774

738-
#############################################################
739-
# create qgsversion.h
740-
IF (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
741-
FIND_PROGRAM(GITCOMMAND git PATHS c:/cygwin/bin)
742-
IF(GITCOMMAND)
743-
IF(WIN32)
744-
ADD_CUSTOM_COMMAND(
745-
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
746-
COMMAND for /f \"usebackq tokens=1\" %%a in "(`\"${GITCOMMAND}\" log -n1 --oneline`)" do echo \#define QGSVERSION \"%%a\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h.temp
747-
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h.temp -DDST=${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
748-
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/.git/index
749-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
750-
)
751-
ELSE(WIN32)
752-
ADD_CUSTOM_COMMAND(
753-
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
754-
COMMAND ${GITCOMMAND} log -n1 --pretty=\#define\\ QGSVERSION\\ \\"%h\\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h.temp
755-
COMMAND ${GITCOMMAND} config remote.$$\(${GITCOMMAND} config branch.$$\(${GITCOMMAND} name-rev --name-only HEAD\).remote\).url | sed -e 's/^/\#define QGS_GIT_REMOTE_URL \"/' -e 's/$$/\"/' >>${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h.temp
756-
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h.temp -DDST=${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
757-
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/.git/index
758-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
759-
)
760-
ENDIF(WIN32)
761-
ELSE(GITCOMMAND)
762-
MESSAGE(STATUS "git marker, but no git found - version will be unknown")
763-
SET(REVISION "unknown")
764-
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"unknown\"")
765-
ENDIF(GITCOMMAND)
766-
ELSE (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
767-
SET(REVISION "exported")
768-
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"exported\"")
769-
ENDIF (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
770-
771775
ADD_CUSTOM_TARGET(version ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h)
772776

773777
#############################################################

‎cmake_templates/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PROJECT_NAME = "QGIS API Documentation"
3131
# This could be handy for archiving the generated documentation or
3232
# if some version control system is used.
3333

34-
PROJECT_NUMBER = "@COMPLETE_VERSION@-@RELEASE_NAME@"
34+
PROJECT_NUMBER = "@COMPLETE_VERSION@-@RELEASE_NAME@ (@QGSVERSION@)"
3535

3636
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
3737
# base path where the generated documentation will be put.

‎python/core/dxf/qgsdxfexport.sip

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class QgsDxfExport
117117
* Get DXF palette index of nearest entry for given color
118118
* @param color
119119
*/
120-
static int closestColorMatch( QRgb pixel );
120+
static int closestColorMatch( QRgb color );
121121

122122
/**
123123
* Get layer name for feature
@@ -270,4 +270,20 @@ class QgsDxfExport
270270
//! return list of available DXF encodings
271271
static QStringList encodings();
272272

273+
/** Output the label
274+
* @param layerId id of the layer
275+
* @param context render context
276+
* @param label position of label
277+
* @param settings label settings
278+
* @note not available in Python bindings
279+
*/
280+
// void drawLabel( QString layerId, QgsRenderContext& context, pal::LabelPosition* label, const QgsPalLayerSettings &settings );
281+
282+
/** Register name of layer for feature
283+
* @param layerId id of layer
284+
* @param fid id of feature
285+
* @param layer dxf layer of feature
286+
*/
287+
void registerDxfLayer( QString layerId, QgsFeatureId fid, QString layer );
288+
273289
};

‎src/core/dxf/qgsdxfexport.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,20 @@ class CORE_EXPORT QgsDxfExport
290290
//! return list of available DXF encodings
291291
static QStringList encodings();
292292

293-
//! output the label
293+
/** Output the label
294+
* @param layerId id of the layer
295+
* @param context render context
296+
* @param label position of label
297+
* @param settings label settings
298+
* @note not available in Python bindings
299+
*/
294300
void drawLabel( QString layerId, QgsRenderContext& context, pal::LabelPosition* label, const QgsPalLayerSettings &settings );
295301

296-
//! register name of layer for feature
302+
/** Register name of layer for feature
303+
* @param layerId id of layer
304+
* @param fid id of feature
305+
* @param layer dxf layer of feature
306+
*/
297307
void registerDxfLayer( QString layerId, QgsFeatureId fid, QString layer );
298308

299309
private:

‎src/core/dxf/qgsdxfpallabeling.h

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ class QgsDxfLabelProvider : public QgsVectorLayerLabelProvider
3939
//! construct the provider
4040
explicit QgsDxfLabelProvider( QgsVectorLayer* layer, QgsDxfExport* dxf, const QgsPalLayerSettings *settings );
4141

42-
//! re-implementation that writes to DXF file instead of drawing with QPainter
43-
// @param context render context
44-
// @param label label
42+
/** Re-implementation that writes to DXF file instead of drawing with QPainter
43+
* @param context render context
44+
* @param label label
45+
*/
4546
void drawLabel( QgsRenderContext& context, pal::LabelPosition* label ) const override;
4647

47-
//! registration method that keeps track of DXF layer names of individual features
48-
// @param feature feature
49-
// @param context render context
50-
// @param dxfLayerName name of dxf layer
48+
/** Registration method that keeps track of DXF layer names of individual features
49+
* @param feature feature
50+
* @param context render context
51+
* @param dxfLayerName name of dxf layer
52+
*/
5153
void registerDxfFeature( QgsFeature& feature, QgsRenderContext &context, const QString& dxfLayerName );
5254

5355
protected:
@@ -67,19 +69,22 @@ class QgsDxfRuleBasedLabelProvider : public QgsRuleBasedLabelProvider
6769
//! construct the provider
6870
explicit QgsDxfRuleBasedLabelProvider( const QgsRuleBasedLabeling &rules, QgsVectorLayer* layer, QgsDxfExport* dxf );
6971

70-
//! reinitialize the subproviders with QgsDxfLabelProviders
71-
//@param layer layer
72+
/** Reinitialize the subproviders with QgsDxfLabelProviders
73+
* @param layer layer
74+
*/
7275
void reinit( QgsVectorLayer* layer );
7376

74-
//! re-implementation that writes to DXF file instead of drawing with QPainter
75-
// @param context render context
76-
// @param label label
77+
/** Re-implementation that writes to DXF file instead of drawing with QPainter
78+
* @param context render context
79+
* @param label label
80+
*/
7781
void drawLabel( QgsRenderContext &context, pal::LabelPosition *label ) const override;
7882

79-
//! registration method that keeps track of DXF layer names of individual features
80-
// @param feature feature
81-
// @param context render context
82-
// @param dxfLayerName name of dxf layer
83+
/** Registration method that keeps track of DXF layer names of individual features
84+
* @param feature feature
85+
* @param context render context
86+
* @param dxfLayerName name of dxf layer
87+
*/
8388
void registerDxfFeature( QgsFeature& feature, QgsRenderContext &context, const QString& dxfLayerName );
8489

8590
//! create QgsDxfLabelProvider

‎src/core/qgsrulebasedlabeling.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,10 @@ class CORE_EXPORT QgsRuleBasedLabelProvider : public QgsVectorLayerLabelProvider
310310

311311
virtual void registerFeature( QgsFeature& feature, QgsRenderContext& context, QgsGeometry* obstacleGeometry = nullptr ) override;
312312

313-
// new methods
313+
//! create a label provider
314314
virtual QgsVectorLayerLabelProvider *createProvider( QgsVectorLayer *layer, bool withFeatureLoop, const QgsPalLayerSettings *settings );
315315

316+
//! return subproviders
316317
virtual QList<QgsAbstractLabelProvider*> subProviders() override;
317318

318319
protected:

0 commit comments

Comments
 (0)
Please sign in to comment.