use join_paths for constructing paths in the output Config.cmake

This commit is contained in:
Woodrow Douglass 2023-05-12 11:44:24 -04:00
parent 1e41177de6
commit 010540bd2d
No known key found for this signature in database
GPG Key ID: EC0BB8B94F361E14

View File

@ -82,22 +82,22 @@ if get_option('default_library') == 'shared' or get_option('default_library') ==
cmakeconf.set('MESON_SHARED_TARGET', ''' cmakeconf.set('MESON_SHARED_TARGET', '''
add_library(jsoncpp_lib IMPORTED SHARED) add_library(jsoncpp_lib IMPORTED SHARED)
set_target_properties(jsoncpp_lib PROPERTIES set_target_properties(jsoncpp_lib PROPERTIES
IMPORTED_LOCATION "${PACKAGE_PREFIX_DIR}/''' + get_option('libdir') + '/' + shared_name + '''" IMPORTED_LOCATION "''' + join_paths('${PACKAGE_PREFIX_DIR}', get_option('libdir'), shared_name) + '''"
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/''' + get_option('includedir') + '")') INTERFACE_INCLUDE_DIRECTORIES "''' + join_paths('${PACKAGE_PREFIX_DIR}', get_option('includedir')) + '")')
endif endif
if get_option('default_library') == 'static' or get_option('default_library') == 'both' if get_option('default_library') == 'static' or get_option('default_library') == 'both'
cmakeconf.set('MESON_STATIC_TARGET', ''' cmakeconf.set('MESON_STATIC_TARGET', '''
add_library(jsoncpp_static IMPORTED STATIC) add_library(jsoncpp_static IMPORTED STATIC)
set_target_properties(jsoncpp_static PROPERTIES set_target_properties(jsoncpp_static PROPERTIES
IMPORTED_LOCATION "${PACKAGE_PREFIX_DIR}/''' + get_option('libdir') + '/' + static_name + '''" IMPORTED_LOCATION "''' + join_paths('${PACKAGE_PREFIX_DIR}', get_option('libdir'), static_name) + '''"
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/''' + get_option('includedir') + '")') INTERFACE_INCLUDE_DIRECTORIES "''' + join_paths('${PACKAGE_PREFIX_DIR}', get_option('includedir')) + '")')
endif endif
import('cmake').configure_package_config_file( import('cmake').configure_package_config_file(
name: 'jsoncpp', name: 'jsoncpp',
input: 'jsoncppConfig.cmake.meson.in', input: 'jsoncppConfig.cmake.meson.in',
configuration: cmakeconf) configuration: cmakeconf)
install_data('jsoncpp-namespaced-targets.cmake', install_dir : get_option('libdir') + '/cmake/' + jsoncpp_lib.name()) install_data('jsoncpp-namespaced-targets.cmake', install_dir : join_paths(get_option('libdir'), 'cmake', jsoncpp_lib.name()))
# for libraries bundling jsoncpp # for libraries bundling jsoncpp
jsoncpp_dep = declare_dependency( jsoncpp_dep = declare_dependency(