summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorTellowKrinkle <tellowkrinkle@gmail.com>2022-08-01 17:35:34 -0500
committerTellowKrinkle <tellowkrinkle@gmail.com>2022-08-18 21:06:57 -0500
commit1bc133f3aed9254bf273a35a750bfc30f76e90f3 (patch)
treec283aef31d840756e44052787e723c8d41b225f0 /CMake
parent048f6fac527cff53d32c2059f6b644a992a416a8 (diff)
CMake: Properly include lzma include directories
Diffstat (limited to 'CMake')
-rw-r--r--CMake/DolphinLibraryTools.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMake/DolphinLibraryTools.cmake b/CMake/DolphinLibraryTools.cmake
index 4f3a8df9f3..f1681306cb 100644
--- a/CMake/DolphinLibraryTools.cmake
+++ b/CMake/DolphinLibraryTools.cmake
@@ -8,3 +8,13 @@ function(dolphin_alias_library new old)
endif()
add_library(${new} ALIAS _alias_${library_no_namespace})
endfunction()
+
+# Makes an imported target if it doesn't exist. Useful for when find scripts from older versions of cmake don't make the targets you need
+function(dolphin_make_imported_target_if_missing target lib)
+ if(${lib}_FOUND AND NOT TARGET ${target})
+ add_library(_${lib} INTERFACE)
+ target_link_libraries(_${lib} INTERFACE "${${lib}_LIBRARIES}")
+ target_include_directories(_${lib} INTERFACE "${${lib}_INCLUDE_DIRS}")
+ add_library(${target} ALIAS _${lib})
+ endif()
+endfunction()