diff options
author | samelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-28 22:56:52 +0000 |
---|---|---|
committer | samelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-28 22:56:52 +0000 |
commit | 1efb091bca4bb2f59d228bc8c7ed7b6e318f17f9 (patch) | |
tree | 480328bf93d15bead079fcfd75378800b96ed438 /cmake | |
parent | 64f9d96ede60eb8bffa7cb11438759a5b7e22d32 (diff) | |
download | other-1efb091bca4bb2f59d228bc8c7ed7b6e318f17f9.tar.gz other-1efb091bca4bb2f59d228bc8c7ed7b6e318f17f9.zip |
[kde-common/cmake] added tde_file_to_cpp() macro
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kde-common@1229667 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/TDEMacros.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/modules/TDEMacros.cmake b/cmake/modules/TDEMacros.cmake index eef5568..b99aa80 100644 --- a/cmake/modules/TDEMacros.cmake +++ b/cmake/modules/TDEMacros.cmake @@ -162,6 +162,24 @@ endmacro( tde_add_luts ) ################################################# ##### +##### tde_file_to_cpp( <source> <destination> <variable> ) + +macro( tde_file_to_cpp _src _dst _var ) + if( IS_ABSOLUTE ${_dst} ) + set( dst ${_dst} ) + else( ) + set( dst "${CMAKE_CURRENT_BINARY_DIR}/${_dst}" ) + endif( ) + file( READ ${_src} text ) + string( REGEX REPLACE "\n" "\\\\n\"\n\"" text "${text}" ) + set( text "/* Generated by CMake */\n\nconst char *${_var} = \n\n\"${text}\";\n" ) + string( REGEX REPLACE "\n\"\";\n$" ";\n" text "${text}" ) + file( WRITE ${dst} "${text}" ) +endmacro( ) + + +################################################# +##### ##### tde_install_la_file( <target> <destination> ) macro( tde_install_la_file _target _destination ) |