Skip to content

Commit

Permalink
Merge pull request #120 from rouault/fix_119
Browse files Browse the repository at this point in the history
 Add LIBGEOTIFF_MAJOR_VERSION, LIBGEOTIFF_MINOR_VERSION, LIBGEOTIFF_PATCH_VERSION, LIBGEOTIFF_REV_VERSION, and LIBGEOTIFF_STRING_VERSION variables in geotiff.h, and autogenerate it
  • Loading branch information
rouault authored Jun 14, 2024
2 parents cee338f + f2c6038 commit e00dcd6
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 30 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
export CC=cl.exe
export CXX=cl.exe
export CC=cl.exe
export CXX=cl.exe
fi
cmake -G "Ninja" \
Expand All @@ -71,6 +71,7 @@ jobs:
shell: bash -l {0}
run: |
ninja
DESTDIR=tmp-install ninja install
working-directory: ./libgeotiff/build

- name: Generate source distribution
Expand Down
25 changes: 16 additions & 9 deletions libgeotiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ SET(GEOTIFF_LIBRARY_TARGET geotiff_library)
SET(CMAKE_COLOR_MAKEFILE ON)

# Version information
set(PROJECT_VERSION_MAJOR 1)
set(PROJECT_VERSION_MINOR 7)
set(PROJECT_VERSION_PATCH 3)
set(PROJECT_VERSION
"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(GeoTIFF_VERSION ${PROJECT_VERSION})
set(LIBGEOTIFF_MAJOR_VERSION 1)
set(LIBGEOTIFF_MINOR_VERSION 7)
set(LIBGEOTIFF_PATCH_VERSION 4)
set(LIBGEOTIFF_REV_VERSION 0)

# Set library version to match that of autoconf:
# libgeotiff.so -> libgeotiff.so.5
Expand All @@ -33,9 +31,20 @@ set(GeoTIFF_VERSION ${PROJECT_VERSION})
set(LINK_SOVERSION "5")
set(LINK_VERSION "5.3.2")

set(PROJECT_VERSION_MAJOR ${LIBGEOTIFF_MAJOR_VERSION})
set(PROJECT_VERSION_MINOR ${LIBGEOTIFF_MINOR_VERSION})
set(PROJECT_VERSION_PATCH ${LIBGEOTIFF_PATCH_VERSION})
set(PROJECT_VERSION
"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")

set(LIBGEOTIFF_STRING_VERSION "${PROJECT_VERSION}")
set(LIBGEOTIFF_VERSION "${LIBGEOTIFF_MAJOR_VERSION}${LIBGEOTIFF_MINOR_VERSION}${LIBGEOTIFF_PATCH_VERSION}${LIBGEOTIFF_REV_VERSION}")

string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)

configure_file(geotiff.h.in ${CMAKE_CURRENT_BINARY_DIR}/geotiff.h @ONLY)

# Allow advanced users to generate Makefiles printing detailed commands
MARK_AS_ADVANCED(CMAKE_VERBOSE_MAKEFILE)

Expand Down Expand Up @@ -131,7 +140,7 @@ MESSAGE(STATUS "Generating geo_config.h header - done")
# Installation settings

SET(GEOTIFF_LIB_HEADERS
geotiff.h
${CMAKE_CURRENT_BINARY_DIR}/geotiff.h
geotiffio.h
geovalues.h
geonames.h
Expand Down Expand Up @@ -160,8 +169,6 @@ SET(GEOTIFF_MAN_PAGES
man/man1/geotifcp.1
man/man1/listgeo.1)

# ${PROJECT_BINARY_DIR}/geotiff_version.h

# Install doc files
if(BUILD_DOC)
INSTALL(FILES
Expand Down
15 changes: 11 additions & 4 deletions libgeotiff/HOWTO-RELEASE
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
Preparing a libgeotiff Release
==============================

1) Update the VERSION_MAJOR/MINOR/POINT information in configure.ac, and
run autogen.sh
1)
a) Update the LIBGEOTIFF_MAJOR_VERSION/LIBGEOTIFF_MINOR_VERSION/
LIBGEOTIFF_PATCH_VERSION/LIBGEOTIFF_REV_VERSION variables in configure.ac

2) Update the LIBGEOTIFF_VERSION macro in geotiff.h.
b) Update the second value of AC_INIT() in configure.ac

2) run autogen.sh

3) Update -version-info CURRENT/REVISION/AGE values in Makefile.am
- For a release with no interface changes just bump REVISION.
- Adding interfaces, bump CURRENT/AGE, set REVISION to 0.
- Deleting interfaces / compatibility issues - bump CURRENT, others to zero.

