I’m a beginner to CMake, using 3.22.1, and attempting to build a project targeting both Windows and Linux (x86). I am using an example CMake project to learn how to make this work, specifically this shared library project below:
I have installed and enabled the WSL in VS2022 and created a CMake project. The code is all deployed and compiles fine for Windows, but if I try to build the project for Linux, I get this error:
“install TARGETS given target “FILE_SET” which does not exist.”
I can’t find any information on why this is happening. From what I understand, the CMakeLists.txt in the shape and square subdirectories gather their files into a file set called “HEADERS”, which I then reference in the install command so I don’t have to manually specify all the source files in the install command.
I don’t understand what this error means, and why it doesn’t happen for Windows. Why is “FILE_SET” being interpreted as the target name and not a keyword indicating that I want to target a file set called “HEADERS”?