summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCHris B <cb@shoutr.net>2017-01-28 17:00:07 +0100
committerCHris B <cb@shoutr.net>2017-01-28 17:00:07 +0100
commitd08fd0182da1ea861ef399a115efd85b698d65d0 (patch)
tree07508a11ace8e10889396187815d2b1c1c24a2d3
parent6aa41e11a0f66f46d461cd57a43578cb329b128c (diff)
downloadlibtdevnc-d08fd018.tar.gz
libtdevnc-d08fd018.zip
CMake: do not include NOTFOUND libs in pkg-config snippets
-rw-r--r--CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2f159a..e658976 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -465,6 +465,9 @@ function(get_link_libraries OUT TARGET)
set(RESULT "")
get_target_property(LIBRARIES ${TARGET} INTERFACE_LINK_LIBRARIES)
foreach(LIB ${LIBRARIES})
+ if("${LIB}" MATCHES ".*NOTFOUND.*")
+ continue()
+ endif()
string(REGEX REPLACE "^.*/lib" "" LIB ${LIB}) # remove leading path and "lib" name prefix
string(REGEX REPLACE "-l" "" LIB ${LIB}) # remove leading -l
string(REGEX REPLACE "\\.so$" "" LIB ${LIB}) # remove trailing .so