Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Tests / RunCMake / CXXModules / ExportInstallCxxModules-check.cmake
1 file(READ "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/Export/eee57a7e91412f1be699e9b63fa9d601/exp.cmake" export_script)
2
3 if (NOT export_script MATCHES [[include\("\${CMAKE_CURRENT_LIST_DIR}/cxx-modules/cxx-modules\.cmake"\)]])
4   list(APPEND RunCMake_TEST_FAILED
5     "Could not find C++ module property script inclusion")
6 endif ()
7
8 file(READ "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/Export/eee57a7e91412f1be699e9b63fa9d601/cxx-modules/cxx-modules.cmake" trampoline_script)
9
10 if (NOT trampoline_script MATCHES [[file\(GLOB _cmake_cxx_module_includes "\${CMAKE_CURRENT_LIST_DIR}/cxx-modules-\*\.cmake"\)]])
11   list(APPEND RunCMake_TEST_FAILED
12     "Could not find C++ module property per-config script inclusion(s)")
13 endif ()
14
15 set(any_exists 0)
16 foreach (config IN ITEMS noconfig Debug Release RelWithDebInfo MinSizeRel)
17   if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/Export/eee57a7e91412f1be699e9b63fa9d601/cxx-modules/cxx-modules-${config}.cmake")
18     continue ()
19   endif ()
20   set(any_exists 1)
21
22   file(READ "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/Export/eee57a7e91412f1be699e9b63fa9d601/cxx-modules/cxx-modules-${config}.cmake" config_script)
23
24   if (NOT config_script MATCHES "include\\(\"\\\${CMAKE_CURRENT_LIST_DIR}/target-export-name-${config}\\.cmake\"\\)")
25     list(APPEND RunCMake_TEST_FAILED
26       "Could not find C++ module per-target property script inclusion")
27   endif ()
28 endforeach ()
29
30 if (NOT any_exists)
31   list(APPEND RunCMake_TEST_FAILED
32     "No per-configuration target files exist.")
33 endif ()
34
35 string(REPLACE ";" "; " RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}")