diff options
| author | Jordan Williams <jordan@jwillikers.com> | 2024-04-14 12:07:15 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-14 19:07:15 +0200 |
| commit | 5417ea5f1f33f62e2511bda74477da05dce900a3 (patch) | |
| tree | dbf96e812217786a4f5eee4c25fab51a823766b9 /CMake/variables.cmake | |
| parent | 2818a36064365e63e32de6850c65544dd1fdfb07 (diff) | |
CMake: Use imported targets for PkgConfig packages (#954)
This carries include directories and the required link flags.
Several libraries brought in through pkg_check_modules aren't linked correctly using the _LDFLAGS variables.
Instead, they link the libraries directly with `-l`.
This is problematic because it doesn't properly pull in the actual directory of the library being linked when it is not in a system library directory.
Likewise, the necessary include directories for several of these targets aren't properly set either.
Linking against the imported targets automatically pulls in the necessary include directories.
Diffstat (limited to 'CMake/variables.cmake')
| -rw-r--r-- | CMake/variables.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/CMake/variables.cmake b/CMake/variables.cmake index cbf6ffdf3..20a36eda8 100644 --- a/CMake/variables.cmake +++ b/CMake/variables.cmake @@ -45,9 +45,9 @@ if(WIN32) elseif(APPLE AND NOT FLTK_BACKEND_X11) list(APPEND FLTK_LDLIBS ${FLTK_COCOA_FRAMEWORKS}) elseif(FLTK_BACKEND_WAYLAND) - list(APPEND FLTK_LDLIBS "-lwayland-cursor -lwayland-client -lxkbcommon -ldbus-1") + list(APPEND FLTK_LDLIBS PkgConfig::WLDCURSOR PkgConfig::WLDCLIENT PkgConfig::XKBCOMMON PkgConfig::DBUS) if(USE_SYSTEM_LIBDECOR) - list(APPEND FLTK_LDLIBS "-ldecor-0") + list(APPEND FLTK_LDLIBS PkgConfig::SYSTEM_LIBDECOR) endif(USE_SYSTEM_LIBDECOR) else() list(APPEND FLTK_LDLIBS -lm) |
