cmake: Fix revision generation.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 4 Feb 2008 18:16:13 +0000 (18:16 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 4 Feb 2008 18:16:13 +0000 (18:16 +0000)
extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt

index 501820c..cf13368 100644 (file)
@@ -170,21 +170,28 @@ target_link_libraries(libvlc-control libvlc)
 target_link_libraries(libvlc ${HAVE_ICONV})
 
 # Carbon
-find_library(CARBON_FRAMEWORK Carbon)
-target_link_libraries(libvlc ${CARBON_FRAMEWORK})
+if(APPLE)
+  find_library(CARBON_FRAMEWORK Carbon)
+  target_link_libraries(libvlc ${CARBON_FRAMEWORK})
+endif(APPLE)
 
 ##########################################################
-# version.c
-
+# revision.c
+set(rev "${CMAKE_CURRENT_SOURCE_DIR}/misc/revision.c")
 add_custom_command(
-OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/misc/revision.c
-COMMAND sh "rm -f misc/revision.c misc/revision.c.tmp &&
-    echo '/* AUTOGENERATED FILE - DO NOT EDIT */' > misc/revision.c.tmp &&
-    REVISION=\"$$\(LANG=C svnversion \\\"$\(top_srcdir)\\\" 2>/dev/null || echo exported)\" ; &&
-    echo \"const char psz_vlc_changeset[] = \\\"$$REVISION\\\";\" >> misc/revision.c.tmp &&
-    mv -f misc/revision.c.tmp misc/revision.c"
+OUTPUT ${rev}
+COMMAND echo "${rev}"
+COMMAND        rm -f ${rev} ${rev}.tmp
+COMMAND        echo ${rev}
+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        echo "\";" >> ${rev}.tmp
+COMMAND        mv -f ${rev}.tmp ${rev}
+VERBATIM
 )
 
+set(rev)
 ##########################################################
 # SET_TARGET_PROPERTIES