set(pch_header "CMakeFiles/tgt.dir/cmake_pch.hxx") set(pch_source [=[CMakeFiles\\tgt.dir\\cmake_pch.cxx]=]) if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/${pch_header}") set(RunCMake_TEST_FAILED "Generated PCH header ${pch_header} does not exist.") return() endif() if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/${pch_source}") set(RunCMake_TEST_FAILED "Generated PCH header ${pch_source} does not exist.") return() endif() set(tgt_project "${RunCMake_TEST_BINARY_DIR}/tgt.vcxproj") if (NOT EXISTS "${tgt_project}") set(RunCMake_TEST_FAILED "Generated project file ${tgt_project} doesn't exist.") return() endif() file(STRINGS ${tgt_project} tgt_projects_strings) foreach(line IN LISTS tgt_projects_strings) if (line MATCHES "Use") set(have_pch_use ON) endif() if (line MATCHES "Create") set(have_pch_create ON) endif() if (line MATCHES ".*${pch_header}") set(have_pch_header ON) endif() if (line MATCHES ".*${pch_header}.*") set(have_force_pch_header ON) endif() if (line MATCHES "") set(have_pch_source_compile ON) endif() endforeach() if (NOT have_pch_use) set(RunCMake_TEST_FAILED "Generated project should have the Use block.") return() endif() if (NOT have_pch_create) set(RunCMake_TEST_FAILED "Generated project should have the Create block.") return() endif() if (NOT have_pch_header) set(RunCMake_TEST_FAILED "Generated project should have the ${pch_header} block.") return() endif() if (NOT have_force_pch_header) set(RunCMake_TEST_FAILED "Generated project should have the ${pch_header} block.") return() endif() if (NOT have_pch_source_compile) set(RunCMake_TEST_FAILED "Generated project should have the block.") return() endif()