[vlmc-devel] Use cmake's externalproject to fetch libvlcpp

Hugo Beauzée-Luyssen git at videolan.org
Tue May 24 00:37:12 CEST 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Apr 10 16:10:01 2016 +0200| [02179aac91ed7c95989f0626f4ec4f28763a9ffd] | committer: Hugo Beauzée-Luyssen

Use cmake's externalproject to fetch libvlcpp

> https://code.videolan.org/videolan/vlmc/commit/02179aac91ed7c95989f0626f4ec4f28763a9ffd
---

 .gitmodules                         |  3 ---
 CMakeLists.txt                      |  1 +
 contribs/CMakeLists.txt             | 17 +++++++++++++++++
 src/Backend/VLC/VLCBackend.h        |  2 +-
 src/Backend/VLC/VLCSource.h         |  2 +-
 src/Backend/VLC/VLCSourceRenderer.h |  2 +-
 src/Backend/VLC/libvlcpp            |  1 -
 src/CMakeLists.txt                  |  4 +++-
 8 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/.gitmodules b/.gitmodules
index ddbb102..e69de29 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "src/Backend/VLC/libvlcpp"]
-	path = src/Backend/VLC/libvlcpp
-	url = https://code.videolan.org/videolan/libvlcpp.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6fffdff..3157f72 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,6 +123,7 @@ IF (UNIX)
 ENDIF (UNIX)
 
 include(ts/translations.cmake)
+subdirs(contribs)
 SUBDIRS(src)
 SUBDIRS(nsis)
 SUBDIRS(effects)
diff --git a/contribs/CMakeLists.txt b/contribs/CMakeLists.txt
new file mode 100644
index 0000000..ad93d1e
--- /dev/null
+++ b/contribs/CMakeLists.txt
@@ -0,0 +1,17 @@
+project(vlmc)
+
+include(ExternalProject)
+
+set( PREFIX ${PROJECT_BINARY_DIR}/contribs )
+set( CONTRIBS_DIR ${PREFIX}/install PARENT_SCOPE )
+
+# Find libvlcpp
+ExternalProject_Add(
+    libvlcpp
+    PREFIX ${PREFIX}
+    UPDATE_COMMAND ""
+    GIT_REPOSITORY https://code.videolan.org/videolan/libvlcpp.git
+    CONFIGURE_COMMAND <SOURCE_DIR>/bootstrap && <SOURCE_DIR>/configure --prefix=${PREFIX}/install --disable-examples
+    BUILD_COMMAND make
+    INSTALL_COMMAND make install
+)
diff --git a/src/Backend/VLC/VLCBackend.h b/src/Backend/VLC/VLCBackend.h
index bc85fdc..6059967 100644
--- a/src/Backend/VLC/VLCBackend.h
+++ b/src/Backend/VLC/VLCBackend.h
@@ -27,7 +27,7 @@
 
 #include "Backend/IBackend.h"
 #include "Tools/Singleton.hpp"
-#include "libvlcpp/vlcpp/vlc.hpp"
+#include "vlcpp/vlc.hpp"
 
 namespace Backend
 {
diff --git a/src/Backend/VLC/VLCSource.h b/src/Backend/VLC/VLCSource.h
index 4fee4dc..534f8a8 100644
--- a/src/Backend/VLC/VLCSource.h
+++ b/src/Backend/VLC/VLCSource.h
@@ -26,7 +26,7 @@
 #include <QtGlobal>
 
 #include "Backend/ISource.h"
-#include "libvlcpp/vlcpp/vlc.hpp"
+#include "vlcpp/vlc.hpp"
 
 namespace Backend
 {
diff --git a/src/Backend/VLC/VLCSourceRenderer.h b/src/Backend/VLC/VLCSourceRenderer.h
index f03ba86..44a5c80 100644
--- a/src/Backend/VLC/VLCSourceRenderer.h
+++ b/src/Backend/VLC/VLCSourceRenderer.h
@@ -28,7 +28,7 @@
 
 #include "Backend/ISourceRenderer.h"
 
-#include "libvlcpp/vlcpp/vlc.hpp"
+#include "vlcpp/vlc.hpp"
 
 namespace Backend
 {
diff --git a/src/Backend/VLC/libvlcpp b/src/Backend/VLC/libvlcpp
deleted file mode 160000
index d4d6599..0000000
--- a/src/Backend/VLC/libvlcpp
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit d4d659900a234422aa542816a6387bc8716f8a94
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 238bffa..ae498ca 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -285,7 +285,9 @@ ELSE(NOT WITH_GUI)
     endif()
 ENDIF( NOT WITH_GUI )
 
-#ADD_DEPENDENCIES( vlmc translations )
+add_dependencies(vlmc libvlcpp)
+message(STATUS "Contribs prefix: ${CONTRIBS_DIR}")
+include_directories( ${CONTRIBS_DIR}/include )
 
 INSTALL(TARGETS vlmc
         BUNDLE  DESTINATION ${VLMC_BIN_DIR}



More information about the Vlmc-devel mailing list