GLFW on Linux CMake finds no libraries

GLFW on Linux apparently doesn’t support CMake. Here are 2 solutions
At command prompt find where glfw is actually installed. Something like:
sudo find / 2>/dev/null -iname “libglfw*”
pick one that looks about right…
In my case I found /usr/local/lib/libglfw.so
Add it to your project explicitly
link_libraries(${other dependencies here} /usr/local/lib/libglfw.so )
Done. Your linker will stop complaining

The only other solution I found is to build GLFW from source and then
add_subdirectory(/path/to/src glfw)

I haven’t seen any other libraries that require this kind of work to get them into a CMake project

I presume you are trying to build from installed GLFW binaries. Have you read the documentation on building applications with GLFW?

Yes and I tried the find_package(PkgConfig REQUIRED) and pkg_search_module(glfw REQUIRED) still get nothing. I’ve already spent too much time on this. Other libraries like X11 and OpenGL etc. don’t have this issue. I dumped all the CMake variables and grep for -i glfw and it has a bunch of variables but the library ones are all blank The solution I came up with will work for other people who experience this issue till it gets fixed

The solution in the documentation should work, I am not sure why it does not on your system - could you add some information about your distribution?

I would also always recommend building from source rather than using installed packages for non-system packages, and have a simple GLFW-CMake-starter example people can use for this.

Building from source is fine but even then you have to use add_subdirectory, the installed library paths still don’t show up.
This happens on both machines I’ve tried it on. Both are running Linux Mint. One is an old i5 on Mac hardware, the other a slightly newer i7 on an Asus board with 32Gb ram. I’m on the old one right now. Here’s the info
System:
Kernel: 5.15.0-119-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Xfce 4.18.1
tk: Gtk 3.24.33 info: xfce4-panel wm: xfwm 4.18.0 vt: 7 dm: LightDM 1.30.0
Distro: Linux Mint 21.3 Virginia base: Ubuntu 22.04 jammy
CPU:
Info: dual core model: Intel Core i5-3210M bits: 64 type: MT MCP smt: enabled arch: Ivy Bridge
rev: 9 cache: L1: 128 KiB L2: 512 KiB L3: 3 MiB
Speed (MHz): avg: 2918 high: 2934 min/max: 1200/3100 cores: 1: 2930 2: 2934 3: 2908 4: 2901
bogomips: 19953
Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx

I’m trying to set this system up so my Brother can learn some graphics programming and all the examples I can find use GLFW. For my own work I just use x11 directly

Thanks for the information, if I get time I’ll investigate why install doesn’t work on Linux Mint 21.3.

I have added a tracking issue for this on Github:

Thank you, I appreciate your taking the time.