mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-19 20:32:15 +02:00
Clean old cmake files
This commit is contained in:
parent
610d4415d5
commit
8fa309c96e
@ -1,52 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
project(obs)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo)
|
||||
endif()
|
||||
|
||||
set(CMAKE_COMPILER_IS_CLANG ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
|
||||
option(USE_LIBC++ "Use libc++ instead of libstdc++" ${APPLE})
|
||||
if(USE_LIBC++)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wmissing-prototypes")
|
||||
set(CMAKE_C_FLAGS
|
||||
"${CMAKE_C_FLAGS} -std=c99 -Wall -Wmissing-prototypes -Wshadow")
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
if(APPLE)
|
||||
set(CMAKE_MACOSX_RPATH TRUE)
|
||||
set(CMAKE_INSTALL_RPATH
|
||||
"${CMAKE_INSTALL_RPATH};@loader_path/;@executable_path/")
|
||||
option(BUILD_APP_BUNDLE "Build app bundle" false)
|
||||
endif()
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
endif()
|
||||
|
||||
include(obs_helpers)
|
||||
|
||||
obs_add_data_dir(/)
|
||||
|
||||
set(LIBRARY_OUTPUT_PATH ${obs_BINARY_DIR}/bin)
|
||||
set(RUNTIME_OUTPUT_PATH ${obs_BINARY_DIR}/bin)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${obs_BINARY_DIR}/bin)
|
||||
add_subdirectory(libobs)
|
||||
add_subdirectory(libobs-opengl)
|
||||
if(WIN32)
|
||||
add_subdirectory(libobs-d3d11)
|
||||
add_subdirectory(libobs-d3d9)
|
||||
endif()
|
||||
|
||||
set(LIBRARY_OUTPUT_PATH ${obs_BINARY_DIR}/plugins)
|
||||
set(RUNTIME_OUTPUT_PATH ${obs_BINARY_DIR}/plugins)
|
||||
add_subdirectory(obs)
|
||||
|
||||
add_subdirectory(test)
|
@ -1,63 +0,0 @@
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(PC_GLEW QUIET glew)
|
||||
|
||||
set(GLEW_STANDARD_DEFINITIONS ${PC_GLEW_DEFINITIONS}
|
||||
CACHE STRING
|
||||
"GLEW required CFLAGS")
|
||||
set(GLEW_STATIC_DEFINITIONS ${PC_GLEW_STATIC_DEFINITIONS}
|
||||
CACHE STRING
|
||||
"GLEW static required CFLAGS")
|
||||
|
||||
find_path(GLEW_STANDARD_INCLUDE_DIR GL/glew.h
|
||||
HINTS ${PC_GLEW_INCLUDEDIR}
|
||||
${PC_GLEW_INCLUDE_DIRS})
|
||||
find_path(GLEW_STATIC_INCLUDE_DIR GL/glew.h
|
||||
HINTS ${PC_GLEW_STATIC_INCLUDEDIR}
|
||||
${PC_GLEW_STATIC_INCLUDE_DIRS})
|
||||
|
||||
find_library(GLEW_STANDARD_LIBRARY
|
||||
NAMES ${PC_GLEW_LIBRARIES} GLEW glew32 glew glew32s
|
||||
HINTS ${PC_GLEW_LIBDIR}
|
||||
${PC_GLEW_LIBRARY_DIRS}
|
||||
PATH_SUFFIXES lib64)
|
||||
set(lib_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
${CMAKE_DYNAMIC_LIBRARY_SUFFIX} ${CMAKE_SHARED_OBJECT_SUFFIX})
|
||||
find_library(GLEW_STATIC_LIBRARY
|
||||
NAMES ${PC_GLEW_STATIC_LIBRARIES} GLEW glew32 glew glew32s
|
||||
HINTS ${PC_GLEW_STATIC_LIBDIR}
|
||||
${PC_GLEW_STATIC_LIBRARY_DIRS}
|
||||
PATH_SUFFIXES lib64)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${lib_suffixes})
|
||||
unset(lib_suffixes)
|
||||
|
||||
if(GLEW_FIND_COMPONENTS AND
|
||||
GLEW_FIND_COMPONENTS STREQUAL "static")
|
||||
set(GLEW_DEFINITION ${GLEW_STATIC_DEFINITIONS})
|
||||
set(GLEW_INCLUDE_DIR ${GLEW_STATIC_INCLUDE_DIR})
|
||||
set(GLEW_LIBRARY ${GLEW_STATIC_LIBRARY})
|
||||
else()
|
||||
set(GLEW_DEFINITION ${GLEW_STANDARD_DEFINITIONS})
|
||||
set(GLEW_INCLUDE_DIR ${GLEW_STANDARD_INCLUDE_DIR})
|
||||
set(GLEW_LIBRARY ${GLEW_STANDARD_LIBRARY})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLEW STANDARD_MESSAGE
|
||||
GLEW_INCLUDE_DIR GLEW_LIBRARY)
|
||||
|
||||
if(GLEW_FOUND)
|
||||
set(GLEW_DEFINITIONS ${GLEW_DEFINITION})
|
||||
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
|
||||
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
GLEW_STANDARD_DEFINITIONS
|
||||
GLEW_STANDARD_INCLUDE_DIR
|
||||
GLEW_STANDARD_LIBRARY
|
||||
|
||||
GLEW_STATIC_DEFINITIONS
|
||||
GLEW_STATIC_INCLUDE_DIR
|
||||
GLEW_STATIC_LIBRARY)
|
@ -1,94 +0,0 @@
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(PC_LIBAVUTIL QUIET libavutil)
|
||||
set(LIBAVUTIL_STANDARD_DEFINITIONS ${PC_LIBAVUTIL_CFLAGS_OTHER}
|
||||
CACHE STRING
|
||||
"Libavutil required CFLAGS")
|
||||
set(LIBAVUTIL_STATIC_DEFINITIONS ${PC_LIBAVUTIL_STATIC_CFLAGS_OTHER}
|
||||
CACHE STRING
|
||||
"Libavutil static required CFLAGS")
|
||||
|
||||
find_path(LIBAVUTIL_STANDARD_INCLUDE_DIR libavutil/avutil.h
|
||||
HINTS ${PC_LIBAVUTIL_INCLUDEDIR}
|
||||
${PC_LIBAVUTIL_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES libavutil)
|
||||
|
||||
find_path(LIBAVUTIL_STATIC_INCLUDE_DIR libavutil/avutil.h
|
||||
HINTS ${PC_LIBAVUTIL_STATIC_INCLUDEDIR}
|
||||
${PC_LIBAVUTIL_STATIC_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES libavutil)
|
||||
|
||||
if(NOT LIBAVUTIL_STANDARD_LIBRARIES)
|
||||
set(LIBAVUTIL_STANDARD_LIBRARIES_ "")
|
||||
foreach(lib ${PC_LIBAVUTIL_LIBRARIES})
|
||||
find_library(_lib_file NAMES ${lib}
|
||||
HINTS ${PC_LIBAVUTIL_LIBDIR}
|
||||
${PC_LIBAVUTIL_LIBRARY_DIRS})
|
||||
if(_lib_file)
|
||||
list(APPEND LIBAVUTIL_STANDARD_LIBRARIES_ ${_lib_file})
|
||||
endif()
|
||||
unset(_lib_file CACHE)
|
||||
endforeach()
|
||||
set(LIBAVUTIL_STANDARD_LIBRARIES ${LIBAVUTIL_STANDARD_LIBRARIES_}
|
||||
CACHE STRING
|
||||
"Libavutil (dynamic) libraries")
|
||||
unset(LIBAVUTIL_STANDARD_LIBRARIES_)
|
||||
endif()
|
||||
|
||||
if(NOT LIBAVUTIL_STATIC_LIBRARIES)
|
||||
set(LIBAVUTIL_STATIC_LIBRARIES_ "")
|
||||
set(lib_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_MODULE_SUFFIX})
|
||||
foreach(lib ${PC_LIBAVUTIL_STATIC_LIBRARIES})
|
||||
find_library(_lib_file NAMES ${lib}
|
||||
HINTS ${PC_LIBAVUTIL_LIBDIR}
|
||||
${PC_LIBAVUTIL_LIBRARY_DIRS})
|
||||
if(_lib_file)
|
||||
list(APPEND LIBAVUTIL_STATIC_LIBRARIES_ ${_lib_file})
|
||||
else()
|
||||
list(APPEND LIBAVUTIL_STATIC_LIBRARIES_ ${lib})
|
||||
endif()
|
||||
unset(_lib_file CACHE)
|
||||
endforeach()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${lib_suffixes})
|
||||
unset(lib_suffixes)
|
||||
set(LIBAVUTIL_STATIC_LIBRARIES ${LIBAVUTIL_STATIC_LIBRARIES_}
|
||||
CACHE STRING
|
||||
"Libavutil static libraries")
|
||||
unset(LIBAVUTIL_STATIC_LIBRARIES_)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if(Libavutil_FIND_COMPONENTS AND
|
||||
Libavutil_FIND_COMPONENTS STREQUAL "static")
|
||||
set(LIBAVUTIL_DEFINITION ${LIBAVUTIL_STATIC_DEFINITIONS})
|
||||
set(LIBAVUTIL_INCLUDE_DIR ${LIBAVUTIL_STATIC_INCLUDE_DIR})
|
||||
set(LIBAVUTIL_LIBRARY ${LIBAVUTIL_STATIC_LIBRARIES})
|
||||
else()
|
||||
set(LIBAVUTIL_DEFINITION ${LIBAVUTIL_STANDARD_DEFINITIONS})
|
||||
set(LIBAVUTIL_INCLUDE_DIR ${LIBAVUTIL_STANDARD_INCLUDE_DIR})
|
||||
set(LIBAVUTIL_LIBRARY ${LIBAVUTIL_STANDARD_LIBRARIES})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(Libavutil DEFAULT_MSG
|
||||
LIBAVUTIL_INCLUDE_DIR LIBAVUTIL_LIBRARY)
|
||||
|
||||
if(LIBAVUTIL_FOUND)
|
||||
set(LIBAVUTIL_DEFINITIONS ${LIBAVUTIL_DEFINITION})
|
||||
set(LIBAVUTIL_INCLUDE_DIRS ${LIBAVUTIL_INCLUDE_DIR})
|
||||
set(LIBAVUTIL_LIBRARIES ${LIBAVUTIL_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
LIBAVUTIL_STANDARD_DEFINITIONS
|
||||
LIBAVUTIL_STANDARD_INCLUDE_DIR
|
||||
LIBAVUTIL_STANDARD_LIBRARIES
|
||||
|
||||
LIBAVUTIL_STATIC_DEFINITIONS
|
||||
LIBAVUTIL_STATIC_INCLUDE_DIR
|
||||
LIBAVUTIL_STATIC_LIBRARIES
|
||||
)
|
@ -1,97 +0,0 @@
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(PC_LIBSWRESAMPLE QUIET libswresample)
|
||||
set(LIBSWRESAMPLE_STANDARD_DEFINITIONS ${PC_LIBSWRESAMPLE_CFLAGS_OTHER}
|
||||
CACHE STRING
|
||||
"Libswresample required CFLAGS")
|
||||
set(LIBSWRESAMPLE_STATIC_DEFINITIONS ${PC_LIBSWRESAMPLE_STATIC_CFLAGS_OTHER}
|
||||
CACHE STRING
|
||||
"Libswresample static required CFLAGS")
|
||||
|
||||
find_path(LIBSWRESAMPLE_STANDARD_INCLUDE_DIR libswresample/swresample.h
|
||||
HINTS ${PC_LIBSWRESAMPLE_INCLUDEDIR}
|
||||
${PC_LIBSWRESAMPLE_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES libswresample)
|
||||
|
||||
find_path(LIBSWRESAMPLE_STATIC_INCLUDE_DIR libswresample/swresample.h
|
||||
HINTS ${PC_LIBSWRESAMPLE_STATIC_INCLUDEDIR}
|
||||
${PC_LIBSWRESAMPLE_STATIC_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES libswresample)
|
||||
|
||||
if(NOT LIBSWRESAMPLE_STANDARD_LIBRARIES)
|
||||
set(LIBSWRESAMPLE_STANDARD_LIBRARIES_ "")
|
||||
foreach(lib ${PC_LIBSWRESAMPLE_LIBRARIES})
|
||||
find_library(_lib_file NAMES ${lib}
|
||||
HINTS ${PC_LIBSWRESAMPLE_LIBDIR}
|
||||
${PC_LIBSWRESAMPLE_LIBRARY_DIRS})
|
||||
if(_lib_file)
|
||||
LIST(APPEND LIBSWRESAMPLE_STANDARD_LIBRARIES_
|
||||
${_lib_file})
|
||||
endif()
|
||||
unset(_lib_file CACHE)
|
||||
endforeach()
|
||||
set(LIBSWRESAMPLE_STANDARD_LIBRARIES
|
||||
${LIBSWRESAMPLE_STANDARD_LIBRARIES_}
|
||||
CACHE STRING
|
||||
"Libswresample (dynamic) libraries")
|
||||
unset(LIBSWRESAMPLE_STANDARD_LIBRARIES_)
|
||||
endif()
|
||||
|
||||
if(NOT LIBSWRESAMPLE_STATIC_LIBRARIES)
|
||||
set(LIBSWRESAMPLE_STATIC_LIBRARIES_ "")
|
||||
set(lib_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_MODULE_SUFFIX})
|
||||
foreach(lib ${PC_LIBSWRESAMPLE_STATIC_LIBRARIES})
|
||||
find_library(_lib_file NAMES ${lib}
|
||||
HINTS ${PC_LIBSWRESAMPLE_LIBDIR}
|
||||
${PC_LIBSWRESAMPLE_LIBRARY_DIRS})
|
||||
if(_lib_file)
|
||||
list(APPEND LIBSWRESAMPLE_STATIC_LIBRARIES_
|
||||
${_lib_file})
|
||||
else()
|
||||
list(APPEND LIBSWRESAMPLE_STATIC_LIBRARIES_ ${lib})
|
||||
endif()
|
||||
unset(_lib_file CACHE)
|
||||
endforeach()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${lib_suffixes})
|
||||
set(LIBSWRESAMPLE_STATIC_LIBRARIES ${LIBSWRESAMPLE_STATIC_LIBRARIES_}
|
||||
CACHE STRING
|
||||
"Libswresample static libraries")
|
||||
unset(LIBSWRESAMPLE_STATIC_LIBRARIES_)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if(Libswresample_FIND_COMPONENTS AND
|
||||
Libswresample_FIND_COMPONENTS STREQUAL "static")
|
||||
set(LIBSWRESAMPLE_DEFINITION ${LIBSWRESAMPLE_STATIC_DEFINITIONS})
|
||||
set(LIBSWRESAMPLE_INCLUDE_DIR ${LIBSWRESAMPLE_STATIC_INCLUDE_DIR})
|
||||
set(LIBSWRESAMPLE_LIBRARY ${LIBSWRESAMPLE_STATIC_LIBRARIES})
|
||||
else()
|
||||
set(LIBSWRESAMPLE_DEFINITION ${LIBSWRESAMPLE_STANDARD_DEFINITIONS})
|
||||
set(LIBSWRESAMPLE_INCLUDE_DIR ${LIBSWRESAMPLE_STANDARD_INCLUDE_DIR})
|
||||
set(LIBSWRESAMPLE_LIBRARY ${LIBSWRESAMPLE_STANDARD_LIBRARIES})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(Libswresample DEFAULT_MSG
|
||||
LIBSWRESAMPLE_INCLUDE_DIR LIBSWRESAMPLE_LIBRARY)
|
||||
|
||||
if(LIBSWRESAMPLE_FOUND)
|
||||
set(LIBSWRESAMPLE_DEFINITIONS ${LIBSWRESAMPLE_DEFINITION})
|
||||
set(LIBSWRESAMPLE_INCLUDE_DIRS ${LIBSWRESAMPLE_INCLUDE_DIR})
|
||||
set(LIBSWRESAMPLE_LIBRARIES ${LIBSWRESAMPLE_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
LIBSWRESAMPLE_STANDARD_DEFINITIONS
|
||||
LIBSWRESAMPLE_STANDARD_INCLUDE_DIR
|
||||
LIBSWRESAMPLE_STANDARD_LIBRARIES
|
||||
|
||||
LIBSWRESAMPLE_STATIC_DEFINITIONS
|
||||
LIBSWRESAMPLE_STATIC_INCLUDE_DIR
|
||||
LIBSWRESAMPLE_STATIC_LIBRARIES
|
||||
)
|
||||
|
@ -1,124 +0,0 @@
|
||||
#copy data files and libs into (additional) directory (trees)
|
||||
#todo: improve dependency interaction
|
||||
|
||||
set(OBS_CORE_LIBS "" CACHE INTERNAL "obs core libs")
|
||||
set(OBS_CORE_LIB_TARGETS "" CACHE INTERNAL "obs core lib targets")
|
||||
|
||||
function(obs_add_core_lib lib)
|
||||
get_property(location TARGET ${lib} PROPERTY LOCATION)
|
||||
list(APPEND OBS_CORE_LIBS ${location})
|
||||
set(OBS_CORE_LIBS ${OBS_CORE_LIBS} CACHE INTERNAL "")
|
||||
|
||||
get_filename_component(filename ${location} NAME)
|
||||
|
||||
foreach(target ${OBS_CORE_LIB_TARGETS})
|
||||
get_property(tar_location TARGET ${target} PROPERTY LOCATION)
|
||||
get_filename_component(dir ${tar_location} DIRECTORY)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${location}
|
||||
"${dir}/")
|
||||
|
||||
#set_property(DIRECTORY ${dir} APPEND PROPERTY
|
||||
# ADDITIONAL_MAKE_CLEAN_FILES ${filename})
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function(obs_add_core_lib_target target)
|
||||
list(APPEND OBS_CORE_LIB_TARGETS ${target})
|
||||
set(OBS_CORE_LIB_TARGETS ${OBS_CORE_LIB_TARGETS} CACHE INTERNAL "")
|
||||
|
||||
get_property(tar_location TARGET ${target} PROPERTY LOCATION)
|
||||
get_filename_component(dir ${tar_location} DIRECTORY)
|
||||
|
||||
foreach(lib ${OBS_CORE_LIBS})
|
||||
get_filename_component(filename ${lib} NAME)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${lib}
|
||||
"${dir}/")
|
||||
|
||||
set_property(DIRECTORY APPEND PROPERTY
|
||||
ADDITIONAL_MAKE_CLEAN_FILES "${dir}/${filename}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
set(OBS_PLUGINS "" CACHE INTERNAL "obs plugins")
|
||||
set(OBS_PLUGIN_TARGETS "" CACHE INTERNAL "obs plugin targets")
|
||||
|
||||
function(obs_add_plugin plugin)
|
||||
get_property(location TARGET ${plugin} PROPERTY LOCATION)
|
||||
list(APPEND OBS_PLUGINS ${location})
|
||||
set(OBS_PLUGINS ${OBS_PLUGINS} CACHE INTERNAL "")
|
||||
|
||||
get_filename_component(filename ${location} NAME)
|
||||
|
||||
foreach(target ${OBS_PLUGIN_TARGETS})
|
||||
get_property(tar_location TARGET ${target} PROPERTY LOCATION)
|
||||
get_filename_component(dir ${tar_location} DIRECTORY)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${location}
|
||||
"${dir}/../plugins/")
|
||||
|
||||
#set_property(DIRECTORY ${dir} APPEND PROPERTY
|
||||
# ADDITIONAL_MAKE_CLEAN_FILES
|
||||
# "${dir}/../plugins/${filename}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function(obs_add_plugin_target target)
|
||||
list(APPEND OBS_PLUGIN_TARGETS ${target})
|
||||
set(OBS_PLUGIN_TARGETS ${OBS_PLUGIN_TARGETS} CACHE INTERNAL "")
|
||||
|
||||
get_property(tar_location TARGET ${target} PROPERTY LOCATION)
|
||||
get_filename_component(dir ${tar_location} DIRECTORY)
|
||||
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${dir}/../plugins/")
|
||||
|
||||
foreach(plugin ${OBS_PLUGINS})
|
||||
get_filename_component(filename ${plugin} NAME)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${plugin}
|
||||
"${dir}/../plugins/")
|
||||
|
||||
set_property(DIRECTORY APPEND PROPERTY
|
||||
ADDITIONAL_MAKE_CLEAN_FILES
|
||||
"${dir}/../plugins/${filename}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
set(OBS_DATA_DIRS "" CACHE INTERNAL "data_dirs")
|
||||
set(OBS_DATA_SOURCES "" CACHE INTERNAL "source_dirs")
|
||||
|
||||
function(obs_add_data_source prefix)
|
||||
string(MD5 hash ${prefix})
|
||||
set(source_name "OBS_DATA_SOURCES_${hash}")
|
||||
set(prefix_name "OBS_DATA_SOURCE_${hash}")
|
||||
set(args ${ARGN})
|
||||
|
||||
foreach(target ${OBS_DATA_DIRS})
|
||||
file(COPY
|
||||
${args}
|
||||
DESTINATION
|
||||
"${target}/${prefix}")
|
||||
endforeach()
|
||||
|
||||
set(${source_name} ${args} CACHE INTERNAL "")
|
||||
set(${prefix_name} ${prefix} CACHE INTERNAL "")
|
||||
list(APPEND OBS_DATA_SOURCES ${hash})
|
||||
set(OBS_DATA_SOURCES ${OBS_DATA_SOURCES} CACHE INTERNAL "")
|
||||
endfunction()
|
||||
|
||||
function(obs_add_data_dir dir)
|
||||
set(dir "${obs_BINARY_DIR}/${dir}")
|
||||
list(APPEND OBS_DATA_DIRS ${dir})
|
||||
set(OBS_DATA_DIRS ${OBS_DATA_DIRS} CACHE INTERNAL "")
|
||||
|
||||
foreach(hash ${OBS_DATA_SOURCES})
|
||||
set(source_name "OBS_DATA_SOURCES_${hash}")
|
||||
set(prefix_name "OBS_DATA_SOURCE_${hash}")
|
||||
file(COPY
|
||||
${${source_name}}
|
||||
DESTINATION
|
||||
"${dir}/${${prefix_name}}")
|
||||
endforeach()
|
||||
endfunction()
|
@ -1,75 +0,0 @@
|
||||
if(WIN32)
|
||||
set(libobs_opengl_platform_src
|
||||
gl-windows.c)
|
||||
elseif(APPLE AND UNIX)
|
||||
set(libobs_opengl_platform_objc_src gl-cocoa.m)
|
||||
set_source_files_properties(${libobs_opengl_platform_objc_src}
|
||||
PROPERTIES LANGUAGE C)
|
||||
set(libobs_opengl_platform_src ${libobs_opengl_platform_objc_src})
|
||||
|
||||
find_library(COCOA Cocoa)
|
||||
include_directories(${COCOA})
|
||||
link_libraries(${COCOA})
|
||||
|
||||
find_library(IOSURF IOSurface)
|
||||
include_directories(${IOSURF})
|
||||
link_libraries(${IOSURF})
|
||||
else()
|
||||
endif()
|
||||
|
||||
option(USE_BUNDLED_GLEW "Build using bundled GLEW" ${WIN32})
|
||||
|
||||
option(USE_STATIC_GLEW "Link GLEW statically (ignored with USE_BUNDLED_GLEW)"
|
||||
false)
|
||||
|
||||
include_directories(SYSTEM ${obs_SOURCE_DIR}/libobs)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIRS})
|
||||
|
||||
add_definitions(-DGLEW_NO_GLU)
|
||||
|
||||
if(USE_BUNDLED_GLEW)
|
||||
include_directories(SYSTEM glew/include)
|
||||
add_definitions(-DGLEW_STATIC)
|
||||
set(GLEW_SRC glew/src/glew.c)
|
||||
else()
|
||||
if(USE_STATIC_GLEW)
|
||||
set(lib_prefixes ${CMAKE_FIND_LIBRARY_PREFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_STATIC_LIBRARY_PREFIX}
|
||||
${CMAKE_DYNAMIC_LIBRARY_PREFIX}
|
||||
${CMAKE_SHARED_OBJECT_PREFIX})
|
||||
set(glew_static "static")
|
||||
endif()
|
||||
find_package(GLEW REQUIRED ${glew_static})
|
||||
include_directories(${GLEW_INCLUDE_DIRS})
|
||||
if(USE_STATIC_GLEW)
|
||||
unset(glew_static)
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES ${lib_prefixes})
|
||||
unset(lib_prefixes)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(libobs-opengl MODULE
|
||||
gl-helpers.c
|
||||
gl-indexbuffer.c
|
||||
gl-shader.c
|
||||
gl-shaderparser.c
|
||||
gl-stagesurf.c
|
||||
gl-subsystem.c
|
||||
gl-texture2d.c
|
||||
gl-texturecube.c
|
||||
gl-vertexbuffer.c
|
||||
gl-zstencil.c
|
||||
${libobs_opengl_platform_src}
|
||||
${GLEW_SRC})
|
||||
|
||||
set_target_properties(libobs-opengl
|
||||
PROPERTIES OUTPUT_NAME obs-opengl)
|
||||
|
||||
target_link_libraries(libobs-opengl
|
||||
libobs
|
||||
${OPENGL_LIBRARIES}
|
||||
${GLEW_LIBRARIES})
|
||||
|
||||
obs_add_core_lib(libobs-opengl)
|
@ -1,92 +0,0 @@
|
||||
if(WIN32)
|
||||
set(libobs_platform_src
|
||||
obs-windows.c
|
||||
util/platform-windows.c)
|
||||
elseif(APPLE)
|
||||
set(libobs_platform_src
|
||||
obs-cocoa.c
|
||||
util/platform-cocoa.m)
|
||||
set_source_files_properties(${libobs_platform_src}
|
||||
PROPERTIES
|
||||
LANGUAGE C
|
||||
COMPILE_FLAGS "-fobjc-arc")
|
||||
add_definitions("-DHAVE_STRTOLL")
|
||||
find_library(COCOA Cocoa)
|
||||
mark_as_advanced(COCOA)
|
||||
include_directories(${COCOA})
|
||||
link_libraries(${COCOA})
|
||||
elseif(UNIX)
|
||||
set(libobs_platform_src
|
||||
obs-nix.c
|
||||
util/platform-nix.c)
|
||||
else()
|
||||
endif()
|
||||
|
||||
option(USE_STATIC_FFMPEG "Link ffmpeg statically (if possible)" false)
|
||||
if(USE_STATIC_FFMPEG)
|
||||
set(FFMPEG_STATIC "static")
|
||||
endif()
|
||||
|
||||
find_package(Libavutil REQUIRED ${FFMPEG_STATIC})
|
||||
include_directories(${LIBAVUTIL_INCLUDE_DIRS})
|
||||
add_definitions(${LIBAVUTIL_DEFINITIONS})
|
||||
|
||||
find_package(Libswresample REQUIRED ${FFMPEG_STATIC})
|
||||
include_directories(${LIBSWRESAMPLE_INCLUDE_DIRS})
|
||||
add_definitions(${LIBSWRESAMPLE_DEFINITIONS})
|
||||
|
||||
add_library(libobs SHARED
|
||||
obs.c
|
||||
obs-display.c
|
||||
obs-module.c
|
||||
obs-output.c
|
||||
obs-encoder.c
|
||||
obs-scene.c
|
||||
obs-source.c
|
||||
obs-video.c
|
||||
util/base.c
|
||||
util/bmem.c
|
||||
util/cf-lexer.c
|
||||
util/cf-parser.c
|
||||
util/config-file.c
|
||||
util/dstr.c
|
||||
util/lexer.c
|
||||
util/platform.c
|
||||
util/text-lookup.c
|
||||
util/utf8.c
|
||||
media-io/audio-io.c
|
||||
media-io/format-conversion.c
|
||||
media-io/audio-resampler-ffmpeg.c
|
||||
media-io/video-io.c
|
||||
graphics/axisang.c
|
||||
graphics/bounds.c
|
||||
graphics/effect.c
|
||||
graphics/effect-parser.c
|
||||
graphics/graphics.c
|
||||
graphics/graphics-imports.c
|
||||
graphics/math-extra.c
|
||||
graphics/matrix3.c
|
||||
graphics/matrix4.c
|
||||
graphics/plane.c
|
||||
graphics/quat.c
|
||||
graphics/shader-parser.c
|
||||
graphics/texture-render.c
|
||||
graphics/vec2.c
|
||||
graphics/vec3.c
|
||||
graphics/vec4.c
|
||||
callback/calldata.c
|
||||
callback/proc.c
|
||||
callback/signal.c
|
||||
${libobs_platform_src})
|
||||
|
||||
set_target_properties(libobs
|
||||
PROPERTIES OUTPUT_NAME obs)
|
||||
|
||||
target_link_libraries(libobs
|
||||
${LIBAVUTIL_LIBRARIES}
|
||||
${LIBSWRESAMPLE_LIBRARIES})
|
||||
|
||||
obs_add_core_lib(libobs)
|
||||
|
||||
obs_add_data_source(/data/libobs/
|
||||
${obs_SOURCE_DIR}/build/data/libobs/default.effect)
|
@ -1,113 +0,0 @@
|
||||
option(USE_STATIC_WX "Link wxWidgets statically" false)
|
||||
if(USE_STATIC_WX)
|
||||
set(wxWidgets_USE_STATIC true)
|
||||
endif()
|
||||
find_package(wxWidgets COMPONENTS core base REQUIRED)
|
||||
|
||||
include("${wxWidgets_USE_FILE}")
|
||||
|
||||
function(wx_required_version)
|
||||
include(CheckCXXSourceCompiles)
|
||||
set(WX_CHECK_DEFINITIONS "")
|
||||
foreach(wxw_def ${wxWidgets_DEFINITIONS})
|
||||
set(WX_CHECK_DEFINITIONS "${WX_CHECK_DEFINITIONS} -D${wxw_def}")
|
||||
endforeach()
|
||||
set(CMAKE_REQUIRED_DEFINITIONS ${WX_CHECK_DEFINITIONS})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${wxWidgets_INCLUDE_DIRS})
|
||||
set(CMAKE_REQUIRED_FLAGS ${wxWidgets_CXX_FLAGS})
|
||||
check_cxx_source_compiles("
|
||||
#include <wx/sysopt.h>
|
||||
#if (wxMINOR_VERSION < 9 && wxMAJOR_VERSION <= 2) || wxMAJOR_VERSION < 3
|
||||
#error
|
||||
#endif
|
||||
int main() {}"
|
||||
WX_REQUIRED_VERSION)
|
||||
|
||||
if(NOT WX_REQUIRED_VERSION)
|
||||
message(SEND_ERROR "wxWidgets version 2.9 or later is required")
|
||||
endif()
|
||||
endfunction()
|
||||
wx_required_version()
|
||||
|
||||
if(USE_STATIC_WX)
|
||||
#unpack -llib to static library names
|
||||
set(WX_LIBRARIES "")
|
||||
set(lib_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
${CMAKE_DYNAMIC_LIBRARY_SUFFIX} ${CMAKE_SHARED_OBJECT_SUFFIX})
|
||||
foreach(lib ${wxWidgets_LIBRARIES})
|
||||
string(SUBSTRING ${lib} 0 2 _l)
|
||||
if(_l STREQUAL "-l")
|
||||
string(SUBSTRING ${lib} 2 -1 libname)
|
||||
find_library(lib_file NAMES ${libname}
|
||||
HINTS ${wxWidgets_LIBRARY_DIRS})
|
||||
if(lib_file)
|
||||
list(APPEND WX_LIBRARIES ${lib_file})
|
||||
else()
|
||||
list(APPEND WX_LIBRARIES ${lib})
|
||||
endif()
|
||||
unset(lib_file CACHE)
|
||||
else()
|
||||
list(APPEND WX_LIBRARIES ${lib})
|
||||
endif()
|
||||
endforeach()
|
||||
if(APPLE)
|
||||
find_library(lzma NAMES lzma)
|
||||
if(lzma)
|
||||
link_libraries(${lzma})
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${lib_suffixes})
|
||||
unset(lib_suffixes)
|
||||
link_libraries(${WX_LIBRARIES})
|
||||
unset(WX_LIBRARIES)
|
||||
else()
|
||||
link_libraries(${wxWidgets_LIBRARIES})
|
||||
endif()
|
||||
|
||||
include_directories(SYSTEM ${obs_SOURCE_DIR}/libobs)
|
||||
|
||||
link_libraries(libobs)
|
||||
|
||||
if(WIN32)
|
||||
set(obs_platform_src
|
||||
platform-windows.cpp)
|
||||
elseif(APPLE)
|
||||
set(obs_platform_src
|
||||
platform-osx.mm)
|
||||
add_definitions(-fobjc-arc)
|
||||
if(BUILD_APP_BUNDLE)
|
||||
add_definitions(-DOBS_OSX_BUNDLE=1)
|
||||
endif()
|
||||
elseif(UNIX)
|
||||
set(obs_platform_src
|
||||
platform-x11.cpp)
|
||||
endif()
|
||||
|
||||
add_executable(obs
|
||||
window-basic-main.cpp
|
||||
window-basic-settings.cpp
|
||||
window-namedialog.cpp
|
||||
settings-basic.cpp
|
||||
settings-basic-general.cpp
|
||||
settings-basic-video.cpp
|
||||
wx-subclass.cpp
|
||||
wx-wrappers.cpp
|
||||
obs-app.cpp
|
||||
forms/OBSWindows.cpp
|
||||
${obs_platform_src})
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(obs PROPERTIES
|
||||
MACOSX_BUNDLE ${BUILD_APP_BUNDLE})
|
||||
if(BUILD_APP_BUNDLE)
|
||||
obs_add_core_lib_target(obs)
|
||||
obs_add_plugin_target(obs)
|
||||
obs_add_data_dir(/bin/obs.app/Contents/)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
obs_add_data_source(/data/obs-studio/locale
|
||||
${obs_SOURCE_DIR}/build/data/obs-studio/locale/en.txt
|
||||
${obs_SOURCE_DIR}/build/data/obs-studio/locale/ja.txt
|
||||
${obs_SOURCE_DIR}/build/data/obs-studio/locale/locale.ini)
|
@ -1,6 +0,0 @@
|
||||
add_subdirectory(test-input)
|
||||
if(WIN32)
|
||||
add_subdirectory(win)
|
||||
elseif(APPLE AND UNIX)
|
||||
add_subdirectory(osx)
|
||||
endif()
|
@ -1,10 +0,0 @@
|
||||
include_directories(SYSTEM ${obs_SOURCE_DIR}/libobs)
|
||||
|
||||
find_library(COCOA Cocoa)
|
||||
include_directories(${COCOA})
|
||||
|
||||
link_libraries(libobs ${COCOA})
|
||||
|
||||
add_definitions(-fobjc-arc)
|
||||
|
||||
add_executable(test test.mm)
|
@ -1,16 +0,0 @@
|
||||
include_directories(SYSTEM ${obs_SOURCE_DIR}/libobs)
|
||||
|
||||
add_library(test-input MODULE
|
||||
test-filter.c
|
||||
test-input.c
|
||||
test-sinewave.c
|
||||
test-random.c)
|
||||
|
||||
target_link_libraries(test-input
|
||||
libobs)
|
||||
|
||||
obs_add_plugin(test-input)
|
||||
|
||||
obs_add_data_source(/data/obs-plugins/test-input/
|
||||
${obs_SOURCE_DIR}/build/data/obs-plugins/test-input/draw.effect
|
||||
${obs_SOURCE_DIR}/build/data/obs-plugins/test-input/test.effect)
|
Loading…
Reference in New Issue
Block a user