aboutsummaryrefslogtreecommitdiff
path: root/project/cmake
diff options
context:
space:
mode:
authorwsoltys <wiso@no.way>2013-08-11 17:32:59 +0200
committerspiff <spiff@xbmc.org>2013-08-20 20:20:22 +0200
commitca8d38faa00fea05549de64d72bb56ee7a728ade (patch)
treef7bc47f2645557241019aecbeba1b4da30a2d042 /project/cmake
parent7d6be1e3cc56a467524e64f659f520194be050fe (diff)
[WIN32] added xbmc_find_path to find paths recursively
Diffstat (limited to 'project/cmake')
-rw-r--r--project/cmake/xbmc-addon-helpers.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/project/cmake/xbmc-addon-helpers.cmake b/project/cmake/xbmc-addon-helpers.cmake
index d25fe1eb6b..87a60fa152 100644
--- a/project/cmake/xbmc-addon-helpers.cmake
+++ b/project/cmake/xbmc-addon-helpers.cmake
@@ -82,3 +82,12 @@ macro (build_addon target prefix libs)
INSTALL(DIRECTORY ${target} DESTINATION share/xbmc/addons)
ENDIF(PACKAGE_ZIP OR PACKAGE_TGZ)
endmacro()
+
+# finds a path to a given file (recursive)
+function (xbmc_find_path var_name filename search_path strip_file)
+ file(GLOB_RECURSE PATH_TO_FILE ${search_path} ${filename})
+ if(strip_file)
+ string(REPLACE ${filename} "" PATH_TO_FILE ${PATH_TO_FILE})
+ endif(strip_file)
+ set (${var_name} ${PATH_TO_FILE} PARENT_SCOPE)
+endfunction()