Commit 65f35e28 authored by Rafaël Carré's avatar Rafaël Carré

Fix various bugs / missing checks for cmake

Add ENABLE_NLS define, and make po files optional
Update source files to latest modifications
Add missing function checks
Define QT4LOCALEDIR
Require ncurses (I will submit a patch to cmake to check for ncursesw)
parent 7d218020
......@@ -35,7 +35,9 @@ include_directories(${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include)
add_subdirectory(libs/loader)
add_subdirectory(src)
add_subdirectory(modules)
add_subdirectory(po)
if(ENABLE_NLS)
add_subdirectory(po)
endif(ENABLE_NLS)
add_subdirectory(test)
# Enable uninstall
......
......@@ -6,7 +6,11 @@ add_definitions(-DPLUGIN_PATH="${CMAKE_INSTALL_PREFIX}/lib/vlc")
add_definitions(-DDATA_PATH="${CMAKE_INSTALL_PREFIX}/share/vlc")
# vlc
add_executable(vlc vlc.c)
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
......@@ -20,7 +24,6 @@ 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-common.c
libvlc.h
libvlc-module.c
interface/interface.c
......@@ -107,6 +110,7 @@ set( SOURCES_libvlccore_common
misc/cpu.c
config/configuration.h
config/core.c
config/dirs.c
config/chain.c
config/file.c
config/intf.c
......@@ -125,6 +129,7 @@ set( SOURCES_libvlccore_common
input/vlmshell.c
misc/xml.c
misc/devices.c
version.c
extras/libc.c
${CMAKE_BINARY_DIR}/include/vlc_about.h )
......
......@@ -286,6 +286,7 @@
#cmakedefine HAVE_UNISTD_H
#cmakedefine HAVE_UNSIGNED_LONG_LONG
#cmakedefine HAVE_UNSIGNED_LONG_LONG_INT
#cmakedefine HAVE_USELOCALE
#cmakedefine HAVE_VASPRINTF
#cmakedefine HAVE_VA_COPY
#cmakedefine HAVE_VCDINFO
......
......@@ -20,7 +20,8 @@ OPTION( ENABLE_DYNAMIC_PLUGINS "Enable dynamic plugin" ON )
OPTION( UPDATE_CHECK "Enable automatic new version checking" OFF )
OPTION( ENABLE_NO_SYMBOL_CHECK "Don't check symbols of modules against libvlc. (Enabling this option speeds up compilation)" OFF )
OPTION( ENABLE_CONTRIB "Attempt to use VLC contrib system to get the third-party libraries" ON )
OPTION( ENABLE_LOADER "Enable the win32 codec loader" ON )
OPTION( ENABLE_LOADER "Enable the win32 codec loader" OFF )
OPTION( ENABLE_NLS "Enable translation of the program's messages" ON)
if(ENABLE_CONTRIB)
......@@ -71,6 +72,7 @@ set(VLC_VERSION_EXTRA "-svn")
set(VLC_VERSION ${VLC_VERSION_MAJOR}.${VLC_VERSION_MINOR}.${VLC_VERSION_PATCH}${VLC_VERSION_EXTRA})
set(PACKAGE "vlc")
set(PACKAGE_NAME "vlc") #for gettext
set(PACKAGE_VERSION "${VLC_VERSION}")
set(PACKAGE_STRING "vlc")
set(VERSION_MESSAGE "vlc-${VLC_VERSION}")
......@@ -134,8 +136,8 @@ find_package (Threads)
set(CMAKE_REQUIRED_LIBRARIES c)
set(CMAKE_EXTRA_INCLUDE_FILES string.h)
vlc_check_functions_exist(strcpy strcasecmp)
vlc_check_functions_exist(strcasestr strdup)
vlc_check_functions_exist(strcpy strcasecmp strncasecmp)
vlc_check_functions_exist(strcasestr stristr strdup)
vlc_check_functions_exist(strndup stricmp strnicmp)
vlc_check_functions_exist(atof strtoll atoll lldiv)
vlc_check_functions_exist(strlcpy stristr strnlen strsep)
......@@ -177,6 +179,10 @@ set(CMAKE_EXTRA_INCLUDE_FILES sys/mman.h)
vlc_check_functions_exist(mmap)
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_EXTRA_INCLUDE_FILES locale.h)
vlc_check_functions_exist(uselocale)
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_REQUIRED_LIBRARIES)
check_library_exists(poll poll "" HAVE_POLL)
......@@ -503,7 +509,12 @@ if(QT4_FOUND)
include_directories(${QT_INCLUDES})
vlc_check_include_files (qt.h)
vlc_enable_modules(qt4)
vlc_add_module_compile_flag(qt4 ${QT_CFLAGS} )
#execute_process leaves the trailing newline appended to the variable, unlike exec_program
#execute_process( COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix QtCore OUTPUT_VARIABLE QT4LOCALEDIR)
exec_program( ${PKG_CONFIG_EXECUTABLE} ARGS --variable=prefix QtCore OUTPUT_VARIABLE QT4LOCALEDIR)
set(QT4LOCALEDIR ${QT4LOCALEDIR}/share/qt4/translations )
vlc_add_module_compile_flag(qt4 ${QT_CFLAGS})
vlc_add_module_compile_flag(qt4 -DQT4LOCALEDIR=\\\\"${QT4LOCALEDIR}\\\\" )
vlc_module_add_link_libraries(qt4 ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
# Define our own qt4_wrap_ui macro to match wanted behaviour
......@@ -567,6 +578,7 @@ if(Live555_FOUND)
vlc_module_add_link_libraries(live555 ${Live555_LIBRARIES})
endif(Live555_FOUND)
set(CURSES_NEED_NCURSES TRUE)
find_package(Curses)
if(CURSES_LIBRARIES)
vlc_enable_modules(ncurses)
......
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