[vlmc-devel] cmake: macos: Fix application bundle for local run
Hugo Beauzée-Luyssen
git at videolan.org
Wed Feb 5 00:24:32 CET 2014
vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Feb 5 00:16:29 2014 +0200| [1303fb1d5d91727bea792aed90d329fd1fb5bb2e] | committer: Hugo Beauzée-Luyssen
cmake: macos: Fix application bundle for local run
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=1303fb1d5d91727bea792aed90d329fd1fb5bb2e
---
cmake/FixBundle.sh | 16 ++++++++++++++++
src/CMakeLists.txt | 26 ++++++++++++--------------
2 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/cmake/FixBundle.sh b/cmake/FixBundle.sh
new file mode 100755
index 0000000..f530978
--- /dev/null
+++ b/cmake/FixBundle.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+if [ $# -lt 2 ] ; then
+ echo "Usage: $0 <vlmc_binary_path> <libvlc_dir>"
+ exit 1
+fi
+
+VLMC_BIN_DIR=$1
+VLMC_BIN="$VLMC_BIN_DIR/vlmc"
+LIBVLC_DIR=$2
+
+install_name_tool -change @loader_path/lib/libvlc.5.dylib @executable_path/lib/libvlc.5.dylib $VLMC_BIN
+install_name_tool -change @loader_path/lib/libvlccore.7.dylib @executable_path/lib/libvlccore.7.dylib $VLMC_BIN
+
+ln -Fs $LIBVLC_DIR/../lib $VLMC_BIN_DIR
+ln -Fs $LIBVLC_DIR/../plugins $VLMC_BIN_DIR
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 874d0be..b803407 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -277,18 +277,16 @@ IF(UNIX)
ENDIF(WITH_PROFILING)
ENDIF(UNIX)
-IF( APPLE )
- SET(CONTRIBS_DIR ${CMAKE_SOURCE_DIR}/contribs/)
- ADD_CUSTOM_COMMAND(
- TARGET vlmc
- POST_BUILD
- COMMAND cp -r ${CONTRIBS_DIR}/include ${CONTRIBS_DIR}/lib ${CONTRIBS_DIR}/plugins ${CONTRIBS_DIR}/effects ${CONTRIBS_DIR}/ts ${CMAKE_CURRENT_BINARY_DIR}/../bin/vlmc.app/Contents/MacOS
- )
- ADD_CUSTOM_COMMAND(
- TARGET vlmc
+if( APPLE )
+ set(APPLICATION_BUNDLE ${CMAKE_BINARY_DIR}/bin/vlmc.app)
+ set(APPLICATION_LIB_DIR ${LIBVLC_LIB_DIR})
+
+ # re-enable this when we start addressing redistribution
+ # message(STATUS "Looking for bundle ${APPLICATION_BUNDLE} with library path ${APPLICATION_LIB_DIR}")
+ # install(CODE "include(BundleUtilities)
+ add_custom_command(TARGET vlmc
POST_BUILD
- COMMAND macdeployqt ${CMAKE_CURRENT_BINARY_DIR}/../bin/vlmc.app -no-plugins #-dmg
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMENT "Deploying the Qt Framework onto the bundle"
- )
-ENDIF( APPLE )
+ COMMAND ${CMAKE_SOURCE_DIR}/cmake/FixBundle.sh ${APPLICATION_BUNDLE}/Contents/MacOS ${LIBVLC_LIB_DIR}
+ COMMENT "Fixing application bundle for local run")
+ # fixup_bundle(\"${APPLICATION_BUNDLE}\" \"\" \"${APPLICATION_LIB_DIR}\")" COMPONENT Runtime)
+endif()
More information about the Vlmc-devel
mailing list