]> git.sesse.net Git - vlc/blobdiff - extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt
control: Remove dynamic_media_list_*.
[vlc] / extras / buildsystem / cmake / CMakeLists / src_CMakeLists.txt
index fdd4434ebe40cb00090c4c677f48babe0fc47e74..c380d31aebb75ca6e705fa4f7937721e587afa78 100644 (file)
@@ -1,15 +1,13 @@
-include_directories( . )
 
 add_definitions(-Dasm=__asm__ -D_INTL_REDIRECT_MACROS)
 add_definitions(-DLOCALEDIR=\\"${CMAKE_INSTALL_PREFIX}/locale\\")
 add_definitions(-DPLUGIN_PATH=\\"${CMAKE_INSTALL_PREFIX}/lib/vlc\\")
+add_definitions(-DDATA_PATH=\\"${CMAKE_INSTALL_PREFIX}/share/vlc\\")
 
 # vlc
 add_executable(vlc vlc.c)
 target_link_libraries(vlc libvlc)
 
-install_targets(/bin vlc)
-
 # libvlc
 
 set( SOURCES_libvlc_beos misc/beos_specific.cpp )
@@ -22,7 +20,6 @@ set( SOURCES_libvlc_common
     libvlc-common.c
     libvlc.h
     libvlc-module.c
-    interface/interface.h
     interface/interface.c
     interface/intf_eject.c
     interface/interaction.c
@@ -109,6 +106,7 @@ set( SOURCES_libvlc_common
     config/core.c
     config/chain.c
     config/file.c
+    config/intf.c
     config/cmdline.c
     misc/events.c
     misc/image.c
@@ -132,17 +130,16 @@ if(SYS_DARWIN)
 endif(SYS_DARWIN)
 
 add_library(libvlc SHARED ${SOURCES_libvlc})
-install_targets(/lib libvlc)
-
-set_target_properties(libvlc PROPERTIES OUTPUT_NAME vlc)
-set_target_properties(libvlc PROPERTIES SOVERSION 1)
-set_target_properties(libvlc PROPERTIES VERSION 1.0.0)
 
-target_link_libraries(libvlc ${LIBM})
-target_link_libraries(libvlc ${LIBRT})
-target_link_libraries(libvlc ${LIBICONV})
-target_link_libraries(libvlc ${Dlopen_LIBRARIES})
+set_target_properties(libvlc PROPERTIES
+        OUTPUT_NAME vlc
+        SOVERSION 1 VERSION 1.0.0)
 
+if(UPDATE_CHECK)
+target_link_libraries(libvlc ${LIBM} ${LIBRT} ${LIBICONV} ${Dlopen_LIBRARIES} "-lgcrypt")
+else(UPDATE_CHECK)
+target_link_libraries(libvlc ${LIBM} ${LIBRT} ${LIBICONV} ${Dlopen_LIBRARIES})
+endif(UPDATE_CHECK)
 
 # libvlc-control
 set( SOURCES_libvlc_control
@@ -153,7 +150,6 @@ set( SOURCES_libvlc_control
      control/vlm.c
      control/video.c
      control/audio.c
-     control/dynamic_media_list.c
      control/event.c
      control/flat_media_list_view.c
      control/hierarchical_media_list_view.c
@@ -169,11 +165,9 @@ set( SOURCES_libvlc_control
      control/mediacontrol_core.c
      control/mediacontrol_util.c
      control/mediacontrol_audio_video.c
-     control/media_discoverer.c
-     control/tag_query.c )
+     control/media_discoverer.c )
 
 add_library(libvlc-control SHARED ${SOURCES_libvlc_control})
-install_targets(/lib libvlc-control)
 
 set_target_properties(libvlc-control PROPERTIES OUTPUT_NAME vlc-control)
 set_target_properties(libvlc-control PROPERTIES SOVERSION 0)
@@ -181,6 +175,12 @@ set_target_properties(libvlc PROPERTIES VERSION 0.0.0)
 
 target_link_libraries(libvlc-control libvlc)
 
+##########################################################
+# Install
+
+install(TARGETS libvlc libvlc-control DESTINATION lib)
+install(TARGETS vlc DESTINATION bin)
+
 ##########################################################
 # Libraries
 
@@ -194,14 +194,16 @@ 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 `dirname ${rev}`
-COMMAND    echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > ${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    echo "\";" >> ${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 svnversion ${CMAKE_SOURCE_DIR} || printf \"exported\"` >> ${rev}.tmp"
+COMMAND    sh -c "echo '\";' >> ${rev}.tmp"
 COMMAND    mv -f ${rev}.tmp ${rev}
 VERBATIM
 )
@@ -212,13 +214,14 @@ set(rev)
 # 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 `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 "#define ALLOCATE_ALL_BUILTINS() do {} while(0)" >> ${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)
@@ -226,22 +229,23 @@ 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 `dirname ${about}`
-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}"
+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
 )
@@ -256,24 +260,30 @@ if(NOT APPLE)
    set(LINK_FLAGS "-z defs --as-needed")
 endif(NOT APPLE)
 
-set_target_properties(libvlc libvlc-control PROPERTIES LINK_FLAGS "${LINK_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
+target_link_libraries(libvlc "${CMAKE_THREAD_LIBS_INIT}")
+target_link_libraries(libvlc-control "${CMAKE_THREAD_LIBS_INIT}")
+
 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 -I${CMAKE_BINARY_DIR}/src -I${CMAKE_BINARY_DIR}/include" )
 
 ##########################################################
 # Tests
 
-add_executable(testapi   control/testapi.c)
-add_executable(i18n_atof test/i18n_atof.c)
-add_executable(url       test/url.c)
-add_executable(utf8      test/utf8.c)
+add_executable(test_testapi    control/testapi.c)
+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_testapi    libvlc-control)
+target_link_libraries(test_i18n_atof  libvlc)
+target_link_libraries(test_url        libvlc)
+target_link_libraries(test_utf8       libvlc)
+target_link_libraries(test_dictionary libvlc)
 
-target_link_libraries(testapi   libvlc-control)
-target_link_libraries(i18n_atof libvlc)
-target_link_libraries(url       libvlc)
-target_link_libraries(utf8      libvlc)
+add_test(test_control    ${CMAKE_CURRENT_BINARY_DIR}/test_testapi)
+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)
 
-add_test(testapi   ${EXECUTABLE_OUTPUT_PATH}/testapi)
-add_test(i18n_atof ${EXECUTABLE_OUTPUT_PATH}/i18n_atof)
-add_test(url       ${EXECUTABLE_OUTPUT_PATH}/url)
-add_test(utf8      ${EXECUTABLE_OUTPUT_PATH}/utf8)