build(header_install_dir): added header_install_dir option

this option is useful for wheel builds
This commit is contained in:
2026-06-11 09:39:15 -04:00
parent caf48f4590
commit 86f10d1521
3 changed files with 9 additions and 3 deletions

View File

@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# *********************************************************************** #
project('libconstants', 'cpp', version: 'v1.1.4', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
project('libconstants', 'cpp', version: 'v1.1.5', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
# Add default visibility for all C++ targets
add_project_arguments('-fvisibility=default', language: 'cpp')

View File

@@ -1,4 +1,5 @@
option('pkg_config', type: 'boolean', value: true, description: 'generate pkg-config file for libconstants (fourdst_constants.pc)')
option('build_tests', type: 'boolean', value: true, description: 'control if tests are built or not')
option('build_examples', type: 'boolean', value: true, description: 'control if examples is built or not')
option('lib_install_dir', type: 'string', value: '', description: 'Override install dir for the shared library (used by the fourdst umbrella to place libs inside the Python package in wheel builds). Empty = default libdir.')
option('lib_install_dir', type: 'string', value: '', description: 'Override install dir for the shared library (used by the fourdst umbrella to place libs inside the Python package in wheel builds). Empty = default libdir.')
option('header_install_dir', type: 'string', value: '', description: 'Override the header install root (used by the fourdst umbrella to place headers inside the Python package in wheel builds). Empty = default includedir.')

View File

@@ -23,4 +23,9 @@ const_dep = declare_dependency(
const_headers = files(
'include/fourdst/constants/const.h'
)
install_headers(const_headers, subdir : 'fourdst/constants')
constants_header_install_dir = get_option('header_install_dir') != '' \
? get_option('header_install_dir') / 'fourdst' / 'constants' \
: get_option('includedir') / 'fourdst' / 'constants'
install_headers(const_headers, install_dir: constants_header_install_dir)