Skip to content

Commit

Permalink
Use set_property() to specify imported target's link libraries, inste…
Browse files Browse the repository at this point in the history
…ad of

target_link_libraries() that falters with older CMake versions.

Rubber-stamped by Adrian Perez de Castro.
  • Loading branch information
zdobersek committed Jan 24, 2020
1 parent 67ccb40 commit d395e44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmake/FindEGL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY)
if (EGL_LIBRARIES AND NOT TARGET GL::egl)
add_library(GL::egl INTERFACE IMPORTED)
if (TARGET PkgConfig::EGL)
target_link_libraries(GL::egl INTERFACE PkgConfig::EGL)
set_property(TARGET GL::egl PROPERTY
INTERFACE_LINK_LIBRARIES PkgConfig::EGL)
else ()
set_property(TARGET GL::egl PROPERTY
INTERFACE_LINK_LIBRARIES ${EGL_LIBRARY})
Expand Down
3 changes: 2 additions & 1 deletion cmake/FindLibxkbcommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ find_library(LIBXKBCOMMON_LIBRARY
if (LIBXKBCOMMON_LIBRARY AND NOT TARGET XkbCommon::libxkbcommon)
add_library(XkbCommon::libxkbcommon INTERFACE IMPORTED)
if (TARGET PkgConfig::LIBXKBCOMMON)
target_link_libraries(XkbCommon::libxkbcommon INTERFACE PkgConfig::LIBXKBCOMMON)
set_property(TARGET XkbCommon::libxkbcommon PROPERTY
INTERFACE_LINK_LIBRARIES PkgConfig::LIBXKBCOMMON)
else ()
set_property(TARGET XkbCommon::libxkbcommon PROPERTY
INTERFACE_LINK_LIBRARIES ${LIBXKBCOMMON_LIBRARY})
Expand Down

0 comments on commit d395e44

Please sign in to comment.