forked from TigerVNC/tigervnc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
6c7c022
commit 115d3f8
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |