| if (EXISTS "${prefix}") | |
| list(APPEND RunCMake_TEST_FAILED "Preparation ran installation.") | |
| return () | |
| endif () | |
| if (kind STREQUAL "GeneratedSource" AND | |
| NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/generated.cxx") | |
| list(APPEND RunCMake_TEST_FAILED "Preparation did not generate the module source.") | |
| return () | |
| endif () | |
| if (expect_build) | |
| set(bmi_dir "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/${module_target}.dir") | |
| if (RunCMake_GENERATOR_IS_MULTI_CONFIG) | |
| string(APPEND bmi_dir "/${config}") | |
| endif () | |
| set(bmi) | |
| foreach (ext IN ITEMS gcm ifc pcm) | |
| set(path "${bmi_dir}/importable.${ext}") | |
| if (EXISTS "${path}" AND NOT IS_DIRECTORY "${path}") | |
| set(bmi "${path}") | |
| break () | |
| endif () | |
| endforeach () | |
| if (NOT bmi) | |
| list(APPEND RunCMake_TEST_FAILED "Preparation did not build the module BMI.") | |
| return () | |
| endif () | |
| if (kind STREQUAL "BMI") | |
| set(script "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/${module_target}.dir/install-cxx-module-bmi-${config}.cmake") | |
| if (NOT EXISTS "${script}") | |
| list(APPEND RunCMake_TEST_FAILED "Preparation did not generate the BMI install script.") | |
| endif () | |
| else () | |
| file(GLOB metadata | |
| "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/Export/*/cxx-modules/target-export__interfaces-${config}.cmake") | |
| if (NOT metadata) | |
| list(APPEND RunCMake_TEST_FAILED "Preparation did not generate module export metadata.") | |
| endif () | |
| endif () | |
| else () | |
| file(GLOB_RECURSE bmis LIST_DIRECTORIES FALSE | |
| "${RunCMake_TEST_BINARY_DIR}/*.gcm" | |
| "${RunCMake_TEST_BINARY_DIR}/*.ifc" | |
| "${RunCMake_TEST_BINARY_DIR}/*.pcm") | |
| if (bmis) | |
| list(APPEND RunCMake_TEST_FAILED "Preparation built unneeded BMIs: ${bmis}") | |
| endif () | |
| endif () | |
| string(REPLACE ";" "\n " RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}") |