79211745

Date: 2024-11-21 15:04:26
Score: 0.5
Natty:
Report link

I landed here from Google. Same error message but a different fact pattern.

My development environment is Visual Studio on Windows, and the output executable needs to run on Windows and Linux. The Linux executable is built using WSL (Ubuntu).

Here's the relevant block from my CMakeLists.txt

add_executable (
    myExecutable
    "sourcefile1.cpp"
    "sourcefile2.cpp"
    ...
)

The build worked fine on Windows but not Linux.

The problem turned out to be a file that was recently added. One of the letters in the name was upper case on the filesystem, but CMakeLists included it as lower case (sourcefile2.cpp vs. sourceFile2.cpp).

And the problem was only in one out of more than a hundred files. CMake error message was still the same "No source given to target"

Reasons:
  • RegEx Blacklisted phrase (1): Same error
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Dr Phil