# CMake Error In Linux: target "FILE\_SET" does not exist

**URL:** https://discourse.cmake.org/t/cmake-error-in-linux-target-file-set-does-not-exist/7726
**Category:** Usage
**Tags:** os:linux
**Created:** [March 20, 2023, 5:28pm UTC](https://discourse.cmake.org/t/cmake-error-in-linux-target-file-set-does-not-exist/7726 "2023-03-20T17:28:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Neoptolemus](https://discourse.cmake.org/user_avatar/discourse.cmake.org/neoptolemus/32/3273_2.png) [@Neoptolemus](https://discourse.cmake.org/u/Neoptolemus)
#### Post date: [March 20, 2023, 5:28pm UTC](https://discourse.cmake.org/t/cmake-error-in-linux-target-file-set-does-not-exist/7726/1 "2023-03-20T17:28:35Z")

</div>

Hi everyone,

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:

> **[cmake-examples/shared\_library at master · sorush-khajepor/cmake-examples](https://github.com/sorush-khajepor/cmake-examples/tree/master/shared_library)**
>
> master/shared\_library

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”?

Thanks!

---

<div class="post-metadata">

### Author: ![jtxa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jtxa/32/1535_2.png) [@jtxa](https://discourse.cmake.org/u/jtxa)
#### Post date: [March 20, 2023, 8:58pm UTC](https://discourse.cmake.org/t/cmake-error-in-linux-target-file-set-does-not-exist/7726/2 "2023-03-20T20:58:36Z")

</div>

Trying that example should give an error message about your old CMake version.  
The `cmake_minimum_required(VERSION 3.23)` is there for a reason, `FILE_SET` was introduced in v3.23.

---

<div class="post-metadata">

### Author: ![Neoptolemus](https://discourse.cmake.org/user_avatar/discourse.cmake.org/neoptolemus/32/3273_2.png) [@Neoptolemus](https://discourse.cmake.org/u/Neoptolemus)
#### Post date: [March 20, 2023, 10:32pm UTC](https://discourse.cmake.org/t/cmake-error-in-linux-target-file-set-does-not-exist/7726/3 "2023-03-20T22:32:56Z")

</div>

D’Oh! I wasn’t paying attention and probably changed the version. Why did it build fine on Windows then? Both Windows and Linux were running 3.22.1 (I specifically made sure both versions were identical).

I’ve upgraded both to 3.26.0 and it builds fine. Thanks very much!
