Skip to content

Commit a01e19e

Browse files
committed
create version.py on the fly
This allows us to specify the actual versions used for building.
1 parent 0618d27 commit a01e19e

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,7 @@ pybind11_add_module(filter
9898
install(TARGETS filter DESTINATION osmium)
9999
target_link_libraries(filter PRIVATE ${OSMIUM_LIBRARIES})
100100

101+
configure_file(cmake/version.py.tmpl version.py)
102+
install(FILES ${PROJECT_BINARY_DIR}/version.py DESTINATION osmium)
101103

102104
endif()

cmake/FindOsmium.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ find_package_handle_standard_args(Osmium
281281
REQUIRED_VARS OSMIUM_INCLUDE_DIR ${OSMIUM_EXTRA_FIND_VARS}
282282
VERSION_VAR _libosmium_version)
283283
unset(OSMIUM_EXTRA_FIND_VARS)
284+
set(OSMIUM_VERSION ${_libosmium_version})
284285

285286
#----------------------------------------------------------------------
286287
#

cmake/FindProtozero.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ include(FindPackageHandleStandardArgs)
5858
find_package_handle_standard_args(Protozero
5959
REQUIRED_VARS PROTOZERO_INCLUDE_DIR
6060
VERSION_VAR _version)
61-
61+
SET(PROTOZERO_VERSION ${_version})
6262

6363
#----------------------------------------------------------------------

cmake/version.py.tmpl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-License-Identifier: BSD-2-Clause
2+
#
3+
# This file is part of pyosmium. (https://osmcode.org/pyosmium/)
4+
#
5+
# Copyright (C) 2025 Sarah Hoffmann <[email protected]> and others.
6+
# For a full list of authors see the git log.
7+
"""
8+
Version information.
9+
"""
10+
11+
# current release (Pip version)
12+
pyosmium_release = '@SKBUILD_PROJECT_VERSION@'
13+
14+
# libosmium version used to compile this package
15+
libosmium_version = '@OSMIUM_VERSION@'
16+
# protozero version used to compile this package
17+
protozero_version = '@PROTOZERO_VERSION@'
18+
# pybind11 version shipped used to compile this package
19+
pybind11_version = '@pybind11_VERSION@'

src/osmium/version.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)