Commit fe2f0d60 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Switch to autotools

parent 5f55ab75
......@@ -3,7 +3,6 @@
/debug
/patches
/qtc-gdbmacros
Makefile*
/include
/win32
......
#
# VLMC build system
# Authors: Rohit Yadav <rohityadav89@gmail.com>
# Ludovic Fauvet <etix@vlmc.org>
# Hugo Beauzée-Luyssen <hugo@beauzee.fr>
#
cmake_minimum_required(VERSION 3.1)
# Set path to additional CMake modules
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
include(git-version)
# Project Info
SET(PROJECT_NAME_SHORT "VLMC")
SET(PROJECT_NAME_LONG "VideoLAN Movie Creator")
SET(PROJECT_DESCRIPTION "VLMC (VideoLAN Movie Creator) is a cross-platform, non-linear video editing software based on the VLC Media Player.")
string(TIMESTAMP CURRENT_YEAR "%Y")
SET(PROJECT_COPYRIGHT "Copyright (C) 2008-${CURRENT_YEAR} VideoLAN")
SET(PROJECT_CONTACT "vlmc-devel@videolan.org")
SET(PROJECT_VENDOR "VLMC Team")
SET(ORG_WEBSITE "videolan.org")
# Configuring build type
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
MESSAGE("Setting build type to '${CMAKE_BUILD_TYPE}'")
ELSE(NOT CMAKE_BUILD_TYPE)
MESSAGE("Build type set to '${CMAKE_BUILD_TYPE}'")
ENDIF(NOT CMAKE_BUILD_TYPE)
IF(WIN32)
# Building in release for WIN32
SET(CMAKE_BUILD_TYPE "Release")
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
# Use mingw's sprintf instead of windows's
ADD_DEFINITIONS( -D__USE_MINGW_ANSI_STDIO=1 )
ENDIF(WIN32)
# version: 0.2.x
STRING(TOLOWER ${PROJECT_NAME_SHORT} PROJECT_NAME_SHORT_LOWER)
PROJECT(${PROJECT_NAME_SHORT_LOWER} VERSION 0.2.0)
append_git_version()
MESSAGE(STATUS "VLMC Version: ${CPACK_PACKAGE_VERSION}")
SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
# Codename of the Project :-)
SET(CODENAME "alpha")
# System Information
SITE_NAME(HOSTNAME)
SET(SYSNAME ${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR})
# CMake Settings
SET(CMAKE_COLOR_MAKEFILE ON)
SET(CMAKE_VERBOSE_MAKEFILE OFF)
# Optionally allow embedding libvlc into the binary as
# VLMC requires libVLC
# SET (WITH_LIBVLC FALSE CACHE BOOL "Compile LibVLC in VLMC")
IF (UNIX)
SET(WITH_PROFILING FALSE CACHE BOOL "Build with profiling support" )
SET(CMAKE_INSTALL_PREFIX /usr)
SET(CPACK_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
ENDIF(UNIX)
SET(WITH_GUI TRUE CACHE BOOL "Enable the VLMC's GUI")
SET(WITH_CRASHBUTTON FALSE CACHE BOOL "Enable the crash button")
SET(WITH_CRASHHANDLER_GUI FALSE CACHE BOOL "Enable the crash handler GUI (with backtrace and restart capabilities)")
SET(WITH_CRASHHANDLER FALSE CACHE BOOL "Enable the crash handler")
# layout of VLMC installation
# (default values are platform-specific)
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/effects)
# Copy the sh launcher
IF (NOT WIN32)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/vlmc.sh" "${CMAKE_CURRENT_BINARY_DIR}/vlmc" COPYONLY)
ENDIF(NOT WIN32)
# common for MAC and UNIX
SET (DEFAULT_BIN_SUBDIR bin)
SET (DEFAULT_LIB_SUBDIR lib)
SET (DEFAULT_DATA_SUBDIR share)
SET (DEFAULT_SRC_SUBDIR src)
SET (DEFAULT_INCLUDE_SUBDIR include)
SET (VLMC_BIN_SUBDIR "${DEFAULT_BIN_SUBDIR}" CACHE STRING "Subdirectory where executables will be installed")
SET (VLMC_LIB_SUBDIR "${DEFAULT_LIB_SUBDIR}" CACHE STRING "Subdirectory where libraries will be installed")
SET (VLMC_DATA_SUBDIR "${DEFAULT_DATA_SUBDIR}" CACHE STRING "Subdirectory where VLMC data will be installed")
SET (VLMC_SRC_SUBDIR "${DEFAULT_SRC_SUBDIR}" CACHE STRING "Subdirectory where VLMC source is")
SET (VLMC_INCLUDE_SUBDIR "${DEFAULT_INCLUDE_SUBDIR}" CACHE STRING "Subdirectory where header files will be installed")
# full paths for the installation
SET (VLMC_BIN_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_BIN_SUBDIR})
SET (VLMC_LIB_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_LIB_SUBDIR})
SET (VLMC_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_INCLUDE_SUBDIR})
SET (VLMC_DATA_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_DATA_SUBDIR}/vlmc/)
SET (VLMC_DOC_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_DATA_SUBDIR}/doc/vlmc/)
SET (VLMC_EFFECTS_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_LIB_SUBDIR}/vlmc/effects/)
SET (VLMC_DESKTOP_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_DATA_SUBDIR}/applications/)
SET (VLMC_PIXMAPS_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_DATA_SUBDIR}/pixmaps/)
# manual page - makes sense only on unix systems
IF (UNIX)
SET (DEFAULT_MANUAL_SUBDIR ${VLMC_DATA_SUBDIR}/man)
SET (VLMC_MANUAL_SUBDIR "${DEFAULT_MANUAL_SUBDIR}" CACHE STRING "Subdirectory where manual files will be installed")
MARK_AS_ADVANCED (VLMC_MANUAL_SUBDIR)
SET (VLMC_MANUAL_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_MANUAL_SUBDIR})
ENDIF (UNIX)
include(ts/translations.cmake)
SUBDIRS(src)
SUBDIRS(nsis)
SUBDIRS(effects)
# Copy stuff to doc subdirectory
INSTALL (FILES AUTHORS COPYING INSTALL.md NEWS README.md THANKS TRANSLATORS
DESTINATION ${VLMC_DOC_DIR})
# Copy .desktop file
INSTALL (FILES share/vlmc.desktop DESTINATION ${VLMC_DESKTOP_DIR})
# Copy the VLMC pixmap
INSTALL (FILES share/vlmc.png DESTINATION ${VLMC_PIXMAPS_DIR})
# On UNIX copy the man page
IF (UNIX)
INSTALL (FILES ${CMAKE_SOURCE_DIR}/doc/vlmc.1
DESTINATION ${VLMC_MANUAL_DIR}/man1)
ENDIF (UNIX)
# Copy the share directory (TODO: add checks if the dir is empty, don't install)
# INSTALL (DIRECTORY share/ DESTINATION ${VLMC_DATA_DIR}
# PATTERN "*.desktop" EXCLUDE
# PATTERN "*.ico" EXCLUDE
# PATTERN "*.icns" EXCLUDE
# PATTERN "vlmc.png" EXCLUDE)
#############################################################
# Package Settings
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME_SHORT})
SET(CPACK_PACKAGE_DESCRIPTION ${PROJECT_NAME_LONG})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME_SHORT} \n ${PROJECT_DESCRIPTION}")
SET(CPACK_PACKAGE_VENDOR ${PROJECT_VENDOR})
SET(CPACK_PACKAGE_CONTACT ${PROJECT_CONTACT})
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README.md)
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
# Force Package Name
SET(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}${GIT_PATCH}-${CPACK_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
# NSIS Windows Installer
IF(WIN32 AND NOT UNIX)
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backslashes.
SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/share\\\\vlmc.png")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "\\\\vlmc.exe")
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} VLMC")
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\vlmc.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\vlmc.org")
SET(CPACK_NSIS_CONTACT ${PROJECT_CONTACT})
SET(CPACK_NSIS_MODIFY_PATH ON)
ELSE(WIN32 AND NOT UNIX)
#SET(CPACK_STRIP_FILES "VLMC")
#SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(WIN32 AND NOT UNIX)
# RPM packages
INCLUDE ( ${CMAKE_MODULE_PATH}/RpmBuild.cmake )
IF ( RPMBUILD_FOUND AND NOT WIN32 )
SET(CPACK_GENERATOR "RPM")
SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
SET(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
SET(CPACK_RPM_PACKAGE_VERSION ${PROJECT_VERSION})
SET(CPACK_RPM_PACKAGE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
SET(CPACK_RPM_PACKAGE_GROUP ${PROJECT_VENDOR})
SET(CPACK_RPM_PACKAGE_VENDOR ${PROJECT_VENDOR})
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
SET(CPACK_RPM_PACKAGE_ARCHITECTURE i386) # Change to your architecture here
SET(CPACK_RPM_PACKAGE_DEPENDS "qt ( >= 4.6 ), qt-x11 ( >= 4.6 )") # Specify dependencies here
SET(CPACK_SET_DESTDIR TRUE)
ENDIF ( RPMBUILD_FOUND AND NOT WIN32 )
# Debian packages
INCLUDE ( ${CMAKE_MODULE_PATH}/DpkgBuild.cmake )
IF ( DPKG_FOUND AND NOT WIN32 )
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
SET(CPACK_DEBIAN_PACKAGE_VERSION ${PROJECT_VERSION})
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR} <${CPACK_PACKAGE_CONTACT}>")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_DEBUG ON)
SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${PACKAGE_REQUIRES})
SET(CPACK_SET_DESTDIR TRUE)
ENDIF ( DPKG_FOUND AND NOT WIN32 )
# Mac Bundle
IF( APPLE )
SET(CPACK_GENERATOR "DragNDrop")
#Libraries are bundled directly
SET(CPACK_COMPONENT_LIBRARIES_HIDDEN TRUE)
# Bundle Properties
SET(MACOSX_BUNDLE_BUNDLE_NAME VLMC)
SET(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
SET(MACOSX_BUNDLE_LONG_VERSION_STRING "Version ${PROJECT_VERSION}")
#SET(CPACK_STRIP_FILES TRUE)
ENDIF( APPLE )
SET(CPACK_PACKAGE_EXECUTABLES "vlmc" "VLMC")
INCLUDE(CPack)
......@@ -280,7 +280,7 @@ Use simple aggregation to embed a Qt UI into your class.
Example:
| #include "ui_MyWidget.h"
| #include "ui/MyWidget.h"
|
| class MyWidget : public QFrame
| {
......
This diff is collapsed.
#! /bin/sh
set -x
cd "$(dirname "$0")"
autoreconf -fis
#
# VLMC DPKG Finder
# Authors: Rohit Yadav <rohityadav89@gmail.com>
#
FIND_PROGRAM(DPKG
NAMES dpkg-deb
PATHS "/usr/bin") #Add paths here
IF ( DPKG )
GET_FILENAME_COMPONENT(DPKG_PATH ${DPKG} ABSOLUTE)
MESSAGE(STATUS "Found dpkg-deb : ${DPKG_PATH}")
SET(DPKG_FOUND "YES")
ELSE ( DPKG )
MESSAGE(STATUS "dpkg-deb NOT found. deb generation will not be available")
SET(DPKG_FOUND "NO")
ENDIF ( DPKG )
# CMake module to search for frei0r
# Author: Rohit Yadav <rohityadav89@gmail.com>
#
# If it's found it sets FREI0R_FOUND to TRUE
# and following variables are set:
# FREI0R_INCLUDE_DIR
# Put here path to custom location
# example: /home/username/frei0r/include etc..
FIND_PATH( FREI0R_INCLUDE_DIR NAMES frei0r.h
PATHS
"$ENV{LIB_DIR}/include"
"/usr/include"
"/usr/include/frei0r"
"/usr/local/include"
"/usr/local/include/frei0r"
# Mac OS
"${CMAKE_CURRENT_SOURCE_DIR}/contribs/include"
# MingW
c:/msys/local/include
)
FIND_PATH(FREI0R_INCLUDE_DIR PATHS "${CMAKE_INCLUDE_PATH}" NAMES frei0r.h)
# TODO: If required, add code to link to some library
IF (FREI0R_INCLUDE_DIR)
SET(FREI0R_FOUND TRUE)
ENDIF (FREI0R_INCLUDE_DIR)
IF (FREI0R_FOUND)
IF (NOT FREI0R_FIND_QUIETLY)
MESSAGE(STATUS "Found frei0r include-dir path: ${FREI0R_INCLUDE_DIR}")
ENDIF (NOT FREI0R_FIND_QUIETLY)
ELSE (FREI0R_FOUND)
IF (FREI0R_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find frei0r")
ENDIF (FREI0R_FIND_REQUIRED)
ENDIF (FREI0R_FOUND)
#!/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
#
# VLMC RPM Finder
# Authors: Rohit Yadav <rohityadav89@gmail.com>
#
FIND_PROGRAM(RPMBUILD
NAMES rpmbuild
PATHS "/usr/bin")
IF ( RPMBUILD )
GET_FILENAME_COMPONENT(RPMBUILD_PATH ${RPMBUILD} ABSOLUTE)
MESSAGE(STATUS "Found rpmbuild : ${RPMBUILD_PATH}")
SET(RPMBUILD_FOUND "YES")
ELSE ( RPMBUILD )
MESSAGE(STATUS "rpmbuild NOT found. RPM generation will not be available")
SET(RPMBUILD_FOUND "NO")
ENDIF ( RPMBUILD )
#ifndef CONFIG_H
#define CONFIG_H
/* With crash button (tools->crash) */
#cmakedefine WITH_CRASHBUTTON
/* With crash handler */
#cmakedefine WITH_CRASHHANDLER
/* With crash handler GUI */
#cmakedefine WITH_CRASHHANDLER_GUI
/* Absolute path to plugins */
#cmakedefine VLMC_EFFECTS_DIR "@VLMC_EFFECTS_DIR@"
/* Host computer name */
#cmakedefine HOSTNAME "@HOSTNAME@"
/* OS Name */
#cmakedefine SYSNAME "@SYSNAME@"
/* VLMC's major version */
#cmakedefine PROJECT_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@"
/* VLMC's version */
#cmakedefine PROJECT_VERSION "@PROJECT_VERSION@"
/* Version Codename */
#cmakedefine CODENAME "@CODENAME@"
/* VLMC Copyright string */
#cmakedefine PROJECT_COPYRIGHT "@PROJECT_COPYRIGHT@"
/* VLMC Contact email */
#cmakedefine PROJECT_CONTACT "@PROJECT_CONTACT@"
/* VideoLAN website */
#cmakedefine ORG_WEBSITE "@ORG_WEBSITE@"
/* GUI application ? */
#cmakedefine WITH_GUI
#endif //CONFIG_H
function (append_git_version)
find_program(GIT git)
if(GIT)
execute_process(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT} rev-parse --short HEAD
OUTPUT_VARIABLE GIT_OUT OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(PROJECT_VERSION "${PROJECT_VERSION}-git-${GIT_OUT}" PARENT_SCOPE)
endif()
endfunction()
IDI_ICON1 ICON DISCARDABLE "share/vlmc.ico"
#
# VLMC build system
# Authors: Ludovic Fauvet <etix@vlmc.org>
#
# this one is important
SET(CMAKE_SYSTEM_NAME Windows)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
IF(NOT CMAKE_C_COMPILER)
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
ENDIF(NOT CMAKE_C_COMPILER)
IF(NOT CMAKE_CXX_COMPILER)
SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
ENDIF(NOT CMAKE_CXX_COMPILER)
IF(NOT CMAKE_WINDRES)
SET(CMAKE_WINDRES i586-mingw32msvc-windres)
ENDIF(NOT CMAKE_WINDRES)
#Explicity set rc_compiler flag
IF(NOT CMAKE_RC_COMPILER)
SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
ENDIF(NOT CMAKE_RC_COMPILER)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/contribs)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ALWAYS)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ALWAYS)
SET(CMAKE_INCLUDE_PATH ${CMAKE_SOURCE_DIR}/contribs/include)
#!/bin/sh
BIN="bin/vlmc"
if [ -f $BIN ]; then
exec $BIN "$@"
else
echo "VLMC not built, read INSTALL first"
fi
m4_define([VLMC_MAJOR], [0])
m4_define([VLMC_MINOR], [2])
m4_define([VLMC_MICRO], [0])
m4_define([VLMC_CODENAME], ["alpha"])
COPYRIGHT_YEARS="2008-2016"
AC_COPYRIGHT([Copyright $COPYRIGHT_YEARS VideoLAN])
AC_INIT([vlmc], [VLMC_MAJOR.VLMC_MINOR.VLMC_MICRO])
AC_LANG(C++)
AM_INIT_AUTOMAKE([foreign subdir-objects])
m4_ifdef([AM_SILENT_RULES], [
AM_SILENT_RULES([yes])
])
AC_CANONICAL_HOST
AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11([noext])
AX_CHECK_COMPILE_FLAG([-fPIC], [PIC_FLAGS=-fPIC])
CXXFLAGS="${CXXFLAGS} ${PIC_FLAGS}"
AC_CONFIG_MACRO_DIR([m4])
dnl
dnl Check the operating system
dnl
HAVE_WIN64="0"
HAVE_IOS="0"
HAVE_OSX="0"
case "${host_os}" in
"")
SYS=unknown
;;
linux*)
SYS=linux
;;
bsdi*)
SYS=bsdi
;;
freebsd*)
SYS=freebsd
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
LDFLAGS="${LDFLAGS} -L/usr/local/lib"
;;
openbsd*)
SYS=openbsd
CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
;;
netbsd*)
SYS=netbsd
;;
dragonfly*)
SYS=dragonfly
;;
darwin*)
dnl Force gcc "-arch" flag
ARCH_flag=""
case "${host}" in
i?86*)
ARCH_flag="-arch i386"
;;
ppc64*)
ARCH_flag="-arch ppc64"
;;
ppc*)
ARCH_flag="-arch ppc"
;;
x86_64*)
ARCH_flag="-arch x86_64"
;;
arm*)
ac_cv_c_bigendian="no"
ac_cv_c_attribute_packed="no"
;;
esac
SYS=darwin
CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
CXX="${CXX} -stdlib=libc++ -std=c++11"
CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
AC_EGREP_CPP(yes,
[#import <TargetConditionals.h>
#if TARGET_OS_IPHONE
yes
#endif],
[HAVE_IOS="1"],
[HAVE_OSX="1"])
dnl Allow binaries created on Lion to run on earlier releases
AC_EGREP_CPP(yes,
[#import <Cocoa/Cocoa.h>
#ifdef MAC_OS_X_VERSION_10_7
yes
#endif],
[AC_MSG_RESULT([yes])
AC_LIBOBJ([getdelim])
AC_LIBOBJ([strndup])
AC_LIBOBJ([strnlen])],)
dnl
dnl Handle Mac OS X SDK flags
dnl
AC_ARG_WITH(macosx-sdk,
[AS_HELP_STRING([--with-macosx-sdk=DIR],
[compile using the SDK in DIR])])
if test "${with_macosx_sdk}" != "" ; then
test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
CPP="${CPP} -isysroot ${with_macosx_sdk}"
CC="${CC} -isysroot ${with_macosx_sdk}"
CXX="${CXX} -isysroot ${with_macosx_sdk}"
OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
LD="${LD} -syslibroot ${with_macosx_sdk}"
fi
AC_ARG_WITH(macosx-version-min,
[AS_HELP_STRING([--with-macosx-version-min=VERSION],
[compile for Mac OS X VERSION and above])])
if test "${with_macosx_version_min}" != "" ; then
CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
fi
;;
*mingw32* | *cygwin* | *wince* | *mingwce*)
AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
case "${host_os}" in
*mingw32*)
SYS=mingw32
;;
*cygwin*)
SYS=cygwin
;;
esac
if test "${SYS}" = "mingw32"; then
# DEP, ASLR, NO SEH
LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
ac_default_prefix="`pwd`/_win32"
DESTDIR="`pwd`/_win32/"
dnl
dnl NSIS/MSI Installer prefix and WIN64
dnl
case "${host}" in
amd64*|x86_64*)
HAVE_WIN64="1"
WINDOWS_ARCH="x64"
PROGRAMFILES="PROGRAMFILES64"
;;
*)
WINDOWS_ARCH="x86"
PROGRAMFILES="PROGRAMFILES"
;;
esac
AC_SUBST(WINDOWS_ARCH)
AC_SUBST(PROGRAMFILES)
fi
;;
*nto*)
SYS=nto
;;
solaris*)
SYS=solaris
;;
hpux*)
SYS=hpux
;;
*os2*)
SYS=os2
LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
AC_LIBOBJ([freeaddrinfo])
;;
*)
SYS="${host_os}"
;;
esac
AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
dnl Android is linux, but a bit different
AS_IF([test "$SYS" = linux],[
AC_MSG_CHECKING([for an Android system])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
[[#ifndef __ANDROID__
# error Not Android
#endif
]],[[;]])
],[
HAVE_ANDROID="1"
AC_MSG_RESULT([yes])
],[AC_MSG_RESULT([no])
])
])
AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
AC_ARG_ENABLE(gui, AC_HELP_STRING([--disable-gui],[Disable VLMC GUI]))
AM_CONDITIONAL(HAVE_GUI, [test "${enable_gui}" != "no"])
AS_IF([test "${enable_gui}" != "no"],[
AC_DEFINE(HAVE_GUI, 1, [Define to 1 for GUI support])
])
AC_ARG_ENABLE(crashhandler, AC_HELP_STRING([--enable-crashhandler],[Enable VLMC crash handler]))
AM_CONDITIONAL(HAVE_CRASHHANDLER, [test "${enable_crashhandler}" = "yes"])
#FIXME: Don't check for QtGui/Qt5Quick when building without GUI
PKG_CHECK_MODULES(QT, [Qt5Core Qt5Widgets Qt5Gui Qt5Network Qt5Quick], [
QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
])
PKG_CHECK_MODULES(VLC, libvlc >= 3.0)
PKG_CHECK_MODULES(VLCPP, libvlcpp)
PKG_CHECK_MODULES(MLT, mlt-framework >= 6.3)
PKG_CHECK_MODULES(MLTPP, mlt++ >= 6.3.0)
COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
AC_DEFINE_UNQUOTED(CODENAME, VLMC_CODENAME, [Package codename])
AC_DEFINE_UNQUOTED(VLMC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
AC_DEFINE_UNQUOTED(VLMC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [hostname on which configure was ran])
AC_DEFINE_UNQUOTED(VLMC_COMPILE_SYSTEM, "`uname -rs 2>/dev/null || echo unknown`", [host type that ran configure])
AC_DEFINE_UNQUOTED(VLMC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
AC_DEFINE_UNQUOTED(PROJECT_CONTACT, "vlmc-devel@videolan.org", [Contact mailing list])
AC_DEFINE_UNQUOTED(PROJECT_WEBSITE, "www.videolan.org", [Organisation website])
PKG_INSTALLDIR
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT
#
# VLMC NSIS builder
# Authors: Ludovic Fauvet <etix@vlmc.org>
#
# Output file name
SET(NSIS_OUTPUT_FILE "${PROJECT_NAME}.exe")
# NSIS is only available for Win32 builds (native or cross compilation)
IF(WIN32)
SET(NSIS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin/")
# Check contribs existence
IF(EXISTS "${CMAKE_SOURCE_DIR}/contribs/")
MESSAGE(STATUS "Contribs found!")
# Copy necessary libraries required at runtime
FILE(COPY "${CMAKE_SOURCE_DIR}/contribs/bin/"
DESTINATION ${NSIS_OUTPUT_DIR}