Commit cdd62540 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

cmake: Don't use tabs and generate revision.c builtin.h vlc_about.h in the build tree.

parent 5b9a4e95
...@@ -97,7 +97,7 @@ set( SOURCES_libvlc_common ...@@ -97,7 +97,7 @@ set( SOURCES_libvlc_common
misc/rand.c misc/rand.c
misc/mtime.c misc/mtime.c
misc/block.c misc/block.c
modules/builtin.h ${CMAKE_BINARY_DIR}/src/modules/builtin.h
modules/modules.h modules/modules.h
modules/modules.c modules/modules.c
modules/cache.c modules/cache.c
...@@ -119,12 +119,12 @@ set( SOURCES_libvlc_common ...@@ -119,12 +119,12 @@ set( SOURCES_libvlc_common
misc/variables.c misc/variables.c
misc/error.c misc/error.c
misc/update.c misc/update.c
misc/revision.c ${CMAKE_BINARY_DIR}/src/misc/revision.c
input/vlm.c input/vlm.c
misc/xml.c misc/xml.c
misc/devices.c misc/devices.c
extras/libc.c extras/libc.c
${CMAKE_SOURCE_DIR}/include/vlc_about.h ) ${CMAKE_BINARY_DIR}/include/vlc_about.h )
set( SOURCES_libvlc ${SOURCES_libvlc_common} ) set( SOURCES_libvlc ${SOURCES_libvlc_common} )
...@@ -182,10 +182,11 @@ endif(APPLE) ...@@ -182,10 +182,11 @@ endif(APPLE)
########################################################## ##########################################################
# revision.c # revision.c
set(rev "${CMAKE_CURRENT_SOURCE_DIR}/misc/revision.c") set(rev "${CMAKE_BINARY_DIR}/src/misc/revision.c")
add_custom_command( add_custom_command(
OUTPUT ${rev} OUTPUT ${rev}
COMMAND rm -f ${rev} ${rev}.tmp COMMAND rm -f ${rev} ${rev}.tmp
COMMAND mkdir -p `dirname ${rev}`
COMMAND echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > ${rev}.tmp COMMAND echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > ${rev}.tmp
COMMAND printf "const char psz_vlc_changeset[] = \"" >> ${rev}.tmp COMMAND printf "const char psz_vlc_changeset[] = \"" >> ${rev}.tmp
COMMAND sh -c "printf `LANG=C svnversion ${CMAKE_SOURCE_DIR} || printf \"exported\"`" >> ${rev}.tmp COMMAND sh -c "printf `LANG=C svnversion ${CMAKE_SOURCE_DIR} || printf \"exported\"`" >> ${rev}.tmp
...@@ -199,11 +200,12 @@ set(rev) ...@@ -199,11 +200,12 @@ set(rev)
# builtin.h # builtin.h
# No real use for this one, we just used to need it. # No real use for this one, we just used to need it.
# We should really remove that. # We should really remove that.
set(builtin "${CMAKE_CURRENT_SOURCE_DIR}/modules/builtin.h") set(builtin "${CMAKE_BINARY_DIR}/src/modules/builtin.h")
add_custom_command( add_custom_command(
OUTPUT ${builtin} OUTPUT ${builtin}
COMMAND echo "/* Auto generated by ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt */" > ${builtin} COMMAND mkdir -p `dirname ${builtin}`
COMMAND echo "/* Auto generated by ${CMAKE_CURRENT_BUILD_DIR}/CMakeLists.txt */" > ${builtin}
COMMAND echo "int vlc_entry__main( module_t* );" >> ${builtin} COMMAND echo "int vlc_entry__main( module_t* );" >> ${builtin}
COMMAND echo "#define ALLOCATE_ALL_BUILTINS() do {} while(0)" >> ${builtin} COMMAND echo "#define ALLOCATE_ALL_BUILTINS() do {} while(0)" >> ${builtin}
VERBATIM VERBATIM
...@@ -212,11 +214,12 @@ set(should) ...@@ -212,11 +214,12 @@ set(should)
########################################################## ##########################################################
# vlc_about.h # vlc_about.h
set(about "${CMAKE_SOURCE_DIR}/include/vlc_about.h") set(about "${CMAKE_BINARY_DIR}/include/vlc_about.h")
add_custom_command( add_custom_command(
OUTPUT ${about} OUTPUT ${about}
COMMAND rm -f -- "${about}.tmp" COMMAND rm -f -- "${about}.tmp"
COMMAND mkdir -p `dirname ${about}`
COMMAND mkdir -p -- ../include COMMAND mkdir -p -- ../include
COMMAND echo "/* Automatically generated file - DO NOT EDIT */" > "${about}.tmp" COMMAND echo "/* Automatically generated file - DO NOT EDIT */" > "${about}.tmp"
COMMAND echo "static const char psz_license[] =" >> "${about}.tmp" COMMAND echo "static const char psz_license[] =" >> "${about}.tmp"
...@@ -249,4 +252,4 @@ set_target_properties(libvlc PROPERTIES SOVERSION 1.0.0) ...@@ -249,4 +252,4 @@ set_target_properties(libvlc PROPERTIES SOVERSION 1.0.0)
set_target_properties(libvlc libvlc-control PROPERTIES PREFIX "") set_target_properties(libvlc libvlc-control PROPERTIES PREFIX "")
set_target_properties(libvlc libvlc-control PROPERTIES LINK_FLAGS "${LINK_FLAGS} ${CMAKE_THREAD_LIBS_INIT}") set_target_properties(libvlc libvlc-control PROPERTIES LINK_FLAGS "${LINK_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
set_target_properties(libvlc libvlc-control vlc PROPERTIES COMPILE_FLAGS set_target_properties(libvlc libvlc-control vlc PROPERTIES COMPILE_FLAGS
"-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wmissing-prototypes" ) "-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wmissing-prototypes -I${CMAKE_BINARY_DIR}/src -I${CMAKE_BINARY_DIR}/include" )
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment