<!DOCTYPE html><html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<pre style="margin: 1.5em 0px; padding: 0px; border: 0px; outline: 0px; font-weight: 400; font-style: normal; font-size: 13px; font-family: monospace; vertical-align: baseline; overflow: auto; white-space: pre; color: rgb(0, 0, 0); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><span>Package: cmake
Version: 4.0.0
With these test file:
`CMakeLists.txt`:
```cmake
cmake_minimum_required(VERSION 4.0.0)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "a9e1cf81-9932-4810-974b-6eccaf14e457")
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
set(CMAKE_CXX_MODULE_STD 1)
project(cpptest VERSION 0.1.0 LANGUAGES CXX)
add_executable(cpptest main.cpp)
```
`main.cpp`:
```cpp
import std;
int main(){
std::println("Hello world!");
}
```
It shows:
```shell
CMake Error at build/CMakeFiles/4.0.0/CMakeCXXCompiler.cmake:103 (target_sources):
Cannot find source file:
/usr/lib/gcc/x86_64-linux-gnu/include/c++/15/bits/<a href="std.cc" target="_blank" ref="noopener noreferrer">std.cc</a>
Call Stack (most recent call first):
/usr/share/cmake-4.0/Modules/CMakeTestCXXCompiler.cmake:91 (include)
CMakeLists.txt:8 (project)
CMake Error in CMakeLists.txt:
No SOURCES given to target: __CMAKE__CXX23@synth_2e5b435a2e6c
CMake Generate step failed. Build files cannot be regenerated correctly.
```
I have change the `CMakeCXXCompiler.cmake`:
```
target_sources(__CMAKE::CXX23
INTERFACE
FILE_SET std TYPE CXX_MODULES
BASE_DIRS "/usr/lib/gcc/x86_64-linux-gnu/15/../include/c++/15/bits"
FILES "/usr/lib/gcc/x86_64-linux-gnu/15/../include/c++/15/bits/<a href="std.cc" target="_blank" ref="noopener noreferrer">std.cc</a>" "/usr/lib/gcc/x86_64-linux-gnu/15/../include/c++/15/bits/<a href="std.compat.cc" target="_blank" ref="noopener noreferrer">std.compat.cc</a>")
endif ()
```
to
```
target_sources(__CMAKE::CXX23
INTERFACE
FILE_SET std TYPE CXX_MODULES
BASE_DIRS "/usr/include/c++/15/bits"
FILES "/usr/include/c++/15/bits/<a href="std.cc" target="_blank" ref="noopener noreferrer">std.cc</a>" "/usr/include/c++/15/bits/<a href="std.compat.cc" target="_blank" ref="noopener noreferrer">std.compat.cc</a>")
endif ()
```
to fix it. And there is my issue on kitware cmake:</span><a class="moz-txt-link-freetext" href="https://gitlab.kitware.com/cmake/cmake/-/issues/26609">https://gitlab.kitware.com/cmake/cmake/-/issues/26609</a>
They have fixed in gentoo and fedora. But debian doesn't.</pre>
</body></html>