CXX_SCAN_FOR_MODULES & target_precompile_headers incorrectly setting ScanSourceforModuleDependencies in MSVS projects
Suppose we have the following files: src/main.cpp and src/PCH.h and the following cmake file:
cmake_minimum_required(VERSION 3.28)
project(Test)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
add_executable(${PROJECT_NAME} src/main.cpp)
#target_precompile_headers("${PROJECT_NAME}" PRIVATE src/PCH.h)
If I generate a solution for MSVS 2022 I will have no ScanSourceforModuleDependencies
property set in the project. But if I uncomment the PCH line I will have it in the project and it will be set to true for the main.cpp file.
This behavior creates a problem for at least my project using MSVS 2022; it is described there.