mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
introduce paths module which contains the data paths
This means that nominatim can find its data even when not called from the command line tool.
This commit is contained in:
@@ -233,7 +233,14 @@ if (BUILD_IMPORTER)
|
|||||||
install(DIRECTORY nominatim
|
install(DIRECTORY nominatim
|
||||||
DESTINATION ${NOMINATIM_LIBDIR}/lib-python
|
DESTINATION ${NOMINATIM_LIBDIR}/lib-python
|
||||||
FILES_MATCHING PATTERN "*.py"
|
FILES_MATCHING PATTERN "*.py"
|
||||||
|
PATTERN "paths.py" EXCLUDE
|
||||||
PATTERN __pycache__ EXCLUDE)
|
PATTERN __pycache__ EXCLUDE)
|
||||||
|
|
||||||
|
configure_file(${PROJECT_SOURCE_DIR}/cmake/paths-py.tmpl paths-py.installed)
|
||||||
|
install(FILES ${PROJECT_BINARY_DIR}/paths-py.installed
|
||||||
|
DESTINATION ${NOMINATIM_LIBDIR}/lib-python/nominatim
|
||||||
|
RENAME paths.py)
|
||||||
|
|
||||||
install(DIRECTORY lib-sql DESTINATION ${NOMINATIM_LIBDIR})
|
install(DIRECTORY lib-sql DESTINATION ${NOMINATIM_LIBDIR})
|
||||||
|
|
||||||
install(FILES ${COUNTRY_GRID_FILE}
|
install(FILES ${COUNTRY_GRID_FILE}
|
||||||
|
|||||||
15
cmake/paths-py.tmpl
Normal file
15
cmake/paths-py.tmpl
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
#
|
||||||
|
# This file is part of Nominatim. (https://nominatim.org)
|
||||||
|
#
|
||||||
|
# Copyright (C) 2022 by the Nominatim developer community.
|
||||||
|
# For a full list of authors see the git log.
|
||||||
|
"""
|
||||||
|
Path settings for extra data used by Nominatim (installed version).
|
||||||
|
"""
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
PHPLIB_DIR = (Path('@NOMINATIM_LIBDIR@') / 'lib-php').resolve()
|
||||||
|
SQLLIB_DIR = (Path('@NOMINATIM_LIBDIR@') / 'lib-sql').resolve()
|
||||||
|
DATA_DIR = Path('@NOMINATIM_DATADIR@').resolve()
|
||||||
|
CONFIG_DIR = Path('@NOMINATIM_CONFIGDIR@').resolve()
|
||||||
15
nominatim/paths.py
Normal file
15
nominatim/paths.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
#
|
||||||
|
# This file is part of Nominatim. (https://nominatim.org)
|
||||||
|
#
|
||||||
|
# Copyright (C) 2022 by the Nominatim developer community.
|
||||||
|
# For a full list of authors see the git log.
|
||||||
|
"""
|
||||||
|
Path settings for extra data used by Nominatim.
|
||||||
|
"""
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
PHPLIB_DIR = (Path(__file__) / '..' / '..' / 'lib-php').resolve()
|
||||||
|
SQLLIB_DIR = (Path(__file__) / '..' / '..' / 'lib-sql').resolve()
|
||||||
|
DATA_DIR = (Path(__file__) / '..' / '..' / 'data').resolve()
|
||||||
|
CONFIG_DIR = (Path(__file__) / '..' / '..' / 'settings').resolve()
|
||||||
Reference in New Issue
Block a user