# \[Arch Linux\] Cmake find\_package(SDL2 REQUIRED) passes but doesn't find anything

**URL:** <https://discourse.libsdl.org/t/arch-linux-cmake-find-package-sdl2-required-passes-but-doesnt-find-anything/24226>\
**Category:** SDL Development\
**Created:** [April 15, 2018, 7:03pm UTC](https://discourse.libsdl.org/t/arch-linux-cmake-find-package-sdl2-required-passes-but-doesnt-find-anything/24226 "2018-04-15T19:03:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![gmueckl](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/c6cbf5/32.png) [@gmueckl](https://discourse.libsdl.org/u/gmueckl)\
**Post date:** [June 8, 2018, 4:24am UTC](https://discourse.libsdl.org/t/arch-linux-cmake-find-package-sdl2-required-passes-but-doesnt-find-anything/24226/2 "2018-06-08T04:24:38Z")

</div>

Arch Linux switched from buliding SDL2 with autotools to building it with cmake. This utterly breaks how users of SDL2 need to refer to it in their cmake scripts. Unlike the autotools-geenerated SDL2Config.cmake, the cmake-generated SDL2Config.cmake exports SDL2 as a PUBLIC target, that gets IMPORTED into the script that uses find\_package(SDL2). In order to use it, you need to use target\_link\_libraries([YOUR TARGET] SDL2::SDL2). This will **also** implicitly set the include paths for the sources and make things work magically - or not. In the later case, good luck!

---

_[View the full topic](https://discourse.libsdl.org/t/arch-linux-cmake-find-package-sdl2-required-passes-but-doesnt-find-anything/24226)._
