summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-28 22:56:52 +0000
committersamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-28 22:56:52 +0000
commit192bc90396a4fc5314e9e70328dcf9a6edf232f2 (patch)
tree034f66205c9fd9f249bcdacf37215be018a66bdd
parent4da24f1aec23627f27e5e6864a521262b572fa73 (diff)
downloadtde-cmake-192bc90396a4fc5314e9e70328dcf9a6edf232f2.tar.gz
tde-cmake-192bc90396a4fc5314e9e70328dcf9a6edf232f2.zip
[kde-common/cmake] added tde_file_to_cpp() macro
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kde-common/cmake@1229667 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--modules/TDEMacros.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index eef5568..b99aa80 100644
--- a/modules/TDEMacros.cmake
+++ b/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 )