Skip to content

Commit 5c811ae

Browse files
Correct Linux build
1 parent 1f70df4 commit 5c811ae

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

CMakeLists.txt

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
cmake_minimum_required(VERSION 3.5)
2+
cmake_policy(SET CMP0071 NEW)
23
project(hyperion-obs)
34

45
# Macro to get path of first sub dir of a dir, used for MAC OSX lib/header searching
@@ -14,19 +15,15 @@ MACRO(FIRSTSUBDIR result curdir)
1415
SET(${result} ${dirlist})
1516
ENDMACRO()
1617

17-
set(CMAKE_CXX_STANDARD 11)
18+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
1819
set(CMAKE_AUTOMOC ON)
1920
set(CMAKE_AUTOUIC ON)
2021

21-
if(UNIX)
22-
include(GNUInstallDirs)
23-
endif()
24-
25-
# Add project specific cmake modules (find, etc)
26-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
22+
set(CMAKE_CXX_STANDARD 11)
23+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2724

2825
# enable C++11; MSVC doesn't have c++11 feature switch
29-
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
26+
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
3027
include(CheckCXXCompilerFlag)
3128
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
3229
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
@@ -83,9 +80,22 @@ if (WIN32)
8380
set(PTHREAD_LIB "${OBS_BUILD}/deps/w32-pthreads/$<CONFIGURATION>/w32-pthreads.lib")
8481
endif()
8582

86-
find_package(Libobs REQUIRED)
83+
include(cmake/FindLibObs.cmake)
84+
find_package(LibObs REQUIRED)
8785
find_package(Qt5 COMPONENTS Core Widgets Network REQUIRED)
8886

87+
if (NOT CMAKE_BUILD_TYPE)
88+
set(CMAKE_BUILD_TYPE Release)
89+
endif()
90+
91+
if (UNIX)
92+
if (${CMAKE_BUILD_TYPE} STREQUAL Debug)
93+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og")
94+
else ()
95+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
96+
endif()
97+
endif()
98+
8999
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared flatbuffers library")
90100
set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "Build Flatbuffers with tests")
91101
add_subdirectory(external/flatbuffers)
@@ -137,7 +147,7 @@ include_directories(
137147
${LIBOBS_INCLUDE_DIR}
138148
)
139149

140-
if(UNIX)
150+
if (UNIX)
141151
target_link_libraries(${PROJECT_NAME} libobs)
142152
endif()
143153

@@ -153,15 +163,9 @@ target_link_libraries(${PROJECT_NAME}
153163
Qt5::Network
154164
)
155165

156-
if(ARCH EQUAL 64)
157-
set(ARCH_NAME "x86_64")
158-
else()
159-
set(ARCH_NAME "i686")
160-
endif()
161-
162-
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
163-
164-
if(UNIX)
166+
if (UNIX)
167+
include(GNUInstallDirs)
168+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
165169
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/obs-plugins)
166170
install(DIRECTORY locale/ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/hyperion-obs/locale)
167171
endif()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ git clone --recursive https://github.com/obsproject/obs-studio.git
3737
git clone --recursive https://github.com/hyperion-project/hyperion-obs-plugin.git
3838
cd hyperion-obs-plugin
3939
mkdir build && cd build
40-
cmake -DOBS_SOURCE="../../obs-studio" -DCMAKE_INSTALL_PREFIX=/usr ..
40+
cmake -DOBS_SOURCE="PATH_TO_THE_OBS_SOURCE_CODE_DIRECTORY -DCMAKE_INSTALL_PREFIX=/usr ..
4141
make -j $(nproc)
4242
sudo make install
4343
```

src/HyperionProperties.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ static void output_stopped(void *data, calldata_t *cd)
141141
static void logger_message(void *data, calldata_t *cd)
142142
{
143143
auto *page = static_cast<HyperionProperties*>(data);
144-
auto *output = static_cast<obs_output_t*>(calldata_ptr(cd, "output"));
145144
const char* msg = calldata_string(cd, "msg");
146145
page->appendLogText(msg);
147146
}

src/hyperion-obs.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ static bool hyperion_output_start(void *data)
127127
Connect(data);
128128

129129
video_t *video = obs_output_video(out_data->output);
130-
enum video_format format = video_output_get_format(video);
131130

132131
if (video_output_get_format(video) != VIDEO_FORMAT_RGBA)
133132
{

0 commit comments

Comments
 (0)