[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
master
samelian 14 years ago
parent 64f9d96ede
commit 1efb091bca

@ -160,6 +160,24 @@ macro( tde_add_luts )
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> )

Loading…
Cancel
Save