| 1 |
project('cmakePackagePrefixDir', 'c', version: '1.0.0') |
| 2 |
|
| 3 |
cmake = import('cmake') |
| 4 |
|
| 5 |
cmake.configure_package_config_file( |
| 6 |
name: 'cmakePackagePrefixDir', |
| 7 |
input: 'cmakePackagePrefixDirConfig.cmake.in', |
| 8 |
configuration: configuration_data(), |
| 9 |
) |
| 10 |
|
| 11 |
# NOTE: can't use fs.read because cmakePackagePrefixDirConfig.cmake is in build_dir |
| 12 |
python = find_program('python3') |
| 13 |
lines = run_command(python, '-c', |
| 14 |
'[print(line, end="") for line in open("@0@")]'.format(meson.current_build_dir() / 'cmakePackagePrefixDirConfig.cmake'), check : true, |
| 15 |
).stdout().split('\n') |
| 16 |
|
| 17 |
message(lines) |
| 18 |
|
| 19 |
assert(lines[5] == 'get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)') |