cmake: Generate vlc_about.h.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 4 Feb 2008 19:34:30 +0000 (19:34 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 4 Feb 2008 19:34:30 +0000 (19:34 +0000)
extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt

index dda1b6e..c174c4a 100644 (file)
@@ -120,7 +120,8 @@ set( SOURCES_libvlc_common
        input/vlm.c
        misc/xml.c
        misc/devices.c
-       extras/libc.c )
+       extras/libc.c
+    ${CMAKE_SOURCE_DIR}/include/vlc_about.h )
 
 set( SOURCES_libvlc ${SOURCES_libvlc_common} )
 
@@ -185,11 +186,12 @@ OUTPUT ${rev}
 COMMAND        rm -f ${rev} ${rev}.tmp
 COMMAND        echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > ${rev}.tmp
 COMMAND        printf "const char psz_vlc_changeset[] = \"" >> ${rev}.tmp
-COMMAND        sh -c "echo `LANG=C\ svnversion\ ${CMAKE_SOURCE_DIR}\ ||\ echo\ exported`"
+COMMAND        sh -c "echo `LANG=C\ svnversion\ ${CMAKE_SOURCE_DIR}\ ||\ echo\ exported`" >> ${rev}.tmp
 COMMAND        echo "\";" >> ${rev}.tmp
 COMMAND        mv -f ${rev}.tmp ${rev}
 VERBATIM
 )
+set(rev)
 
 ##########################################################
 # builtin.h
@@ -204,8 +206,31 @@ COMMAND    echo "int vlc_entry__main( module_t* );" >> ${builtin}
 COMMAND        echo "#define ALLOCATE_ALL_BUILTINS() do {} while(0)" >> ${builtin}
 VERBATIM
 )
+set(should)
+
+##########################################################
+# vlc_about.h
+set(about "${CMAKE_SOURCE_DIR}/include/vlc_about.h")
+
+add_custom_command(
+OUTPUT ${about}
+COMMAND rm -f -- "${about}.tmp"
+COMMAND mkdir -p -- ../include
+COMMAND echo "/* Automatically generated file - DO NOT EDIT */" > "${about}.tmp"
+COMMAND echo "static const char psz_license[] =" >> "${about}.tmp"
+COMMAND cat ${CMAKE_SOURCE_DIR}/COPYING | sed s/\"/''/g | awk "{ print \"\\\"\"$0\"\\\\n\\\"\" }" >> "${about}.tmp"
+COMMAND echo ";" >> "${about}.tmp"
+COMMAND echo "static const char psz_thanks[] =" >> "${about}.tmp"
+COMMAND grep -v '$$Id:'  ${CMAKE_SOURCE_DIR}/THANKS | sed "s/\"/''/g" | awk "{ print  \"\\\"\"$0\"\\\\n\\\"\" }"|sed "s/\"<.*.> \"//" >> "${about}.tmp"
+COMMAND echo ";" >> "${about}.tmp"
+COMMAND echo "static const char psz_authors[] =" >> "${about}.tmp"
+COMMAND grep N: ${CMAKE_SOURCE_DIR}/AUTHORS | cut -d "\ " -f 2- | sed "s/\"/''/g" | awk "{ print  \"\\\"\"$0\"\\\\n\\\"\" }" >> "${about}.tmp"
+COMMAND echo ";" >> "${about}.tmp"
+COMMAND mv -f -- "${about}.tmp" "${about}"
+DEPENDS ${CMAKE_SOURCE_DIR}/AUTHORS ${CMAKE_SOURCE_DIR}/THANKS ${CMAKE_SOURCE_DIR}/COPYING
+VERBATIM)
+set(about)
 
-set(rev)
 ##########################################################
 # SET_TARGET_PROPERTIES