Added px4_mangle_name function to px4_base.cmake

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-09-08 14:36:09 -07:00
parent e82ea34e51
commit 4885bbbdd1
3 changed files with 27 additions and 106 deletions
+25
View File
@@ -610,4 +610,29 @@ function(px4_add_common_flags)
endfunction()
#=============================================================================
#
# px4_mangle_name
#
# Convert a path name to a module name
#
# Usage:
# px4_mangle_name(dirname newname)
#
# Input:
# dirname : path to module dir
#
# Output:
# newname : module name
#
# Example:
# px4_mangle_name(${dirpath} mangled_name)
# message(STATUS "module name is ${mangled_name}")
#
function(px4_mangle_name dirname newname)
set(tmp)
string(REPLACE "/" "__" tmp ${dirname})
set(${newname} ${tmp} PARENT_SCOPE)
endfunction()
# vim: set noet fenc=utf-8 ff=unix nowrap: