cmake: Correctly build qt4.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 8 Feb 2008 16:36:20 +0000 (16:36 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 8 Feb 2008 16:36:20 +0000 (16:36 +0000)
extras/buildsystem/cmake/CMakeLists/qt4_CMakeLists.txt [new file with mode: 0644]
extras/buildsystem/cmake/include/config.cmake
extras/buildsystem/cmake/scripts/convert_vlc_to_cmake.sh

diff --git a/extras/buildsystem/cmake/CMakeLists/qt4_CMakeLists.txt b/extras/buildsystem/cmake/CMakeLists/qt4_CMakeLists.txt
new file mode 100644 (file)
index 0000000..c6db4e9
--- /dev/null
@@ -0,0 +1,10 @@
+set(qt4_SOURCES qt4.cpp menus.cpp main_interface.cpp dialogs_provider.cpp input_manager.cpp dialogs/playlist.cpp dialogs/bookmarks.cpp dialogs/preferences.cpp dialogs/mediainfo.cpp dialogs/extended.cpp dialogs/messages.cpp dialogs/errors.cpp dialogs/interaction.cpp dialogs/sout.cpp dialogs/help.cpp dialogs/gototime.cpp dialogs/open.cpp dialogs/vlm.cpp dialogs/podcast_configuration.cpp components/extended_panels.cpp components/info_panels.cpp components/preferences_widgets.cpp components/complete_preferences.cpp components/simple_preferences.cpp components/open_panels.cpp components/interface_widgets.cpp components/playlist/playlist_model.cpp components/playlist/playlist_item.cpp components/playlist/standardpanel.cpp components/playlist/playlist.cpp components/playlist/selector.cpp util/input_slider.cpp util/customwidgets.cpp util/registry.cpp )
+set(qt4_UIS ui/equalizer.ui ui/v4l2.ui ui/video_effects.ui ui/open_file.ui ui/open_disk.ui ui/open_net.ui ui/open_capture.ui ui/open.ui ui/podcast_configuration.ui ui/sprefs_audio.ui ui/sprefs_input.ui ui/sprefs_interface.ui ui/sprefs_subtitles.ui ui/sprefs_video.ui ui/streampanel.ui ui/sout.ui ui/vlm.ui ) 
+
+if(QT4_FOUND)
+    include_directories(${CMAKE_CURRENT_BINARY_DIR})
+    qt4_automoc(${qt4_SOURCES})
+    vlc_qt4_wrap_ui(qt4_UIS_H ${qt4_UIS})
+endif(QT4_FOUND)
+vlc_add_module(qt4 ${qt4_SOURCES} ${qt4_UIS_H})
+
index c0980e6..3a21735 100644 (file)
@@ -398,7 +398,23 @@ if(QT4_FOUND)
   vlc_check_include_files (qt.h)
   vlc_enable_modules(qt4)
   vlc_add_module_compile_flag(qt4 ${QT_CFLAGS} )
-  vlc_module_add_link_libraries(qt4 ${QT_LIBRARIES} Qt4)
+  vlc_module_add_link_libraries(qt4 ${QT_LIBRARIES})
+  # Define our own qt4_wrap_ui macro to match wanted behaviour
+  MACRO (VLC_QT4_WRAP_UI outfiles )
+    FOREACH (it ${ARGN})
+     string(REPLACE ".ui" ".h" outfile "${it}")
+      GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
+      SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/${outfile})
+      ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+        COMMAND mkdir -p `dirname ${outfile}`
+        COMMAND ${QT_UIC_EXECUTABLE}
+        ARGS -o ${outfile} ${infile}
+        MAIN_DEPENDENCY ${infile})
+      SET(${outfiles} ${${outfiles}} ${outfile})
+    ENDFOREACH (it)
+
+  ENDMACRO (VLC_QT4_WRAP_UI)
+
 endif(QT4_FOUND)
 
 find_package(OpenGL)
index 32ebd63..c983b98 100755 (executable)
@@ -19,6 +19,9 @@ ln -sf ../$cmake_dir/CMakeLists/src_CMakeLists.txt src/CMakeLists.txt
 echo "Installing modules/CMakeLists.txt"
 ln -s ../$cmake_dir/CMakeLists/modules_CMakeLists.txt modules/CMakeLists.txt
 
+echo "Installing modules/gui/qt4/CMakeLists.txt"
+ln -s ../../../$cmake_dir/CMakeLists/qt4_CMakeLists.txt modules/gui/qt4/CMakeLists.txt
+
 echo "Installing po/CMakeLists.txt"
 ln -s ../$cmake_dir/CMakeLists/po_CMakeLists.txt po/CMakeLists.txt