CMake doesn't distinguish `file.cpp` and `../file.cpp`
Steps to reproduce:
- create new CMake project
- place two files with the same name, one in the project root and one in the parent directory:
file.cpp
and../file.cpp
- add new target with
add_executable(target file.cpp ../file.cpp )
Expected behavior:
- CMake detects 2 separate files and compiles them both
Actual behavior:
- CMake only detects
file.cpp
in the project root. -
../file.cpp
is ignored
Note, that if you replace ../file.cpp
with ../../file.cpp
everything works as expected and CMake compiles both files.
I've tried it on Windows and macOS with CMake 3.23