Example

Swift/CMakeLists.txt

enable_language(Swift)
No CMAKE_Swift_COMPILER could be found. Tell CMake where to find the compiler by setting either the environment variable "SWIFTC" or the CMake cache entry CMAKE_Swift_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
add_executable(hello_swift hello.swift)
install(TARGETS hello_swift)