aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-06-04 14:19:07 +0200
committerPierre Ossman <ossman@cendio.se>2022-06-07 10:06:32 +0200
commit115d3f883e2fceea0f2e7df0e570864a01178f4e (patch)
treee7689435cc113ff340cf2ee903fa01a743eef636 /cmake
parent6c7c022b194ea7f0f4a2e8ab5835c5688a2b88d4 (diff)
downloadtigervnc-115d3f883e2fceea0f2e7df0e570864a01178f4e.tar.gz
tigervnc-115d3f883e2fceea0f2e7df0e570864a01178f4e.zip
Add target_link_directory() compat function
We need this function to deal with pkgconfig files properly, but unfortunately it doesn't exist until CMake 3.13, and we need to support CMake 3.10. So add a hacky compatibility function for older systems.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/TargetLinkDirectories.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/TargetLinkDirectories.cmake b/cmake/TargetLinkDirectories.cmake
new file mode 100644
index 00000000..11b05670
--- /dev/null
+++ b/cmake/TargetLinkDirectories.cmake
@@ -0,0 +1,12 @@
+# Compatibility replacement of target_link_directories() for older cmake
+
+if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
+ function(target_link_directories TARGET SCOPE)
+ get_target_property(INTERFACE_LINK_LIBRARIES ${TARGET} INTERFACE_LINK_LIBRARIES)
+ foreach(DIRECTORY ${ARGN})
+ list(INSERT INTERFACE_LINK_LIBRARIES 0 "-L${DIRECTORY}")
+ endforeach()
+ set_target_properties(${TARGET} PROPERTIES
+ INTERFACE_LINK_LIBRARIES "${INTERFACE_LINK_LIBRARIES}")
+ endfunction()
+endif()