You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Merge branch 'develop' into example
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@ build/*
|
||||
.project
|
||||
.cproject
|
||||
/.metadata/
|
||||
*~
|
||||
|
||||
@@ -20,7 +20,7 @@ linux-builder:
|
||||
- cmake -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR/build/install-x64" -D"CMAKE_BUILD_TYPE:STRING=Release" ../
|
||||
- make
|
||||
- make install
|
||||
- mv /usr/local/lib/python3.4/dist-packages/*openshot* install-x64/python
|
||||
- mv install-x64/lib/python3.4/site-packages/*openshot* install-x64/python
|
||||
- echo -e "CI_PROJECT_NAME:$CI_PROJECT_NAME\nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME\nCI_COMMIT_SHA:$CI_COMMIT_SHA\nCI_JOB_ID:$CI_JOB_ID" > "install-x64/share/$CI_PROJECT_NAME"
|
||||
- git log $(git describe --tags --abbrev=0)..HEAD --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x64/share/$CI_PROJECT_NAME.log"
|
||||
when: always
|
||||
@@ -47,7 +47,7 @@ mac-builder:
|
||||
- cmake -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR/build/install-x64" -DCMAKE_CXX_COMPILER=/usr/local/opt/gcc48/bin/g++-4.8 -DCMAKE_C_COMPILER=/usr/local/opt/gcc48/bin/gcc-4.8 -DCMAKE_PREFIX_PATH=/usr/local/qt5/5.5/clang_64 -DPYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -DPYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6.dylib -DPython_FRAMEWORKS=/Library/Frameworks/Python.framework/ -D"CMAKE_BUILD_TYPE:STRING=Debug" -D"CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" -D"CMAKE_OSX_DEPLOYMENT_TARGET=10.9" -D"CMAKE_INSTALL_RPATH_USE_LINK_PATH=1" -D"ENABLE_RUBY=0" ../
|
||||
- make
|
||||
- make install
|
||||
- mv /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/*openshot* install-x64/python
|
||||
- mv install-x64/lib/python3.6/site-packages/*openshot* install-x64/python
|
||||
- echo -e "CI_PROJECT_NAME:$CI_PROJECT_NAME\nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME\nCI_COMMIT_SHA:$CI_COMMIT_SHA\nCI_JOB_ID:$CI_JOB_ID" > "install-x64/share/$CI_PROJECT_NAME"
|
||||
- git log $(git describe --tags --abbrev=0)..HEAD --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x64/share/$CI_PROJECT_NAME.log"
|
||||
when: always
|
||||
@@ -75,7 +75,7 @@ windows-builder-x64:
|
||||
- cd build
|
||||
- cmake -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x64" -G "MinGW Makefiles" -D"CMAKE_BUILD_TYPE:STRING=Release" ../
|
||||
- mingw32-make install
|
||||
- Move-Item -Force -path "C:\msys64\mingw64\lib\python3.6\site-packages\*openshot*" -destination "install-x64\python\"
|
||||
- Move-Item -Force -path "install-x64\lib\python3.6\site-packages\*openshot*" -destination "install-x64\python\"
|
||||
- cp src\libopenshot.dll install-x64\lib
|
||||
- New-Item -path "install-x64/share/" -Name "$CI_PROJECT_NAME" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID" -ItemType file -force
|
||||
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0)
|
||||
@@ -106,7 +106,7 @@ windows-builder-x86:
|
||||
- cd build
|
||||
- cmake -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x86" -G "MinGW Makefiles" -D"CMAKE_BUILD_TYPE:STRING=Release" -D"CMAKE_CXX_FLAGS=-m32" -D"CMAKE_EXE_LINKER_FLAGS=-Wl,--large-address-aware" -D"CMAKE_C_FLAGS=-m32" ../
|
||||
- mingw32-make install
|
||||
- Move-Item -Force -path "C:\msys32\mingw32\lib\python3.6\site-packages\*openshot*" -destination "install-x86\python\"
|
||||
- Move-Item -Force -path "install-x86\lib\python3.6\site-packages\*openshot*" -destination "install-x86\python\"
|
||||
- cp src\libopenshot.dll install-x86\lib
|
||||
- New-Item -path "install-x86/share/" -Name "$CI_PROJECT_NAME" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID" -ItemType file -force
|
||||
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0)
|
||||
|
||||
@@ -15,7 +15,7 @@ matrix:
|
||||
- mkdir -p build; cd build;
|
||||
- cmake -D"CMAKE_BUILD_TYPE:STRING=Debug" ../
|
||||
- make VERBOSE=1
|
||||
- make test
|
||||
- make os_test
|
||||
|
||||
- language: cpp
|
||||
name: "FFmpeg 3"
|
||||
@@ -30,7 +30,7 @@ matrix:
|
||||
- mkdir -p build; cd build;
|
||||
- cmake -D"CMAKE_BUILD_TYPE:STRING=Debug" ../
|
||||
- make VERBOSE=1
|
||||
- make test
|
||||
- make os_test
|
||||
|
||||
- language: cpp
|
||||
name: "FFmpeg 4"
|
||||
@@ -47,4 +47,4 @@ matrix:
|
||||
- mkdir -p build; cd build;
|
||||
- cmake -D"CMAKE_BUILD_TYPE:STRING=Debug" ../
|
||||
- make VERBOSE=1
|
||||
- make test
|
||||
- make os_test
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
#
|
||||
# @section LICENSE
|
||||
#
|
||||
# Copyright (c) 2008-2014 OpenShot Studios, LLC
|
||||
# Copyright (c) 2008-2019 OpenShot Studios, LLC
|
||||
# <http://www.openshotstudios.com/>. This file is part of
|
||||
# OpenShot Library (libopenshot), an open-source project dedicated to
|
||||
# delivering high quality video editing and animation solutions to the
|
||||
# OpenShot Library (libopenshot), an open-source project dedicated to
|
||||
# delivering high quality video editing and animation solutions to the
|
||||
# world. For more information visit <http://www.openshot.org/>.
|
||||
#
|
||||
# OpenShot Library (libopenshot) is free software: you can redistribute it
|
||||
@@ -24,24 +24,29 @@
|
||||
# along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
cmake_minimum_required(VERSION 3.1...3.14 FATAL_ERROR)
|
||||
|
||||
MESSAGE("--------------------------------------------------------------")
|
||||
MESSAGE("Welcome to the OpenShot Build System! CMake will now check for all required build")
|
||||
MESSAGE("dependencies and notify you of any missing files or other issues. If you have any")
|
||||
MESSAGE("questions or issues, please visit <http://www.openshot.org/>.")
|
||||
message("\
|
||||
-----------------------------------------------------------------
|
||||
Welcome to the OpenShot Build System!
|
||||
|
||||
CMake will now check libopenshot's build dependencies and inform
|
||||
you of any missing files or other issues.
|
||||
|
||||
For more information, please visit <http://www.openshot.org/>.
|
||||
-----------------------------------------------------------------")
|
||||
|
||||
################ ADD CMAKE MODULES ##################
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
|
||||
|
||||
################ GET VERSION INFORMATION FROM VERSION.H ##################
|
||||
MESSAGE("--------------------------------------------------------------")
|
||||
MESSAGE("Determining Version Number (from Version.h file)")
|
||||
message(STATUS "Determining Version Number (from Version.h file)")
|
||||
|
||||
#### Get the lines related to libopenshot version from the Version.h header
|
||||
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/include/Version.h OPENSHOT_VERSION_LINES
|
||||
REGEX "#define[ ]+OPENSHOT_VERSION_.*[0-9]+;.*")
|
||||
|
||||
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/include/Version.h
|
||||
OPENSHOT_VERSION_LINES
|
||||
REGEX "#define[ ]+OPENSHOT_VERSION_.*[0-9]+;.*")
|
||||
|
||||
#### Set each line into it's own variable
|
||||
list (GET OPENSHOT_VERSION_LINES 0 LINE_MAJOR)
|
||||
list (GET OPENSHOT_VERSION_LINES 1 LINE_MINOR)
|
||||
@@ -53,22 +58,27 @@ STRING(REGEX REPLACE "#define[ ]+OPENSHOT_VERSION_MAJOR[ ]+([0-9]+);(.*)" "\\1"
|
||||
STRING(REGEX REPLACE "#define[ ]+OPENSHOT_VERSION_MINOR[ ]+([0-9]+);(.*)" "\\1" MINOR_VERSION "${LINE_MINOR}")
|
||||
STRING(REGEX REPLACE "#define[ ]+OPENSHOT_VERSION_BUILD[ ]+([0-9]+);(.*)" "\\1" BUILD_VERSION "${LINE_BUILD}")
|
||||
STRING(REGEX REPLACE "#define[ ]+OPENSHOT_VERSION_SO[ ]+([0-9]+);(.*)" "\\1" SO_VERSION "${LINE_SO}")
|
||||
set(PROJECT_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_VERSION}")
|
||||
|
||||
MESSAGE("--> MAJOR Version: ${MAJOR_VERSION}")
|
||||
MESSAGE("--> MINOR Version: ${MINOR_VERSION}")
|
||||
MESSAGE("--> BUILD Version: ${BUILD_VERSION}")
|
||||
MESSAGE("--> SO/API/ABI Version: ${SO_VERSION}")
|
||||
MESSAGE("--> VERSION: ${PROJECT_VERSION}")
|
||||
MESSAGE("")
|
||||
message(STATUS "MAJOR Version: ${MAJOR_VERSION}")
|
||||
message(STATUS "MINOR Version: ${MINOR_VERSION}")
|
||||
message(STATUS "BUILD Version: ${BUILD_VERSION}")
|
||||
message(STATUS "SO/API/ABI Version: ${SO_VERSION}")
|
||||
message(STATUS "Determining Version Number - done")
|
||||
|
||||
################### SETUP PROJECT ###################
|
||||
PROJECT(openshot)
|
||||
MESSAGE("--------------------------------------------------------------")
|
||||
MESSAGE("Generating build files for ${PROJECT_NAME} (${PROJECT_VERSION})")
|
||||
PROJECT(libopenshot LANGUAGES C CXX
|
||||
VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_VERSION})
|
||||
|
||||
message("
|
||||
Generating build files for OpenShot
|
||||
Building ${PROJECT_NAME} (version ${PROJECT_VERSION})
|
||||
SO/API/ABI Version: ${SO_VERSION}
|
||||
")
|
||||
|
||||
#### Enable C++11 (for std::shared_ptr support)
|
||||
set(CMAKE_CXX_FLAGS "-std=c++11")
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
IF (WIN32)
|
||||
SET_PROPERTY(GLOBAL PROPERTY WIN32 "WIN32")
|
||||
|
||||
@@ -1,4 +1,30 @@
|
||||
# - Run Doxygen
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license:
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# - Run Doxygen
|
||||
#
|
||||
# Adds a doxygen target that runs doxygen to generate the html
|
||||
# and optionally the LaTeX API documentation.
|
||||
@@ -48,7 +74,6 @@
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
macro(usedoxygen_set_default name value type docstring)
|
||||
@@ -134,7 +159,9 @@ if(DOXYGEN_FOUND AND DOXYFILE_IN_FOUND)
|
||||
|
||||
configure_file("${DOXYFILE_IN}" "${DOXYFILE}" @ONLY)
|
||||
|
||||
get_target_property(DOC_TARGET doc TYPE)
|
||||
if(TARGET doc)
|
||||
get_target_property(DOC_TARGET doc TYPE)
|
||||
endif()
|
||||
if(NOT DOC_TARGET)
|
||||
add_custom_target(doc)
|
||||
endif()
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#
|
||||
# Copyright (c) 2008-2014 OpenShot Studios, LLC
|
||||
# <http://www.openshotstudios.com/>. This file is part of
|
||||
# OpenShot Library (libopenshot), an open-source project dedicated to
|
||||
# delivering high quality video editing and animation solutions to the
|
||||
# OpenShot Library (libopenshot), an open-source project dedicated to
|
||||
# delivering high quality video editing and animation solutions to the
|
||||
# world. For more information visit <http://www.openshot.org/>.
|
||||
#
|
||||
# OpenShot Library (libopenshot) is free software: you can redistribute it
|
||||
@@ -29,37 +29,60 @@
|
||||
FIND_PACKAGE(SWIG 2.0 REQUIRED)
|
||||
INCLUDE(${SWIG_USE_FILE})
|
||||
|
||||
### Enable some legacy SWIG behaviors, in newer CMAKEs
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.13)
|
||||
cmake_policy(SET CMP0078 OLD)
|
||||
endif()
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.14)
|
||||
cmake_policy(SET CMP0086 OLD)
|
||||
endif()
|
||||
|
||||
FIND_PACKAGE(PythonLibs 3)
|
||||
FIND_PACKAGE(PythonInterp 3)
|
||||
IF (PYTHONLIBS_FOUND)
|
||||
IF (PYTHONINTERP_FOUND)
|
||||
if (PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
|
||||
|
||||
### Include Python header files
|
||||
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
### Enable C++ support in SWIG
|
||||
SET_SOURCE_FILES_PROPERTIES(openshot.i PROPERTIES CPLUSPLUS ON)
|
||||
SET(CMAKE_SWIG_FLAGS "")
|
||||
|
||||
### Add the SWIG interface file (which defines all the SWIG methods)
|
||||
SWIG_ADD_MODULE(openshot python openshot.i)
|
||||
### Include Python header files
|
||||
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
### Link the new python wrapper library with libopenshot
|
||||
SWIG_LINK_LIBRARIES(openshot ${PYTHON_LIBRARIES} openshot)
|
||||
### Enable C++ support in SWIG
|
||||
set_property(SOURCE openshot.i PROPERTY CPLUSPLUS ON)
|
||||
set_property(SOURCE openshot.i PROPERTY SWIG_MODULE_NAME openshot)
|
||||
SET(CMAKE_SWIG_FLAGS "")
|
||||
|
||||
### FIND THE PYTHON INTERPRETER (AND THE SITE PACKAGES FOLDER)
|
||||
EXECUTE_PROCESS ( COMMAND ${PYTHON_EXECUTABLE} -c "import site; print(site.getsitepackages()[0])"
|
||||
OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
GET_FILENAME_COMPONENT(_ABS_PYTHON_MODULE_PATH "${_ABS_PYTHON_MODULE_PATH}" ABSOLUTE)
|
||||
FILE(RELATIVE_PATH _REL_PYTHON_MODULE_PATH ${CMAKE_INSTALL_PREFIX} ${_ABS_PYTHON_MODULE_PATH})
|
||||
SET(PYTHON_MODULE_PATH ${_REL_PYTHON_MODULE_PATH})
|
||||
### Add the SWIG interface file (which defines all the SWIG methods)
|
||||
if (CMAKE_VERSION VERSION_LESS 3.8.0)
|
||||
swig_add_module(pyopenshot python openshot.i)
|
||||
else()
|
||||
swig_add_library(pyopenshot LANGUAGE python SOURCES openshot.i)
|
||||
endif()
|
||||
|
||||
############### INSTALL HEADERS & LIBRARY ################
|
||||
### Install Python bindings
|
||||
INSTALL(TARGETS _openshot DESTINATION ${PYTHON_MODULE_PATH} )
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/openshot.py DESTINATION ${PYTHON_MODULE_PATH} )
|
||||
### Set output name of target
|
||||
set_target_properties(${SWIG_MODULE_pyopenshot_REAL_NAME} PROPERTIES
|
||||
PREFIX "_" OUTPUT_NAME "openshot")
|
||||
|
||||
ENDIF(PYTHONINTERP_FOUND)
|
||||
ENDIF (PYTHONLIBS_FOUND)
|
||||
### Link the new python wrapper library with libopenshot
|
||||
target_link_libraries(${SWIG_MODULE_pyopenshot_REAL_NAME}
|
||||
${PYTHON_LIBRARIES} openshot)
|
||||
|
||||
### FIND THE PYTHON INTERPRETER (AND THE SITE PACKAGES FOLDER)
|
||||
execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "\
|
||||
from distutils.sysconfig import get_python_lib; \
|
||||
print( get_python_lib( plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}' ) )"
|
||||
OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
|
||||
GET_FILENAME_COMPONENT(_ABS_PYTHON_MODULE_PATH
|
||||
"${_ABS_PYTHON_MODULE_PATH}" ABSOLUTE)
|
||||
FILE(RELATIVE_PATH _REL_PYTHON_MODULE_PATH
|
||||
${CMAKE_INSTALL_PREFIX} ${_ABS_PYTHON_MODULE_PATH})
|
||||
SET(PYTHON_MODULE_PATH ${_REL_PYTHON_MODULE_PATH})
|
||||
|
||||
############### INSTALL HEADERS & LIBRARY ################
|
||||
### Install Python bindings
|
||||
INSTALL(TARGETS ${SWIG_MODULE_pyopenshot_REAL_NAME}
|
||||
LIBRARY DESTINATION ${PYTHON_MODULE_PATH} )
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/openshot.py
|
||||
DESTINATION ${PYTHON_MODULE_PATH} )
|
||||
|
||||
endif ()
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#
|
||||
# Copyright (c) 2008-2014 OpenShot Studios, LLC
|
||||
# <http://www.openshotstudios.com/>. This file is part of
|
||||
# OpenShot Library (libopenshot), an open-source project dedicated to
|
||||
# delivering high quality video editing and animation solutions to the
|
||||
# OpenShot Library (libopenshot), an open-source project dedicated to
|
||||
# delivering high quality video editing and animation solutions to the
|
||||
# world. For more information visit <http://www.openshot.org/>.
|
||||
#
|
||||
# OpenShot Library (libopenshot) is free software: you can redistribute it
|
||||
@@ -29,35 +29,53 @@
|
||||
FIND_PACKAGE(SWIG 2.0 REQUIRED)
|
||||
INCLUDE(${SWIG_USE_FILE})
|
||||
|
||||
### Enable some legacy SWIG behaviors, in newer CMAKEs
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.13)
|
||||
cmake_policy(SET CMP0078 OLD)
|
||||
endif()
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.14)
|
||||
cmake_policy(SET CMP0086 OLD)
|
||||
endif()
|
||||
|
||||
FIND_PACKAGE(Ruby)
|
||||
IF (RUBY_FOUND)
|
||||
|
||||
### Include the Ruby header files
|
||||
INCLUDE_DIRECTORIES(${RUBY_INCLUDE_DIRS})
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
|
||||
### Enable C++ in SWIG
|
||||
SET_SOURCE_FILES_PROPERTIES(openshot.i PROPERTIES CPLUSPLUS ON)
|
||||
set_property(SOURCE openshot.i PROPERTY CPLUSPLUS ON)
|
||||
set_property(SOURCE openshot.i PROPERTY SWIG_MODULE_NAME openshot)
|
||||
|
||||
SET(CMAKE_SWIG_FLAGS "")
|
||||
|
||||
### Add the SWIG interface file (which defines all the SWIG methods)
|
||||
SWIG_ADD_MODULE(rbopenshot ruby openshot.i)
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS 3.8.0)
|
||||
swig_add_module(rbopenshot ruby openshot.i)
|
||||
else()
|
||||
swig_add_library(rbopenshot LANGUAGE ruby SOURCES openshot.i)
|
||||
endif()
|
||||
|
||||
### Set name of target (with no prefix, since Ruby does not like that)
|
||||
SET_TARGET_PROPERTIES(rbopenshot PROPERTIES PREFIX "" OUTPUT_NAME "openshot")
|
||||
SET_TARGET_PROPERTIES(${SWIG_MODULE_rbopenshot_REAL_NAME} PROPERTIES
|
||||
PREFIX "" OUTPUT_NAME "openshot")
|
||||
|
||||
### Link the new Ruby wrapper library with libopenshot
|
||||
SWIG_LINK_LIBRARIES(rbopenshot ${RUBY_LIBRARY} openshot)
|
||||
|
||||
target_link_libraries(${SWIG_MODULE_rbopenshot_REAL_NAME}
|
||||
${RUBY_LIBRARY} openshot)
|
||||
|
||||
### FIND THE RUBY INTERPRETER (AND THE LOAD_PATH FOLDER)
|
||||
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']" OUTPUT_VARIABLE RUBY_VENDOR_ARCH_DIR)
|
||||
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE}
|
||||
-r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"
|
||||
OUTPUT_VARIABLE RUBY_VENDOR_ARCH_DIR)
|
||||
MESSAGE(STATUS "Ruby executable: ${RUBY_EXECUTABLE}")
|
||||
MESSAGE(STATUS "Ruby vendor arch dir: ${RUBY_VENDOR_ARCH_DIR}")
|
||||
MESSAGE(STATUS "Ruby include path: ${RUBY_INCLUDE_PATH}")
|
||||
|
||||
|
||||
############### INSTALL HEADERS & LIBRARY ################
|
||||
# Install Ruby bindings
|
||||
INSTALL(TARGETS rbopenshot LIBRARY DESTINATION ${RUBY_VENDOR_ARCH_DIR})
|
||||
|
||||
install(TARGETS ${SWIG_MODULE_rbopenshot_REAL_NAME}
|
||||
LIBRARY DESTINATION ${RUBY_VENDOR_ARCH_DIR} )
|
||||
|
||||
ENDIF (RUBY_FOUND)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
# along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
SET(TEST_MEDIA_PATH "${openshot_SOURCE_DIR}/src/examples/")
|
||||
SET(TEST_MEDIA_PATH "${PROJECT_SOURCE_DIR}/src/examples/")
|
||||
|
||||
################ WINDOWS ##################
|
||||
# Set some compiler options for Windows
|
||||
@@ -224,8 +224,7 @@ IF (NOT DISABLE_TESTS)
|
||||
# Link libraries to the new executable
|
||||
target_link_libraries(openshot-test openshot ${UNITTEST++_LIBRARY})
|
||||
|
||||
|
||||
#################### MAKE TEST ######################
|
||||
# Hook up the 'make test' target to the 'openshot-test' executable
|
||||
ADD_CUSTOM_TARGET(test ${CMAKE_CURRENT_BINARY_DIR}/openshot-test)
|
||||
# Hook up the 'make os_test' target to the 'openshot-test' executable
|
||||
ADD_CUSTOM_TARGET(os_test ${CMAKE_CURRENT_BINARY_DIR}/openshot-test)
|
||||
ENDIF (NOT DISABLE_TESTS)
|
||||
|
||||
Reference in New Issue
Block a user