4) Update GeoTIFF_VERSION and SO_VERSION in CMakeLists.txt
4)
a) Update the LIBGEOTIFF_MAJOR_VERSION/LIBGEOTIFF_MINOR_VERSION/
LIBGEOTIFF_PATCH_VERSION/LIBGEOTIFF_REV_VERSION variables in CMakeLists

b) Update SO_VERSION in CMakeLists.txt

5) Update NEWS

Expand Down
6 changes: 3 additions & 3 deletions libgeotiff/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ endif

AM_CFLAGS = -I$(srcdir)/libxtiff $(PROJ_CFLAGS) $(TIFF_CFLAGS)

include_HEADERS = geotiff.h \
geotiffio.h \
include_HEADERS = geotiffio.h \
geovalues.h \
geonames.h \
geokeys.h \
Expand All @@ -35,7 +34,8 @@ include_HEADERS = geotiff.h \
geokeys.inc \
geokeys_v1_1.inc

nodist_include_HEADERS = geo_config.h
nodist_include_HEADERS = geotiff.h \
geo_config.h

libgeotiff_la_SOURCES = cpl_serv.c \
geo_extra.c \
Expand Down
29 changes: 18 additions & 11 deletions libgeotiff/configure.ac
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@


m4_define([VERSION_MAJOR], [1])
m4_define([VERSION_MINOR], [7])
m4_define([VERSION_POINT], [3])
m4_define([GEOTIFF_VERSION],
[VERSION_MAJOR.VERSION_MINOR.VERSION_POINT])

m4_include([m4/ax_prog_doxygen.m4])

AC_PREREQ([2.59])
AC_INIT([libgeotiff], [GEOTIFF_VERSION], [[email protected]])
AC_INIT([libgeotiff], [1.7.4], [[email protected]])
AC_CANONICAL_BUILD

AC_CONFIG_MACRO_DIR([m4])

RELEASE_VERSION=GEOTIFF_VERSION
AC_SUBST([RELEASE_VERSION])
AC_CONFIG_HEADER(geo_config.h)
LIBGEOTIFF_MAJOR_VERSION=1
LIBGEOTIFF_MINOR_VERSION=7
LIBGEOTIFF_PATCH_VERSION=4
LIBGEOTIFF_REV_VERSION=0

LIBGEOTIFF_STRING_VERSION=${LIBGEOTIFF_MAJOR_VERSION}.${LIBGEOTIFF_MINOR_VERSION}.${LIBGEOTIFF_PATCH_VERSION}
LIBGEOTIFF_VERSION="${LIBGEOTIFF_MAJOR_VERSION}${LIBGEOTIFF_MINOR_VERSION}${LIBGEOTIFF_PATCH_VERSION}${LIBGEOTIFF_REV_VERSION}"

AC_SUBST(LIBGEOTIFF_MAJOR_VERSION)
AC_SUBST(LIBGEOTIFF_MINOR_VERSION)
AC_SUBST(LIBGEOTIFF_PATCH_VERSION)
AC_SUBST(LIBGEOTIFF_REV_VERSION)
AC_SUBST(LIBGEOTIFF_STRING_VERSION)
AC_SUBST(LIBGEOTIFF_VERSION)

AC_CONFIG_HEADERS([geo_config.h])
AC_CONFIG_FILES([geotiff.h])

dnl #########################################################################
dnl Checks for programs.
Expand Down
8 changes: 7 additions & 1 deletion libgeotiff/geotiff.h → libgeotiff/geotiff.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@
#define GEOTIFF_SPEC_1_1_MINOR_REVISION 1

/* Library version */
#define LIBGEOTIFF_VERSION 1740
/* LIBGEOTIFF_MAJOR_VERSION, LIBGEOTIFF_MINOR_VERSION, LIBGEOTIFF_PATCH_VERSION, LIBGEOTIFF_REV_VERSION and LIBGEOTIFF_STRING_VERSION are new since libgeotiff 1.7.4. Only LIBGEOTIFF_VERSION pre-existed */
#define LIBGEOTIFF_MAJOR_VERSION @LIBGEOTIFF_MAJOR_VERSION@
#define LIBGEOTIFF_MINOR_VERSION @LIBGEOTIFF_MINOR_VERSION@
#define LIBGEOTIFF_PATCH_VERSION @LIBGEOTIFF_PATCH_VERSION@
#define LIBGEOTIFF_REV_VERSION @LIBGEOTIFF_REV_VERSION@
#define LIBGEOTIFF_VERSION @LIBGEOTIFF_VERSION@
#define LIBGEOTIFF_STRING_VERSION "@LIBGEOTIFF_STRING_VERSION@"

#include "geo_config.h"
#include "geokeys.h"
Expand Down

0 comments on commit e00dcd6

Please sign in to comment.