]> git.sesse.net Git - vlc/commitdiff
Fix various bugs / missing checks for cmake
authorRafaël Carré <funman@videolan.org>
Sun, 1 Jun 2008 18:32:25 +0000 (20:32 +0200)
committerRafaël Carré <funman@videolan.org>
Sun, 1 Jun 2008 18:32:25 +0000 (20:32 +0200)
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)

extras/buildsystem/cmake/CMakeLists/root_CMakeLists.txt
extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt
extras/buildsystem/cmake/config.h.cmake
extras/buildsystem/cmake/include/config.cmake

index df4cf75e4d684363af6a0d0b4a243e277be0db06..43f923343946c770330084b4d1756380728085d5 100644 (file)
@@ -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
index 8315c0ba930786883c553a3d417afada0fc1e372..f96a62ce1ff1789a3defe8a7299188421e39f281 100644 (file)
@@ -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 )
 
index c86e15f69a71b3c8cc0817154b3b0efff1820094..a4ee546933ca068b12e66b00e2113acc53ffc4ba 100644 (file)
 #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
index d7f9fc2c6ae04136e267799ebd33ce312e133e94..2cea7d3963434b9fed5a77e8d8ab830b8c49cbe6 100644 (file)
@@ -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)