mirror of https://code.videolan.org/videolan/vlc
311 lines
9.6 KiB
Plaintext
311 lines
9.6 KiB
Plaintext
|
||
add_definitions(-Dasm=__asm__ -D_INTL_REDIRECT_MACROS)
|
||
add_definitions(-DLOCALEDIR="${CMAKE_INSTALL_PREFIX}/locale")
|
||
add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_PREFIX}/etc")
|
||
add_definitions(-DPLUGIN_PATH="${CMAKE_INSTALL_PREFIX}/lib/vlc")
|
||
add_definitions(-DDATA_PATH="${CMAKE_INSTALL_PREFIX}/share/vlc")
|
||
|
||
# vlc
|
||
if(SYS_WIN32)
|
||
add_executable(vlc winvlc.c)
|
||
else(SYS_WIN32)
|
||
add_executable(vlc vlc.c)
|
||
endif(SYS_WIN32)
|
||
target_link_libraries(vlc libvlccore libvlc)
|
||
|
||
# libvlccore
|
||
|
||
set( SOURCES_libvlccore_beos misc/beos_specific.cpp )
|
||
set( SOURCES_libvlccore_darwin misc/darwin_specific.c )
|
||
set( SOURCES_libvlccore_win32 misc/win32_specific.c )
|
||
set( SOURCES_libvlccore_linux misc/linux_specific.c )
|
||
set( SOURCES_libvlccore_other misc/not_specific.c )
|
||
set( SOURCES_libvlccore_dirent extras/dirent.c )
|
||
set( SOURCES_libvlccore_getopt misc/getopt.c misc/getopt.h misc/getopt1.c )
|
||
set( SOURCES_libvlccore_common
|
||
libvlc.c
|
||
libvlc.h
|
||
libvlc-module.c
|
||
interface/interface.c
|
||
interface/intf_eject.c
|
||
interface/interaction.c
|
||
playlist/playlist_internal.h
|
||
playlist/thread.c
|
||
playlist/control.c
|
||
playlist/engine.c
|
||
playlist/sort.c
|
||
playlist/loadsave.c
|
||
playlist/tree.c
|
||
playlist/item.c
|
||
playlist/search.c
|
||
playlist/services_discovery.c
|
||
input/item.c
|
||
input/access.c
|
||
input/clock.c
|
||
input/control.c
|
||
input/decoder.c
|
||
input/decoder_synchro.c
|
||
input/demux.c
|
||
input/es_out.c
|
||
input/input.c
|
||
input/meta.c
|
||
input/input_internal.h
|
||
input/vlm_internal.h
|
||
input/stream.c
|
||
input/mem_stream.c
|
||
input/subtitles.c
|
||
input/var.c
|
||
video_output/video_output.c
|
||
video_output/vout_pictures.c
|
||
video_output/vout_pictures.h
|
||
video_output/video_text.c
|
||
video_output/video_widgets.c
|
||
video_output/vout_subpictures.c
|
||
video_output/vout_intf.c
|
||
audio_output/aout_internal.h
|
||
audio_output/common.c
|
||
audio_output/dec.c
|
||
audio_output/filters.c
|
||
audio_output/input.c
|
||
audio_output/mixer.c
|
||
audio_output/output.c
|
||
audio_output/intf.c
|
||
stream_output/stream_output.c
|
||
stream_output/stream_output.h
|
||
stream_output/announce.c
|
||
stream_output/profiles.c
|
||
stream_output/sap.c
|
||
stream_output/sdp.c
|
||
osd/osd.c
|
||
osd/osd_text.c
|
||
osd/osd_widgets.c
|
||
network/acl.c
|
||
network/getaddrinfo.c
|
||
network/io.c
|
||
network/tcp.c
|
||
network/udp.c
|
||
network/httpd.c
|
||
network/rootwrap.c
|
||
network/tls.c
|
||
network/poll.c
|
||
text/charset.c
|
||
text/strings.c
|
||
text/unicode.c
|
||
text/wincp.c
|
||
text/iso_lang.c
|
||
text/iso-639_def.h
|
||
misc/action.c
|
||
misc/md5.c
|
||
misc/rand.c
|
||
misc/mtime.c
|
||
misc/block.c
|
||
${CMAKE_BINARY_DIR}/src/modules/builtin.h
|
||
modules/modules.h
|
||
modules/modules.c
|
||
modules/cache.c
|
||
modules/entry.c
|
||
modules/os.c
|
||
misc/threads.c
|
||
misc/stats.c
|
||
misc/cpu.c
|
||
config/configuration.h
|
||
config/core.c
|
||
config/dirs.c
|
||
config/chain.c
|
||
config/file.c
|
||
config/intf.c
|
||
config/cmdline.c
|
||
misc/events.c
|
||
misc/image.c
|
||
misc/messages.c
|
||
misc/mime.c
|
||
misc/objects.c
|
||
misc/variables.h
|
||
misc/variables.c
|
||
misc/error.c
|
||
misc/update.h
|
||
misc/update.c
|
||
${CMAKE_BINARY_DIR}/src/misc/revision.c
|
||
input/vlm.c
|
||
input/vlmshell.c
|
||
misc/xml.c
|
||
misc/devices.c
|
||
version.c
|
||
extras/libc.c
|
||
${CMAKE_BINARY_DIR}/include/vlc_about.h )
|
||
|
||
set( SOURCES_libvlccore ${SOURCES_libvlccore_common} )
|
||
|
||
if(SYS_DARWIN)
|
||
set( SOURCES_libvlccore ${SOURCES_libvlccore} ${SOURCES_libvlccore_darwin} )
|
||
elseif(SYS_BEOS)
|
||
set( SOURCES_libvlccore ${SOURCES_libvlccore} ${SOURCES_libvlccore_beos} )
|
||
elseif(SYS_WIN32)
|
||
set( SOURCES_libvlccore ${SOURCES_libvlccore} ${SOURCES_libvlccore_win32} )
|
||
elseif(SYS_LINUX)
|
||
set( SOURCES_libvlccore ${SOURCES_libvlccore} ${SOURCES_libvlccore_linux} )
|
||
else(SYS_DARWIN)
|
||
set( SOURCES_libvlccore ${SOURCES_libvlccore} ${SOURCES_libvlccore_other} )
|
||
endif(SYS_DARWIN)
|
||
|
||
|
||
add_library(libvlccore SHARED ${SOURCES_libvlccore})
|
||
|
||
set_target_properties(libvlccore PROPERTIES
|
||
OUTPUT_NAME vlccore
|
||
SOVERSION 0 VERSION 0.0.0)
|
||
|
||
if(UPDATE_CHECK)
|
||
target_link_libraries(libvlccore ${LIBM} ${LIBRT} ${LIBICONV} ${Dlopen_LIBRARIES} "-lgcrypt")
|
||
else(UPDATE_CHECK)
|
||
target_link_libraries(libvlccore ${LIBM} ${LIBRT} ${LIBICONV} ${Dlopen_LIBRARIES})
|
||
endif(UPDATE_CHECK)
|
||
|
||
# libvlc
|
||
set( SOURCES_libvlc
|
||
control/libvlc_internal.h
|
||
control/core.c
|
||
control/log.c
|
||
control/playlist.c
|
||
control/vlm.c
|
||
control/video.c
|
||
control/audio.c
|
||
control/event.c
|
||
control/flat_media_list_view.c
|
||
control/hierarchical_media_list_view.c
|
||
control/hierarchical_node_media_list_view.c
|
||
control/media.c
|
||
control/media_player.c
|
||
control/media_list.c
|
||
control/media_list_path.h
|
||
control/media_list_player.c
|
||
control/media_list_view.c
|
||
control/media_library.c
|
||
control/mediacontrol_internal.h
|
||
control/mediacontrol_core.c
|
||
control/mediacontrol_util.c
|
||
control/mediacontrol_audio_video.c
|
||
control/media_discoverer.c )
|
||
|
||
add_library(libvlc SHARED ${SOURCES_libvlc})
|
||
|
||
set_target_properties(libvlc PROPERTIES OUTPUT_NAME vlc)
|
||
set_target_properties(libvlc PROPERTIES SOVERSION 2)
|
||
set_target_properties(libvlccore PROPERTIES VERSION 0.0.0)
|
||
|
||
set_source_files_properties(${SOURCES_libvlc} PROPERTIES COMPILE_FLAGS -DMODULE_STRING=\\"control\\")
|
||
set_source_files_properties(${SOURCES_libvlccore} PROPERTIES COMPILE_FLAGS -DMODULE_STRING=\\"main\\")
|
||
|
||
target_link_libraries(libvlc libvlccore)
|
||
|
||
##########################################################
|
||
# Install
|
||
|
||
install(TARGETS libvlccore libvlc DESTINATION lib)
|
||
install(TARGETS vlc DESTINATION bin)
|
||
|
||
##########################################################
|
||
# Libraries
|
||
|
||
# Carbon
|
||
if(APPLE)
|
||
find_library(CARBON_FRAMEWORK Carbon)
|
||
target_link_libraries(libvlccore ${CARBON_FRAMEWORK})
|
||
endif(APPLE)
|
||
|
||
##########################################################
|
||
# revision.c
|
||
|
||
set(rev "${CMAKE_BINARY_DIR}/src/misc/revision.c")
|
||
exec_program(dirname ARGS ${rev} OUTPUT_VARIABLE rev_dir)
|
||
|
||
add_custom_command(
|
||
OUTPUT ${rev}
|
||
COMMAND rm -f ${rev} ${rev}.tmp
|
||
COMMAND mkdir -p ${rev_dir}
|
||
COMMAND sh -c "echo '/* AUTOGENERATED FILE - DO NOT EDIT */' > ${rev}.tmp"
|
||
COMMAND sh -c "printf 'const char psz_vlc_changeset[] = \"' >> ${rev}.tmp"
|
||
COMMAND sh -c "printf `LANG=C git --git-dir=${CMAKE_SOURCE_DIR}/.git show-ref -s HEAD 2>/dev/null || printf exported` >> ${rev}.tmp"
|
||
COMMAND sh -c "echo '\";' >> ${rev}.tmp"
|
||
COMMAND mv -f ${rev}.tmp ${rev}
|
||
VERBATIM
|
||
)
|
||
set(rev)
|
||
|
||
##########################################################
|
||
# builtin.h
|
||
# No real use for this one, we just used to need it.
|
||
# We should really remove that.
|
||
set(builtin "${CMAKE_BINARY_DIR}/src/modules/builtin.h")
|
||
exec_program(dirname ARGS ${builtin} OUTPUT_VARIABLE builtin_dir)
|
||
|
||
add_custom_command(
|
||
OUTPUT ${builtin}
|
||
COMMAND mkdir -p ${builtin_dir}
|
||
COMMAND sh -c "echo '/* Auto generated by ${CMAKE_CURRENT_BUILD_DIR}/CMakeLists.txt */' > ${builtin}"
|
||
COMMAND sh -c "echo 'int vlc_entry__main( module_t* );' >> ${builtin}"
|
||
COMMAND sh -c "echo '#define ALLOCATE_ALL_BUILTINS() do {} while(0)' >> ${builtin}"
|
||
VERBATIM
|
||
)
|
||
set(should)
|
||
|
||
##########################################################
|
||
# vlc_about.h
|
||
set(about "${CMAKE_BINARY_DIR}/include/vlc_about.h")
|
||
exec_program(dirname ARGS ${about} OUTPUT_VARIABLE about_dir)
|
||
|
||
add_custom_command(
|
||
OUTPUT ${about}
|
||
COMMAND rm -f "${about}.tmp"
|
||
COMMAND mkdir -p ${about_dir}
|
||
COMMAND sh -c "echo '/* Automatically generated file - DO NOT EDIT */' > ${about}.tmp"
|
||
COMMAND sh -c "echo 'static const char psz_license[] =' >> ${about}.tmp"
|
||
COMMAND sh -c "cat ${CMAKE_SOURCE_DIR}/COPYING | sed s/\\\"/''/g | awk '{ print \"\\\"\"$0\"\\\\n\\\"\" }' >> ${about}.tmp"
|
||
COMMAND sh -c "echo ';' >> ${about}.tmp"
|
||
COMMAND sh -c "echo 'static const char psz_thanks[] =' >> ${about}.tmp"
|
||
COMMAND sh -c "grep -v '$$Id:' ${CMAKE_SOURCE_DIR}/THANKS | sed 's/\"/''/g' | awk '{ print \"\\\"\"$0\"\\\\n\\\"\" }'|sed 's/\"<.*.> \"//' >> ${about}.tmp"
|
||
COMMAND sh -c "echo ';' >> ${about}.tmp"
|
||
COMMAND sh -c "echo 'static const char psz_authors[] =' >> ${about}.tmp"
|
||
COMMAND sh -c "grep N: ${CMAKE_SOURCE_DIR}/AUTHORS | cut -d '\ ' -f 2- | sed 's/\"/''/g' | awk '{ print \"\\\"\"$0\"\\\\n\\\"\" }' >> ${about}.tmp"
|
||
COMMAND sh -c "echo ';' >> ${about}.tmp"
|
||
COMMAND sh -c "mv -f -- ${about}.tmp ${about}"
|
||
DEPENDS ${CMAKE_SOURCE_DIR}/AUTHORS ${CMAKE_SOURCE_DIR}/THANKS ${CMAKE_SOURCE_DIR}/COPYING
|
||
VERBATIM
|
||
)
|
||
set(about)
|
||
|
||
|
||
##########################################################
|
||
# SET_TARGET_PROPERTIES
|
||
|
||
# FIXME: Should probably be autodetected in configure?
|
||
# FIXME: This breaks on FreeBSD also
|
||
#if(NOT APPLE)
|
||
# set(LINK_FLAGS "-z defs --as-needed")
|
||
#endif(NOT APPLE)
|
||
|
||
target_link_libraries(libvlccore "${CMAKE_THREAD_LIBS_INIT}")
|
||
target_link_libraries(libvlc "${CMAKE_THREAD_LIBS_INIT}")
|
||
|
||
set_target_properties(libvlccore libvlc vlc PROPERTIES COMPILE_FLAGS
|
||
"-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" )
|
||
|
||
##########################################################
|
||
# Tests
|
||
|
||
add_executable(test_i18n_atof test/i18n_atof.c)
|
||
add_executable(test_url test/url.c)
|
||
add_executable(test_utf8 test/utf8.c)
|
||
add_executable(test_dictionary test/dictionary.c)
|
||
|
||
target_link_libraries(test_i18n_atof libvlccore)
|
||
target_link_libraries(test_url libvlccore)
|
||
target_link_libraries(test_utf8 libvlccore)
|
||
target_link_libraries(test_dictionary libvlccore)
|
||
|
||
add_test(test_i18n_atof ${CMAKE_CURRENT_BINARY_DIR}/test_i18n_atof)
|
||
add_test(test_url ${CMAKE_CURRENT_BINARY_DIR}/test_url)
|
||
add_test(test_utf8 ${CMAKE_CURRENT_BINARY_DIR}/test_utf8)
|
||
add_test(test_dictionary ${CMAKE_CURRENT_BINARY_DIR}/test_dictionary)
|
||
|