diff options
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 ) |