Skip to content

Commit

Permalink
add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
sorayuki committed Mar 26, 2020
1 parent 2abae39 commit 038944e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
16 changes: 14 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.17)
project(obs-multi-rtmp)
project(obs-multi-rtmp VERSION 0.1.0.0)

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

Expand All @@ -18,6 +18,10 @@ else ()
message(FATAL_ERROR "?")
endif ()

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/obs-bin/obs-plugins/${PLAT}" CACHE PATH "" FORCE)
endif()

# build obs lib
execute_process(COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/pexports.exe"
"${CMAKE_CURRENT_SOURCE_DIR}/obs-bin/bin/${PLAT}/obs.dll"
Expand All @@ -41,9 +45,12 @@ execute_process(COMMAND ${CMAKE_LINKER}

find_package(Qt5 COMPONENTS Widgets REQUIRED)

configure_file(src/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc)

add_library(obs-multi-rtmp SHARED
src/obs-multi-rtmp.cpp
src/obs-multi-rtmp.h
${CMAKE_CURRENT_BINARY_DIR}/version.rc
)
target_include_directories(obs-multi-rtmp PRIVATE
obs-src/libobs
Expand All @@ -56,4 +63,9 @@ target_link_libraries(obs-multi-rtmp PRIVATE
Qt5::Widgets
libobs
obs-frontend-api
)
)

install(TARGETS obs-multi-rtmp
DESTINATION obs-plugins/${PLAT}
)

17 changes: 17 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
echo y | rd /s dist
del release.zip

set QTDIR32=-DQTDIR="D:/dev/qt5/5.10.1/msvc2017"
set QTDIR64=-DQTDIR="D:/dev/qt5/5.10.1/msvc2017_64"

cmake %QTDIR32% -G "Visual Studio 16 2019" -A Win32 -B build_x86 -S . -DCMAKE_INSTALL_PREFIX=dist
cmake --build build_x86 --config Release
cmake --install build_x86 --config Release

cmake %QTDIR64% -G "Visual Studio 16 2019" -A x64 -B build_x64 -S . -DCMAKE_INSTALL_PREFIX=dist
cmake --build build_x64 --config Release
cmake --install build_x64 --config Release

cd dist
cmake -E tar cf ..\release.zip --format=zip .
cd ..

0 comments on commit 038944e

Please sign in to comment.