Swift module support

I’m trying to build a project using Swift with the Xcode generator, but I can not get it to import a class from another target (that is correctly linked).

I also tried this example swift-cmake-examples/HelloWorld at main · compnerd/swift-cmake-examples · GitHub which suggests that it should be working, but they are using Ninja.

When using Xcode I get the following error:

dev/swift-cmake-examples/HelloWorld/Source/HelloWorld/HelloWorld.swift:2:8: error: no such module ‘HelloWorldCore’
import HelloWorldCore

Is this a bug in the generator ?
If not, how does one import a module created by CMake ?

EDIT: I managed to make it build by adding the build directory in Build Settings > Swift Compiler - Search Paths > Import Paths. So it is probably a bug that this is not properly set by CMake? This is the SWIFT_INCLUDE_PATHS Xcode attribute

I just added generation of SWIFT_INCLUDE_PATHS as part of the fix in CMake MR 7858. It will be in CMake 3.25.0.