Skip to content

Commit

Permalink
Fix in-tree build for OBS cmake version 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Aug 31, 2023
1 parent 041a1de commit 9fd25ec
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# --- Detect if the plugin is build out of tree or not ---
if(CMAKE_PROJECT_NAME STREQUAL "obs-studio")
set(BUILD_OUT_OF_TREE OFF)
if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
legacy_check()
endif()
else()
set(BUILD_OUT_OF_TREE ON)
cmake_minimum_required(VERSION 3.18)
Expand Down Expand Up @@ -82,9 +85,14 @@ if(BUILD_OUT_OF_TREE)
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR})
install(DIRECTORY data/locale
DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_OUT_DIR})
setup_plugin_target(${PROJECT_NAME})
else()
target_include_directories(${PROJECT_NAME} PRIVATE
"${CMAKE_SOURCE_DIR}/UI/obs-frontend-api")
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro")
if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
set_target_properties_obs(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro" PREFIX "")
else()
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro")
setup_plugin_target(${PROJECT_NAME})
endif()
endif()
setup_plugin_target(${PROJECT_NAME})

0 comments on commit 9fd25ec

Please sign in to comment.