diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-05-28 00:03:59 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-05-28 00:03:59 +0200 |
commit | de6177a7793ad27f683b333c636a8cd47415f192 (patch) | |
tree | ac6af250e4cac69f1272b501cdb04efa110cb1d3 /cmake | |
parent | 5a5b02987823f9c7b8bcd832f9acf8bcaff73cc0 (diff) |
cmake/pkg-config: fix linkage #726
cmake ignores `-lfoo' in LDFLAGS
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/opentrack-pkg-config.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/opentrack-pkg-config.cmake b/cmake/opentrack-pkg-config.cmake index 8d9615f3..bad4fae1 100644 --- a/cmake/opentrack-pkg-config.cmake +++ b/cmake/opentrack-pkg-config.cmake @@ -4,6 +4,7 @@ function(otr_pkgconfig target) set(cflags "") set(includes "") set(ldflags "") + set(libs "") foreach(i ${ARGN}) set(k pkg-config_${i}) pkg_check_modules(${k} QUIET ${i}) @@ -11,14 +12,16 @@ function(otr_pkgconfig target) set(cflags "${cflags} ${${k}_CFLAGS} ") set(includes ${includes} ${${k}_INCLUDE_DIRS} ${${k}_INCLUDEDIR}) set(ldflags "${ldflags} ${${k}_LDFLAGS} ") + set(libs ${libs} ${${k}_LIBRARIES}) + message(STATUS "${target} | ${i} | ${cflags} | ${includes} | ${ldflags} | ${libs} | ") else() message(FATAL_ERROR "Can't find '${i}'. Please install development files for this package.") endif() endforeach() - #message(STATUS "foo | ${cflags} | ${includes} | ${ldflags}") set_property(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS "${cflags} ") target_include_directories(${target} SYSTEM PRIVATE ${includes}) set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS "${ldflags} ") + target_link_libraries(${target} ${libs}) endfunction() |