cmake: Update CMake finders and helper modules
parent
02e5410381
commit
df94b02075
|
@ -1,43 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
|
||||
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs64.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\64bit</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs64.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\64bit</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs64.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\64bit</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">
|
||||
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs64.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\64bit</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">
|
||||
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs32.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\32bit</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs32.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\32bit</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs32.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\32bit</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">
|
||||
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs32.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\32bit</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,163 @@
|
|||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
# Set compile options for MSVC
|
||||
if(OS_WINDOWS AND MSVC)
|
||||
if(NOT EXISTS "${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.user")
|
||||
file(
|
||||
GENERATE
|
||||
OUTPUT "${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.user"
|
||||
INPUT "${CMAKE_SOURCE_DIR}/cmake/bundle/windows/ALL_BUILD.vcxproj.user.in"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Check for Win SDK version 10.0.20348 or above
|
||||
if(MSVC_VERSION LESS 1920)
|
||||
message(
|
||||
INFO
|
||||
" + OBS-Studio - Windows API version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}"
|
||||
)
|
||||
string(REPLACE "." ";" WINAPI_VER
|
||||
"${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||
|
||||
list(GET WINAPI_VER 0 WINAPI_VER_MAJOR)
|
||||
list(GET WINAPI_VER 1 WINAPI_VER_MINOR)
|
||||
list(GET WINAPI_VER 2 WINAPI_VER_BUILD)
|
||||
|
||||
set(WINAPI_COMPATIBLE FALSE)
|
||||
if(WINAPI_VER_MAJOR EQUAL 10)
|
||||
if(WINAPI_VER_MINOR EQUAL 0)
|
||||
if(WINAPI_VER_BUILD GREATER_EQUAL 20348)
|
||||
set(WINAPI_COMPATIBLE TRUE)
|
||||
endif()
|
||||
else()
|
||||
set(WINAPI_COMPATIBLE TRUE)
|
||||
endif()
|
||||
elseif(WINAPI_VER_MAJOR GREATER 10)
|
||||
set(WINAPI_COMPATIBLE TRUE)
|
||||
endif()
|
||||
|
||||
if(NOT WINAPI_COMPATIBLE)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"OBS: OBS requires Windows 10 SDK version 10.0.20348.0 and above to compile.\n"
|
||||
" Please download the most recent Windows 10 SDK in order to compile (or update to Visual Studio 2019)."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_compile_options(
|
||||
/MP
|
||||
/W3
|
||||
/wd4127
|
||||
/wd4201
|
||||
/wd4456
|
||||
/wd4457
|
||||
/wd4458
|
||||
/wd4459
|
||||
/wd4595
|
||||
"$<$<CONFIG:DEBUG>:/DDEBUG=1;/D_DEBUG=1>"
|
||||
"$<$<CONFIG:RELWITHDEBINFO>:/Ob2>"
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
/D_CRT_SECURE_NO_WARNINGS
|
||||
/D_CRT_NONSTDC_NO_WARNINGS)
|
||||
|
||||
add_link_options(
|
||||
"LINKER:/OPT:REF"
|
||||
"$<$<NOT:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>>:LINKER\:/SAFESEH\:NO>"
|
||||
"$<$<CONFIG:DEBUG>:LINKER\:/INCREMENTAL\:NO>"
|
||||
"$<$<CONFIG:RELWITHDEBINFO>:LINKER\:/INCREMENTAL\:NO;/OPT:ICF>")
|
||||
else()
|
||||
find_program(CCACHE_PROGRAM "ccache")
|
||||
set(CCACHE_SUPPORT
|
||||
ON
|
||||
CACHE BOOL "Enable ccache support")
|
||||
mark_as_advanced(CCACHE_PROGRAM)
|
||||
if(CCACHE_PROGRAM AND CCACHE_SUPPORT)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
|
||||
set(CMAKE_OBJC_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
|
||||
set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
|
||||
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") # CMake 3.9+
|
||||
endif()
|
||||
|
||||
add_compile_options(
|
||||
-Wextra
|
||||
-Wvla
|
||||
-Wno-unused-function
|
||||
-Wno-missing-field-initializers
|
||||
-fno-strict-aliasing
|
||||
"$<$<COMPILE_LANGUAGE:C>:-Werror-implicit-function-declaration;-Wno-missing-braces>"
|
||||
"$<$<BOOL:${USE_LIBCXX}>:-stdlib=libc++>"
|
||||
"$<$<CONFIG:DEBUG>:-DDEBUG=1;-D_DEBUG=1>"
|
||||
"$<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang>:-fcolor-diagnostics>"
|
||||
"$<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang>:-fcolor-diagnostics>")
|
||||
|
||||
if(OBS_CODESIGN_LINKER)
|
||||
add_link_options("LINKER:$<$<PLATFORM_ID:Darwin>:-adhoc_codesign>")
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
set(CMAKE_WIDL
|
||||
"widl"
|
||||
CACHE INTERNAL "wine IDL header file generation program")
|
||||
add_compile_definitions("_WIN32_WINNT=0x0600;WINVER=0x0600")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC_CXX_ARCHITECTURE_ID)
|
||||
string(TOLOWER ${MSVC_CXX_ARCHITECTURE_ID} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
|
||||
else()
|
||||
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
|
||||
endif()
|
||||
|
||||
if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES
|
||||
"(i[3-6]86|x86|x64|x86_64|amd64|e2k)")
|
||||
if(NOT MSVC AND NOT CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
|
||||
set(ARCH_SIMD_FLAGS -mmmx -msse -msse2)
|
||||
endif()
|
||||
elseif(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64(le)?")
|
||||
set(ARCH_SIMD_DEFINES -DNO_WARN_X86_INTRINSICS)
|
||||
set(ARCH_SIMD_FLAGS -mvsx)
|
||||
else()
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "^(Apple)?Clang|GNU"
|
||||
OR CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang|GNU")
|
||||
check_c_compiler_flag("-fopenmp-simd" C_COMPILER_SUPPORTS_OPENMP_SIMD)
|
||||
check_cxx_compiler_flag("-fopenmp-simd" CXX_COMPILER_SUPPORTS_OPENMP_SIMD)
|
||||
set(ARCH_SIMD_FLAGS
|
||||
-DSIMDE_ENABLE_OPENMP
|
||||
"$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:C_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>"
|
||||
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:CXX_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "e2k")
|
||||
foreach(
|
||||
TEST_C_FLAG
|
||||
"-Wno-unused-parameter"
|
||||
"-Wno-ignored-qualifiers"
|
||||
"-Wno-pointer-sign"
|
||||
"-Wno-unused-variable"
|
||||
"-Wno-sign-compare"
|
||||
"-Wno-bad-return-value-type"
|
||||
"-Wno-maybe-uninitialized")
|
||||
check_c_compiler_flag(${TEST_C_FLAG}
|
||||
C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG})
|
||||
if(C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG})
|
||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${TEST_C_FLAG})
|
||||
endif()
|
||||
endforeach()
|
||||
foreach(TEST_CXX_FLAG "-Wno-invalid-offsetof" "-Wno-maybe-uninitialized")
|
||||
check_cxx_compiler_flag(${TEST_CXX_FLAG}
|
||||
CXX_COMPILER_SUPPORTS_FLAG_${TEST_CXX_FLAG})
|
||||
if(CXX_COMPILER_SUPPORTS_FLAG_${TEST_CXX_FLAG})
|
||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${TEST_CXX_FLAG})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
|
@ -1,279 +1,290 @@
|
|||
# Doesn't really make sense anywhere else
|
||||
if(NOT MSVC)
|
||||
return()
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Internal variable to avoid copying more than once
|
||||
if(COPIED_DEPENDENCIES)
|
||||
return()
|
||||
return()
|
||||
endif()
|
||||
|
||||
option(COPY_DEPENDENCIES "Automatically try copying all dependencies" ON)
|
||||
if(NOT COPY_DEPENDENCIES)
|
||||
return()
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bin_suffix 64)
|
||||
set(_bin_suffix 64)
|
||||
else()
|
||||
set(_bin_suffix 32)
|
||||
set(_bin_suffix 32)
|
||||
endif()
|
||||
|
||||
file(GLOB FFMPEG_BIN_FILES
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/avcodec-*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/avcodec-*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/avcodec-*.dll"
|
||||
file(
|
||||
GLOB
|
||||
FFMPEG_BIN_FILES
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/avcodec-*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/avcodec-*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/avcodec-*.dll"
|
||||
"${FFMPEG_avformat_INCLUDE_DIR}/../bin/avformat-*.dll"
|
||||
"${FFMPEG_avformat_INCLUDE_DIR}/../bin${_bin_suffix}/avformat-*.dll"
|
||||
"${FFMPEG_avformat_INCLUDE_DIR}/bin${_bin_suffix}/avformat-*.dll"
|
||||
"${FFMPEG_avutil_INCLUDE_DIR}/../bin/avutil-*.dll"
|
||||
"${FFMPEG_avutil_INCLUDE_DIR}/../bin${_bin_suffix}/avutil-*.dll"
|
||||
"${FFMPEG_avutil_INCLUDE_DIR}/bin${_bin_suffix}/avutil-*.dll"
|
||||
"${FFMPEG_avdevice_INCLUDE_DIR}/../bin/avdevice-*.dll"
|
||||
"${FFMPEG_avdevice_INCLUDE_DIR}/../bin${_bin_suffix}/avdevice-*.dll"
|
||||
"${FFMPEG_avdevice_INCLUDE_DIR}/bin${_bin_suffix}/avdevice-*.dll"
|
||||
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin/avfilter-*.dll"
|
||||
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin${_bin_suffix}/avfilter-*.dll"
|
||||
"${FFMPEG_avfilter_INCLUDE_DIR}/bin${_bin_suffix}/avfilter-*.dll"
|
||||
"${FFMPEG_postproc_INCLUDE_DIR}/../bin/postproc-*.dll"
|
||||
"${FFMPEG_postproc_INCLUDE_DIR}/../bin${_bin_suffix}/postproc-*.dll"
|
||||
"${FFMPEG_postproc_INCLUDE_DIR}/bin${_bin_suffix}/postproc-*.dll"
|
||||
"${FFMPEG_swscale_INCLUDE_DIR}/../bin/swscale-*.dll"
|
||||
"${FFMPEG_swscale_INCLUDE_DIR}/bin${_bin_suffix}/swscale-*.dll"
|
||||
"${FFMPEG_swscale_INCLUDE_DIR}/../bin${_bin_suffix}/swscale-*.dll"
|
||||
"${FFMPEG_swresample_INCLUDE_DIR}/../bin/swresample-*.dll"
|
||||
"${FFMPEG_swresample_INCLUDE_DIR}/../bin${_bin_suffix}/swresample-*.dll"
|
||||
"${FFMPEG_swresample_INCLUDE_DIR}/bin${_bin_suffix}/swresample-*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libopus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/opus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libopus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/opus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libogg*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libvorbis*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libogg*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libvorbis*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libvpx*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libvpx*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libsrt*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libsrt*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedcrypto*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedcrypto*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedtls*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedtls*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedx509*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedx509*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libopus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/opus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libopus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/opus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libbz2*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/zlib*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libbz2*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/zlib*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libSvtAv1Enc.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libSvtAv1Enc.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libSvtAv1Enc.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libSvtAv1Enc.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libaom.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libaom.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libaom.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libaom.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/librist.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/librist.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/librist.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/librist.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libbz2*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/zlib*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libbz2*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/zlib*.dll")
|
||||
|
||||
"${FFMPEG_avformat_INCLUDE_DIR}/../bin/avformat-*.dll"
|
||||
"${FFMPEG_avformat_INCLUDE_DIR}/../bin${_bin_suffix}/avformat-*.dll"
|
||||
"${FFMPEG_avformat_INCLUDE_DIR}/bin${_bin_suffix}/avformat-*.dll"
|
||||
file(
|
||||
GLOB
|
||||
X264_BIN_FILES
|
||||
"${X264_INCLUDE_DIR}/../bin${_bin_suffix}/libx264-*.dll"
|
||||
"${X264_INCLUDE_DIR}/../bin/libx264-*.dll"
|
||||
"${X264_INCLUDE_DIR}/bin/libx264-*.dll"
|
||||
"${X264_INCLUDE_DIR}/bin${_bin_suffix}/libx264-*.dll")
|
||||
|
||||
"${FFMPEG_avutil_INCLUDE_DIR}/../bin/avutil-*.dll"
|
||||
"${FFMPEG_avutil_INCLUDE_DIR}/../bin${_bin_suffix}/avutil-*.dll"
|
||||
"${FFMPEG_avutil_INCLUDE_DIR}/bin${_bin_suffix}/avutil-*.dll"
|
||||
file(
|
||||
GLOB
|
||||
FREETYPE_BIN_FILES
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin${_bin_suffix}/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin${_bin_suffix}/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/bin/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/bin${_bin_suffix}/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin${_bin_suffix}/freetype.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin/freetype.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin${_bin_suffix}/freetype.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin/freetype.dll")
|
||||
|
||||
"${FFMPEG_avdevice_INCLUDE_DIR}/../bin/avdevice-*.dll"
|
||||
"${FFMPEG_avdevice_INCLUDE_DIR}/../bin${_bin_suffix}/avdevice-*.dll"
|
||||
"${FFMPEG_avdevice_INCLUDE_DIR}/bin${_bin_suffix}/avdevice-*.dll"
|
||||
file(
|
||||
GLOB
|
||||
LIBFDK_BIN_FILES
|
||||
"${Libfdk_INCLUDE_DIR}/../bin${_bin_suffix}/libfdk*-*.dll"
|
||||
"${Libfdk_INCLUDE_DIR}/../bin/libfdk*-*.dll"
|
||||
"${Libfdk_INCLUDE_DIR}/bin/libfdk*-*.dll"
|
||||
"${Libfdk_INCLUDE_DIR}/bin${_bin_suffix}/libfdk*-*.dll")
|
||||
|
||||
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin/avfilter-*.dll"
|
||||
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin${_bin_suffix}/avfilter-*.dll"
|
||||
"${FFMPEG_avfilter_INCLUDE_DIR}/bin${_bin_suffix}/avfilter-*.dll"
|
||||
file(
|
||||
GLOB
|
||||
SSL_BIN_FILES
|
||||
"${SSL_INCLUDE_DIR}/../bin${_bin_suffix}/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/../bin${_bin_suffix}/libeay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/../bin/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/../bin/libeay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin${_bin_suffix}/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin${_bin_suffix}/libeay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin/libeay32*.dll")
|
||||
|
||||
"${FFMPEG_postproc_INCLUDE_DIR}/../bin/postproc-*.dll"
|
||||
"${FFMPEG_postproc_INCLUDE_DIR}/../bin${_bin_suffix}/postproc-*.dll"
|
||||
"${FFMPEG_postproc_INCLUDE_DIR}/bin${_bin_suffix}/postproc-*.dll"
|
||||
file(
|
||||
GLOB
|
||||
CURL_BIN_FILES
|
||||
"${CURL_INCLUDE_DIR}/../build/Win${_bin_suffix}/VC12/DLL Release - DLL Windows SSPI/libcurl.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/curl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin/curl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin${_bin_suffix}/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin${_bin_suffix}/curl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin/curl*.dll")
|
||||
|
||||
"${FFMPEG_swscale_INCLUDE_DIR}/../bin/swscale-*.dll"
|
||||
"${FFMPEG_swscale_INCLUDE_DIR}/bin${_bin_suffix}/swscale-*.dll"
|
||||
"${FFMPEG_swscale_INCLUDE_DIR}/../bin${_bin_suffix}/swscale-*.dll"
|
||||
file(
|
||||
GLOB
|
||||
LUA_BIN_FILES
|
||||
"${LUAJIT_INCLUDE_DIR}/../../bin${_bin_suffix}/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/../../bin/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/../bin${_bin_suffix}/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/../bin/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/bin${_bin_suffix}/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/bin/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/lua*.dll")
|
||||
|
||||
"${FFMPEG_swresample_INCLUDE_DIR}/../bin/swresample-*.dll"
|
||||
"${FFMPEG_swresample_INCLUDE_DIR}/../bin${_bin_suffix}/swresample-*.dll"
|
||||
"${FFMPEG_swresample_INCLUDE_DIR}/bin${_bin_suffix}/swresample-*.dll"
|
||||
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libopus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/opus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libopus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/opus*.dll"
|
||||
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libogg*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libvorbis*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libogg*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libvorbis*.dll"
|
||||
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libvpx*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libvpx*.dll"
|
||||
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libsrt*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libsrt*.dll"
|
||||
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedcrypto*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedcrypto*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedtls*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedtls*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedx509*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedx509*.dll"
|
||||
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libopus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/opus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libopus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/opus*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libbz2*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/zlib*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libbz2*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/zlib*.dll"
|
||||
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libSvtAv1Enc.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libSvtAv1Enc.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libSvtAv1Enc.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libSvtAv1Enc.dll"
|
||||
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libaom.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libaom.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libaom.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libaom.dll"
|
||||
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/librist.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/librist.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/librist.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/librist.dll"
|
||||
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libbz2*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/zlib*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libbz2*.dll"
|
||||
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/zlib*.dll"
|
||||
)
|
||||
|
||||
file(GLOB X264_BIN_FILES
|
||||
"${X264_INCLUDE_DIR}/../bin${_bin_suffix}/libx264-*.dll"
|
||||
"${X264_INCLUDE_DIR}/../bin/libx264-*.dll"
|
||||
"${X264_INCLUDE_DIR}/bin/libx264-*.dll"
|
||||
"${X264_INCLUDE_DIR}/bin${_bin_suffix}/libx264-*.dll")
|
||||
|
||||
file(GLOB FREETYPE_BIN_FILES
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin${_bin_suffix}/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin${_bin_suffix}/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/bin/libfreetype*-*.dll"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/bin${_bin_suffix}/libfreetype*-*.dll")
|
||||
|
||||
file(GLOB LIBFDK_BIN_FILES
|
||||
"${Libfdk_INCLUDE_DIR}/../bin${_bin_suffix}/libfdk*-*.dll"
|
||||
"${Libfdk_INCLUDE_DIR}/../bin/libfdk*-*.dll"
|
||||
"${Libfdk_INCLUDE_DIR}/bin/libfdk*-*.dll"
|
||||
"${Libfdk_INCLUDE_DIR}/bin${_bin_suffix}/libfdk*-*.dll")
|
||||
|
||||
file(GLOB SSL_BIN_FILES
|
||||
"${SSL_INCLUDE_DIR}/../bin${_bin_suffix}/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/../bin${_bin_suffix}/libeay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/../bin/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/../bin/libeay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin${_bin_suffix}/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin${_bin_suffix}/libeay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin/libeay32*.dll")
|
||||
|
||||
file(GLOB CURL_BIN_FILES
|
||||
"${CURL_INCLUDE_DIR}/../build/Win${_bin_suffix}/VC12/DLL Release - DLL Windows SSPI/libcurl.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/curl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin/curl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin${_bin_suffix}/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin${_bin_suffix}/curl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin/curl*.dll"
|
||||
)
|
||||
|
||||
file(GLOB LUA_BIN_FILES
|
||||
"${LUAJIT_INCLUDE_DIR}/../../bin${_bin_suffix}/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/../../bin/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/../bin${_bin_suffix}/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/../bin/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/bin${_bin_suffix}/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/bin/lua*.dll"
|
||||
"${LUAJIT_INCLUDE_DIR}/lua*.dll"
|
||||
)
|
||||
|
||||
if (ZLIB_LIB)
|
||||
GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIB} PATH)
|
||||
if(ZLIB_LIB)
|
||||
get_filename_component(ZLIB_BIN_PATH ${ZLIB_LIB} PATH)
|
||||
endif()
|
||||
file(GLOB ZLIB_BIN_FILES
|
||||
"${ZLIB_BIN_PATH}/zlib*.dll")
|
||||
file(GLOB ZLIB_BIN_FILES "${ZLIB_BIN_PATH}/zlib*.dll")
|
||||
|
||||
if (NOT ZLIB_BIN_FILES)
|
||||
file(GLOB ZLIB_BIN_FILES
|
||||
"${ZLIB_INCLUDE_DIR}/../bin${_bin_suffix}/zlib*.dll"
|
||||
"${ZLIB_INCLUDE_DIR}/../bin/zlib*.dll"
|
||||
"${ZLIB_INCLUDE_DIR}/bin${_bin_suffix}/zlib*.dll"
|
||||
"${ZLIB_INCLUDE_DIR}/bin/zlib*.dll"
|
||||
)
|
||||
if(NOT ZLIB_BIN_FILES)
|
||||
file(
|
||||
GLOB
|
||||
ZLIB_BIN_FILES
|
||||
"${ZLIB_INCLUDE_DIR}/../bin${_bin_suffix}/zlib*.dll"
|
||||
"${ZLIB_INCLUDE_DIR}/../bin/zlib*.dll"
|
||||
"${ZLIB_INCLUDE_DIR}/bin${_bin_suffix}/zlib*.dll"
|
||||
"${ZLIB_INCLUDE_DIR}/bin/zlib*.dll")
|
||||
endif()
|
||||
|
||||
file(GLOB QT_DEBUG_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Cored.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Guid.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Widgetsd.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Svgd.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5WinExtrasd.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Xmld.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Networkd.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libGLESv2d.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libEGLd.dll")
|
||||
file(GLOB RNNOISE_BIN_FILES
|
||||
"${RNNOISE_INCLUDE_DIR}/../bin${_bin_suffix}/rnnoise*.dll"
|
||||
"${RNNOISE_INCLUDE_DIR}/../bin/rnnoise*.dll")
|
||||
|
||||
file(
|
||||
GLOB
|
||||
QT_DEBUG_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Cored.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Guid.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Widgetsd.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5WinExtrasd.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Svgd.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Xmld.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Networkd.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libGLESv2d.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libEGLd.dll")
|
||||
file(GLOB QT_DEBUG_PLAT_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/platforms/qwindowsd.dll")
|
||||
"${Qt5Core_DIR}/../../../plugins/platforms/qwindowsd.dll")
|
||||
file(GLOB QT_DEBUG_STYLES_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/styles/qwindowsvistastyled.dll")
|
||||
"${Qt5Core_DIR}/../../../plugins/styles/qwindowsvistastyled.dll")
|
||||
file(GLOB QT_DEBUG_ICONENGINE_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/iconengines/qsvgicond.dll")
|
||||
file(GLOB QT_DEBUG_IMAGEFORMATS_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qsvgd.dll"
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qgifd.dll"
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qjpegd.dll")
|
||||
"${Qt5Core_DIR}/../../../plugins/iconengines/qsvgicond.dll")
|
||||
file(
|
||||
GLOB
|
||||
QT_DEBUG_IMAGEFORMATS_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qsvgd.dll"
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qgifd.dll"
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qjpegd.dll")
|
||||
|
||||
|
||||
file(GLOB QT_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Core.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Gui.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Widgets.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Svg.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5WinExtras.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Xml.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Network.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libGLESv2.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libEGL.dll")
|
||||
file(
|
||||
GLOB
|
||||
QT_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Core.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Gui.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Widgets.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5WinExtras.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Svg.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Xml.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Network.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libGLESv2.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libEGL.dll")
|
||||
file(GLOB QT_PLAT_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/platforms/qwindows.dll")
|
||||
"${Qt5Core_DIR}/../../../plugins/platforms/qwindows.dll")
|
||||
file(GLOB QT_STYLES_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/styles/qwindowsvistastyle.dll")
|
||||
"${Qt5Core_DIR}/../../../plugins/styles/qwindowsvistastyle.dll")
|
||||
file(GLOB QT_ICONENGINE_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/iconengines/qsvgicon.dll")
|
||||
file(GLOB QT_IMAGEFORMATS_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qsvg.dll"
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qgif.dll"
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qjpeg.dll")
|
||||
"${Qt5Core_DIR}/../../../plugins/iconengines/qsvgicon.dll")
|
||||
file(
|
||||
GLOB
|
||||
QT_IMAGEFORMATS_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qsvg.dll"
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qgif.dll"
|
||||
"${Qt5Core_DIR}/../../../plugins/imageformats/qjpeg.dll")
|
||||
|
||||
file(GLOB QT_ICU_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../bin/icu*.dll")
|
||||
file(GLOB QT_ICU_BIN_FILES "${Qt5Core_DIR}/../../../bin/icu*.dll")
|
||||
|
||||
set(ALL_BASE_BIN_FILES
|
||||
${FFMPEG_BIN_FILES}
|
||||
${X264_BIN_FILES}
|
||||
${CURL_BIN_FILES}
|
||||
${LUA_BIN_FILES}
|
||||
${SSL_BIN_FILES}
|
||||
${ZLIB_BIN_FILES}
|
||||
${LIBFDK_BIN_FILES}
|
||||
${FREETYPE_BIN_FILES}
|
||||
${QT_ICU_BIN_FILES})
|
||||
${FFMPEG_BIN_FILES}
|
||||
${X264_BIN_FILES}
|
||||
${CURL_BIN_FILES}
|
||||
${LUA_BIN_FILES}
|
||||
${SSL_BIN_FILES}
|
||||
${ZLIB_BIN_FILES}
|
||||
${LIBFDK_BIN_FILES}
|
||||
${FREETYPE_BIN_FILES}
|
||||
${RNNOISE_BIN_FILES}
|
||||
${QT_ICU_BIN_FILES})
|
||||
|
||||
set(ALL_REL_BIN_FILES
|
||||
${QT_BIN_FILES})
|
||||
set(ALL_REL_BIN_FILES ${QT_BIN_FILES})
|
||||
|
||||
set(ALL_DBG_BIN_FILES
|
||||
${QT_DEBUG_BIN_FILES})
|
||||
set(ALL_DBG_BIN_FILES ${QT_DEBUG_BIN_FILES})
|
||||
|
||||
set(ALL_PLATFORM_BIN_FILES)
|
||||
set(ALL_PLATFORM_REL_BIN_FILES
|
||||
${QT_PLAT_BIN_FILES})
|
||||
set(ALL_PLATFORM_DBG_BIN_FILES
|
||||
${QT_DEBUG_PLAT_BIN_FILES})
|
||||
set(ALL_PLATFORM_REL_BIN_FILES ${QT_PLAT_BIN_FILES})
|
||||
set(ALL_PLATFORM_DBG_BIN_FILES ${QT_DEBUG_PLAT_BIN_FILES})
|
||||
|
||||
set(ALL_STYLES_BIN_FILES)
|
||||
set(ALL_STYLES_REL_BIN_FILES
|
||||
${QT_STYLES_BIN_FILES})
|
||||
set(ALL_STYLES_DBG_BIN_FILES
|
||||
${QT_DEBUG_STYLES_BIN_FILES})
|
||||
set(ALL_STYLES_REL_BIN_FILES ${QT_STYLES_BIN_FILES})
|
||||
set(ALL_STYLES_DBG_BIN_FILES ${QT_DEBUG_STYLES_BIN_FILES})
|
||||
|
||||
set(ALL_ICONENGINE_BIN_FILES)
|
||||
set(ALL_ICONENGINE_REL_BIN_FILES
|
||||
${QT_ICONENGINE_BIN_FILES})
|
||||
set(ALL_ICONENGINE_DBG_BIN_FILES
|
||||
${QT_DEBUG_ICONENGINE_BIN_FILES})
|
||||
set(ALL_ICONENGINE_REL_BIN_FILES ${QT_ICONENGINE_BIN_FILES})
|
||||
set(ALL_ICONENGINE_DBG_BIN_FILES ${QT_DEBUG_ICONENGINE_BIN_FILES})
|
||||
|
||||
set(ALL_IMAGEFORMATS_BIN_FILES)
|
||||
set(ALL_IMAGEFORMATS_REL_BIN_FILES
|
||||
${QT_IMAGEFORMATS_BIN_FILES})
|
||||
set(ALL_IMAGEFORMATS_DBG_BIN_FILES
|
||||
${QT_DEBUG_IMAGEFORMATS_BIN_FILES})
|
||||
set(ALL_IMAGEFORMATS_REL_BIN_FILES ${QT_IMAGEFORMATS_BIN_FILES})
|
||||
set(ALL_IMAGEFORMATS_DBG_BIN_FILES ${QT_DEBUG_IMAGEFORMATS_BIN_FILES})
|
||||
|
||||
foreach(list
|
||||
ALL_BASE_BIN_FILES ALL_REL_BIN_FILES ALL_DBG_BIN_FILES
|
||||
ALL_PLATFORM_BIN_FILES ALL_PLATFORM_REL_BIN_FILES ALL_PLATFORM_DBG_BIN_FILES
|
||||
ALL_STYLES_BIN_FILES ALL_STYLES_REL_BIN_FILES ALL_STYLES_DBG_BIN_FILES
|
||||
ALL_ICONENGINE_BIN_FILES ALL_ICONENGINE_REL_BIN_FILES ALL_ICONENGINE_DGB_BIN_FILES
|
||||
ALL_IMAGEFORMATS_BIN_FILES ALL_IMAGEFORMATS_REL_BIN_FILES ALL_IMAGEFORMATS_DGB_BIN_FILES)
|
||||
if(${list})
|
||||
list(REMOVE_DUPLICATES ${list})
|
||||
endif()
|
||||
foreach(
|
||||
list
|
||||
ALL_BASE_BIN_FILES
|
||||
ALL_REL_BIN_FILES
|
||||
ALL_DBG_BIN_FILES
|
||||
ALL_PLATFORM_BIN_FILES
|
||||
ALL_PLATFORM_REL_BIN_FILES
|
||||
ALL_PLATFORM_DBG_BIN_FILES
|
||||
ALL_STYLES_BIN_FILES
|
||||
ALL_STYLES_REL_BIN_FILES
|
||||
ALL_STYLES_DBG_BIN_FILES
|
||||
ALL_ICONENGINE_BIN_FILES
|
||||
ALL_ICONENGINE_REL_BIN_FILES
|
||||
ALL_ICONENGINE_DGB_BIN_FILES
|
||||
ALL_IMAGEFORMATS_BIN_FILES
|
||||
ALL_IMAGEFORMATS_REL_BIN_FILES
|
||||
ALL_IMAGEFORMATS_DGB_BIN_FILES)
|
||||
if(${list})
|
||||
list(REMOVE_DUPLICATES ${list})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
message(STATUS "FFmpeg files: ${FFMPEG_BIN_FILES}")
|
||||
message(STATUS "x264 files: ${X264_BIN_FILES}")
|
||||
message(STATUS "Libfdk files: ${LIBFDK_BIN_FILES}")
|
||||
message(STATUS "Freetype files: ${FREETYPE_BIN_FILES}")
|
||||
message(STATUS "rnnoise files: ${RNNOISE_BIN_FILES}")
|
||||
message(STATUS "curl files: ${CURL_BIN_FILES}")
|
||||
message(STATUS "lua files: ${LUA_BIN_FILES}")
|
||||
message(STATUS "ssl files: ${SSL_BIN_FILES}")
|
||||
|
@ -291,78 +302,166 @@ message(STATUS "QT Release Imageformat files: ${QT_IMAGEFORMATS_BIN_FILES}")
|
|||
message(STATUS "QT ICU files: ${QT_ICU_BIN_FILES}")
|
||||
|
||||
foreach(BinFile ${ALL_BASE_BIN_FILES})
|
||||
message(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/")
|
||||
message(
|
||||
STATUS
|
||||
"copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/")
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_REL_BIN_FILES})
|
||||
message(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/")
|
||||
message(
|
||||
STATUS
|
||||
"copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/")
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_DBG_BIN_FILES})
|
||||
message(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/")
|
||||
message(
|
||||
STATUS
|
||||
"copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/")
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_PLATFORM_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/platforms")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/platforms/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/platforms")
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/platforms/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_PLATFORM_REL_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/platforms")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/platforms/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/platforms"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/platforms/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_PLATFORM_DBG_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/platforms")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/platforms/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/platforms"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/platforms/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_STYLES_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/styles")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/styles/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/styles")
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/styles/")
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_STYLES_REL_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/styles")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/styles/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/styles")
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/styles/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_STYLES_DBG_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/styles")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/styles/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/styles")
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/styles/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_ICONENGINE_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/iconengines")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/iconengines/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/iconengines"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/iconengines/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_ICONENGINE_REL_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/iconengines")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/iconengines/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/iconengines"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/iconengines/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_ICONENGINE_DBG_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/iconengines")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/iconengines/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/iconengines"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/iconengines/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_IMAGEFORMATS_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/imageformats")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/imageformats/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/imageformats"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/imageformats/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_IMAGEFORMATS_REL_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/imageformats")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/imageformats/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/imageformats"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/imageformats/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(BinFile ${ALL_IMAGEFORMATS_DBG_BIN_FILES})
|
||||
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/imageformats")
|
||||
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/imageformats/")
|
||||
make_directory(
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/imageformats"
|
||||
)
|
||||
file(
|
||||
COPY "${BinFile}"
|
||||
DESTINATION
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/imageformats/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
set(COPIED_DEPENDENCIES TRUE CACHE BOOL "Dependencies have been copied, set to false to copy again" FORCE)
|
||||
set(COPIED_DEPENDENCIES
|
||||
TRUE
|
||||
CACHE BOOL "Dependencies have been copied, set to false to copy again"
|
||||
FORCE)
|
||||
|
|
|
@ -0,0 +1,242 @@
|
|||
function(upgrade_cmake_vars)
|
||||
if(DEFINED BROWSER_LEGACY)
|
||||
set(ENABLE_BROWSER_LEGACY
|
||||
"${BROWSER_LEGACY}"
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED BROWSER_PANEL_SUPPORT_ENABLED)
|
||||
set(ENABLE_BROWSER_PANELS
|
||||
"${BROWSER_PANEL_SUPPORT_ENABLED}"
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED BUILD_BROWSER)
|
||||
set(ENABLE_BROWSER
|
||||
"${BUILD_BROWSER}"
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED BUILD_CA_ENCODER)
|
||||
set(ENABLE_COREAUDIO_ENCODER
|
||||
"${BUILD_CA_ENCODER}"
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED BUILD_VST)
|
||||
set(ENABLE_VST
|
||||
"${BUILD_VST}"
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED CHECK_FOR_SERVICE_UPDATES)
|
||||
set(ENABLE_SERVICE_UPDATES
|
||||
"${CHECK_FOR_SERVICE_UPDATES}"
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED DEBUG_FFMPEG_MUX)
|
||||
set(ENABLE_FFMPEG_MUX_DEBUG
|
||||
"${DEBUG_FFMPEG_MUX}"
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED DISABLE_IVCAM)
|
||||
if(DISABLE_IVCAM)
|
||||
set(ENABLE_IVCAM
|
||||
OFF
|
||||
CACHE BOOL "" FORCE)
|
||||
else()
|
||||
set(ENABLE_IVCAM
|
||||
ON
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED DISABLE_PLUGINS)
|
||||
if(DISABLE_PLUGINS)
|
||||
set(ENABLE_PLUGINS
|
||||
OFF
|
||||
CACHE BOOL "" FORCE)
|
||||
else()
|
||||
set(ENABLE_PLUGINS
|
||||
ON
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED DISABLE_PYTHON)
|
||||
if(DISABLE_PYTHON)
|
||||
set(ENABLE_SCRIPTING_PYTHON
|
||||
OFF
|
||||
CACHE BOOL "" FORCE)
|
||||
else()
|
||||
set(ENABLE_SCRIPTING_PYTHON
|
||||
ON
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED DISABLE_LUA)
|
||||
if(DISABLE_LUA)
|
||||
set(ENABLE_SCRIPTING_LUA
|
||||
OFF
|
||||
CACHE BOOL "" FORCE)
|
||||
else()
|
||||
set(ENABLE_SCRIPTING_LUA
|
||||
ON
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED DISABLE_SPEEXDSP)
|
||||
if(DISABLE_SPEEXDSP)
|
||||
set(ENABLE_SPEEXDSP
|
||||
OFF
|
||||
CACHE BOOL "" FORCE)
|
||||
else()
|
||||
set(ENABLE_SPEEXDSP
|
||||
ON
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED DISABLE_UPDATE_MODULE)
|
||||
if(DISABLE_UPDATE_MODULE)
|
||||
set(ENABLE_UPDATER
|
||||
OFF
|
||||
CACHE BOOL "" FORCE)
|
||||
else()
|
||||
set(ENABLE_UPDATER
|
||||
ON
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED SHARED_TEXTURE_SUPPORT_ENABLED)
|
||||
set(ENABLE_BROWSER_SHARED_TEXTURE
|
||||
"${SHARED_TEXTURE_SUPPORT_ENABLED}"
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED STATIC_MBEDTLS)
|
||||
set(ENABLE_STATIC_MBEDTLS
|
||||
"${STATIC_MBEDTLS}"
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED UNIX_STRUCTURE AND UNIX_STRUCTURE)
|
||||
set(LINUX_PORTABLE
|
||||
OFF
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED USE_QT_LOOP)
|
||||
set(ENABLE_BROWSER_QT_LOOP
|
||||
"${USE_QT_LOOP}"
|
||||
CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(DEFINED WITH_RTMPS)
|
||||
set(ENABLE_RTMPS
|
||||
"${WITH_RTMPS}"
|
||||
CACHE STRING "" FORCE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(install_obs_plugin_with_data)
|
||||
message(
|
||||
DEPRECATION
|
||||
"OBS: The install_obs_plugin_with_data command is deprecated and will be removed soon. Use 'setup_plugin_target' instead."
|
||||
)
|
||||
_install_obs_plugin_with_data(${ARGV})
|
||||
endfunction()
|
||||
|
||||
function(install_obs_plugin)
|
||||
message(
|
||||
DEPRECATION
|
||||
"OBS: The install_obs_plugin command is deprecated and will be removed soon. Use 'setup_plugin_target' instead."
|
||||
)
|
||||
_install_obs_plugin(${ARGV})
|
||||
endfunction()
|
||||
|
||||
function(install_obs_datatarget)
|
||||
message(
|
||||
DEPRECATION
|
||||
"OBS: The install_obs_datatarget function is deprecated and will be removed soon. Use 'setup_target_resources' instead."
|
||||
)
|
||||
_install_obs_datatarget(${ARGV})
|
||||
endfunction()
|
||||
|
||||
function(__deprecated_var VAR ACCESS)
|
||||
if(ACCESS STREQUAL "READ_ACCESS")
|
||||
message(DEPRECATION "OBS: The variable '${VAR}' is deprecated!")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(__deprecated_feature VAR ACCESS)
|
||||
if(ACCESS STREQUAL "UNKNOWN_READ_ACCESS")
|
||||
message(
|
||||
DEPRECATION
|
||||
"OBS: The feature enabled by '${VAR}' is deprecated and will soon be removed from OBS."
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
set(_DEPRECATED_VARS
|
||||
zlibPath
|
||||
vulkanPath
|
||||
SwigPath
|
||||
PythonPath
|
||||
mbedtlsPath
|
||||
LuajitPath
|
||||
x264Path
|
||||
VlcPath
|
||||
VLCPath
|
||||
speexPath
|
||||
rnnoisePath
|
||||
LibfdkPath
|
||||
curlPath
|
||||
JanssonPath
|
||||
FFmpegPath
|
||||
DepsPath
|
||||
DepsPath32
|
||||
DepsPath64
|
||||
QTDIR32
|
||||
QTDIR64
|
||||
DISABLE_UI
|
||||
UI_ENABLED
|
||||
UNIX_STRUCTURE
|
||||
UPDATE_SPARKLE
|
||||
LIBOBS_PREFER_IMAGEMAGICK
|
||||
DEBUG_FFMPEG_MUX
|
||||
ENABLE_WINMF
|
||||
USE_QT_LOOP
|
||||
SHARED_TEXTURE_SUPPORT_ENABLED
|
||||
BROWSER_PANEL_SUPPORT_ENABLED
|
||||
BROWSER_LEGACY
|
||||
BUILD_BROWSER
|
||||
BUILD_CAPTIONS
|
||||
BUILD_CA_ENCODER
|
||||
BUILD_VST
|
||||
CHECK_FOR_SERVICE_UPDATES
|
||||
DISABLE_IVCAM
|
||||
DISABLE_LUA
|
||||
DISABLE_PLUGINS
|
||||
DISABLE_PYTHON
|
||||
DISABLE_SPEEXDSP
|
||||
DISABLE_UPDATE_MODULE
|
||||
SHARED_TEXTURE_SUPPORT_ENABLED
|
||||
STATIC_MBEDTLS
|
||||
UNIX_STRUCTURE
|
||||
USE_QT_LOOP
|
||||
WITH_RTMPS)
|
||||
|
||||
foreach(_DEPRECATED_VAR IN LISTS _DEPRECATED_VARS)
|
||||
variable_watch(_DEPRECATED_VAR __deprecated_var)
|
||||
endforeach()
|
||||
|
||||
variable_watch(FTL_FOUND __deprecated_feature)
|
||||
|
||||
# Upgrade pre-existing build variables to their new variants as best as possible
|
||||
upgrade_cmake_vars()
|
|
@ -1,12 +0,0 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# APPKIT_FOUND
|
||||
# APPKIT_LIBRARIES
|
||||
|
||||
find_library(APPKIT_FRAMEWORK AppKit)
|
||||
|
||||
set(APPKIT_LIBRARIES ${APPKIT_FRAMEWORK})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(AppKit DEFAULT_MSG APPKIT_FRAMEWORK)
|
||||
mark_as_advanced(APPKIT_FRAMEWORK)
|
|
@ -0,0 +1,160 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
set_property(CACHE CEF_ROOT_DIR PROPERTY HELPSTRING
|
||||
"Path to CEF distributed build")
|
||||
if(NOT DEFINED CEF_ROOT_DIR OR CEF_ROOT_DIR STREQUAL "")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"CEF_ROOT_DIR is not set - if ENABLE_BROWSER is enabled, a CEF distribution with compiled wrapper library is required.\n"
|
||||
"Please download a CEF distribution for your appropriate architecture and specify CEF_ROOT_DIR to its location"
|
||||
)
|
||||
endif()
|
||||
|
||||
find_path(CEF_INCLUDE_DIR "include/cef_version.h" HINTS "${CEF_ROOT_DIR}")
|
||||
|
||||
if(OS_MACOS)
|
||||
find_library(
|
||||
CEF_LIBRARY
|
||||
NAMES cef libcef cef.lib libcef.o "Chromium Embedded Framework"
|
||||
NO_DEFAULT_PATH
|
||||
PATHS "${CEF_ROOT_DIR}" "${CEF_ROOT_DIR}/Release")
|
||||
|
||||
find_library(
|
||||
CEFWRAPPER_LIBRARY
|
||||
NAMES cef_dll_wrapper libcef_dll_wrapper
|
||||
NO_DEFAULT_PATH
|
||||
PATHS "${CEF_ROOT_DIR}/build/libcef_dll/Release"
|
||||
"${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Release"
|
||||
"${CEF_ROOT_DIR}/build/libcef_dll"
|
||||
"${CEF_ROOT_DIR}/build/libcef_dll_wrapper")
|
||||
|
||||
elseif(OS_POSIX)
|
||||
find_library(
|
||||
CEF_LIBRARY
|
||||
NAMES libcef.so "Chromium Embedded Framework"
|
||||
NO_DEFAULT_PATH
|
||||
PATHS "${CEF_ROOT_DIR}" "${CEF_ROOT_DIR}/Release")
|
||||
|
||||
find_library(
|
||||
CEFWRAPPER_LIBRARY
|
||||
NAMES libcef_dll_wrapper.a
|
||||
NO_DEFAULT_PATH
|
||||
PATHS "${CEF_ROOT_DIR}/build/libcef_dll_wrapper"
|
||||
"${CEF_ROOT_DIR}/libcef_dll_wrapper")
|
||||
|
||||
else()
|
||||
find_library(
|
||||
CEF_LIBRARY
|
||||
NAMES cef libcef cef.lib libcef.o "Chromium Embedded Framework"
|
||||
PATHS "${CEF_ROOT_DIR}" "${CEF_ROOT_DIR}/Release")
|
||||
|
||||
find_library(
|
||||
CEFWRAPPER_LIBRARY
|
||||
NAMES cef_dll_wrapper libcef_dll_wrapper
|
||||
PATHS "${CEF_ROOT_DIR}/build/libcef_dll/Release"
|
||||
"${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Release"
|
||||
"${CEF_ROOT_DIR}/build/libcef_dll"
|
||||
"${CEF_ROOT_DIR}/build/libcef_dll_wrapper")
|
||||
|
||||
if(OS_WINDOWS)
|
||||
find_library(
|
||||
CEFWRAPPER_LIBRARY_DEBUG
|
||||
NAMES cef_dll_wrapper libcef_dll_wrapper
|
||||
PATHS "${CEF_ROOT_DIR}/build/libcef_dll/Debug"
|
||||
"${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Debug")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(CEFWRAPPER_LIBRARY CEFWRAPPER_LIBRARY_DEBUG)
|
||||
|
||||
if(NOT CEF_LIBRARY)
|
||||
message(
|
||||
WARNING
|
||||
" Could NOT find Chromium Embedded Framework library (missing: CEF_LIBRARY)"
|
||||
)
|
||||
set(CEF_FOUND FALSE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT CEFWRAPPER_LIBRARY)
|
||||
message(
|
||||
WARNING
|
||||
" Could NOT find Chromium Embedded Framework wrapper library (missing: CEFWRAPPER_LIBRARY)"
|
||||
)
|
||||
set(CEF_FOUND FALSE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
message(
|
||||
STATUS
|
||||
"Found Chromium Embedded Framework: ${CEF_LIBRARY};${CEF_WRAPPER_LIBRARY}")
|
||||
|
||||
if(OS_WINDOWS)
|
||||
set(CEF_LIBRARIES ${CEF_LIBRARY} ${CEFWRAPPER_LIBRARY})
|
||||
|
||||
elseif(OS_MACOS)
|
||||
if(BROWSER_LEGACY)
|
||||
set(CEF_LIBRARIES ${CEFWRAPPER_LIBRARY} ${CEF_LIBRARY})
|
||||
else()
|
||||
set(CEF_LIBRARIES ${CEFWRAPPER_LIBRARY})
|
||||
endif()
|
||||
else()
|
||||
set(CEF_LIBRARIES ${CEF_LIBRARY} optimized ${CEFWRAPPER_LIBRARY})
|
||||
|
||||
if(CEFWRAPPER_LIBRARY_DEBUG)
|
||||
list(APPEND CEF_LIBRARIES debug ${CEFWRAPPER_LIBRARY_DEBUG})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(CEF DEFAULT_MSG CEF_LIBRARY
|
||||
CEFWRAPPER_LIBRARY CEF_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(CEF_LIBRARY CEF_WRAPPER_LIBRARY CEF_LIBRARIES CEF_INCLUDE_DIR)
|
||||
|
||||
if(NOT TARGET CEF::Wrapper)
|
||||
if(IS_ABSOLUTE "${CEF_LIBRARIES}")
|
||||
add_library(CEF::Wrapper UNKNOWN IMPORTED)
|
||||
add_library(CEF::Library UNKNOWN IMPORTED)
|
||||
|
||||
set_target_properties(CEF::Wrapper PROPERTIES IMPORTED_LOCATION
|
||||
${CEFWRAPPER_LIBRARY})
|
||||
|
||||
set_target_properties(CEF::Library PROPERTIES IMPORTED_LOCATION
|
||||
${CEF_LIBRARY})
|
||||
|
||||
if(DEFINED CEFWRAPPER_LIBRARY_DEBUG)
|
||||
add_library(CEF::Wrapper_Debug UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
CEF::Wrapper_Debug PROPERTIES IMPORTED_LOCATION
|
||||
${CEFWRAPPER_LIBRARY_DEBUG})
|
||||
endif()
|
||||
else()
|
||||
add_library(CEF::Wrapper INTERFACE IMPORTED)
|
||||
add_library(CEF::Library INTERFACE IMPORTED)
|
||||
|
||||
set_target_properties(CEF::Wrapper PROPERTIES IMPORTED_LIBNAME
|
||||
${CEFWRAPPER_LIBRARY})
|
||||
|
||||
set_target_properties(CEF::Library PROPERTIES IMPORTED_LIBNAME
|
||||
${CEF_LIBRARY})
|
||||
|
||||
if(DEFINED CEFWRAPPER_LIBRARY_DEBUG)
|
||||
add_library(CEF::Wrapper_Debug INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
CEF::Wrapper_Debug PROPERTIES IMPORTED_LIBNAME
|
||||
${CEFWRAPPER_LIBRARY_DEBUG})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(CEF::Wrapper PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CEF_INCLUDE_DIR}")
|
||||
|
||||
set_target_properties(CEF::Library PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CEF_INCLUDE_DIR}")
|
||||
|
||||
if(DEFINED CEFWRAPPER_LIBRARY_DEBUG)
|
||||
set_target_properties(
|
||||
CEF::Wrapper_Debug PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CEF_INCLUDE_DIR}")
|
||||
endif()
|
||||
endif()
|
|
@ -1,68 +0,0 @@
|
|||
# - Finds if the compiler has C++11 support
|
||||
# This module can be used to detect compiler flags for using C++11, and checks
|
||||
# a small subset of the language.
|
||||
#
|
||||
# The following variables are set:
|
||||
# CXX11_FLAGS - flags to add to the CXX compiler for C++11 support
|
||||
# CXX11_FOUND - true if the compiler supports C++11
|
||||
#
|
||||
|
||||
if(CXX11_FLAGS)
|
||||
set(CXX11_FOUND TRUE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
if(MSVC)
|
||||
set(CXX11_FLAG_CANDIDATES
|
||||
" "
|
||||
)
|
||||
else()
|
||||
set(CXX11_FLAG_CANDIDATES
|
||||
#gcc
|
||||
"-std=gnu++11"
|
||||
"-std=gnu++0x"
|
||||
#Gnu and Intel Linux
|
||||
"-std=c++11"
|
||||
"-std=c++0x"
|
||||
#Microsoft Visual Studio, and everything that automatically accepts C++11
|
||||
" "
|
||||
#Intel windows
|
||||
"/Qstd=c++11"
|
||||
"/Qstd=c++0x"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(CXX11_TEST_SOURCE
|
||||
"
|
||||
int main()
|
||||
{
|
||||
int n[] = {4,7,6,1,2};
|
||||
int r;
|
||||
auto f = [&](int j) { r = j; };
|
||||
|
||||
for (auto i : n)
|
||||
f(i);
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
foreach(FLAG ${CXX11_FLAG_CANDIDATES})
|
||||
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
|
||||
unset(CXX11_FLAG_DETECTED CACHE)
|
||||
message(STATUS "Try C++11 flag = [${FLAG}]")
|
||||
check_cxx_source_compiles("${CXX11_TEST_SOURCE}" CXX11_FLAG_DETECTED)
|
||||
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
|
||||
if(CXX11_FLAG_DETECTED)
|
||||
set(CXX11_FLAGS_INTERNAL "${FLAG}")
|
||||
break()
|
||||
endif(CXX11_FLAG_DETECTED)
|
||||
endforeach(FLAG ${CXX11_FLAG_CANDIDATES})
|
||||
|
||||
set(CXX11_FLAGS "${CXX11_FLAGS_INTERNAL}" CACHE STRING "C++11 Flags")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX11_FLAGS)
|
||||
mark_as_advanced(CXX11_FLAGS)
|
|
@ -1,68 +1,75 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# DETOURS_FOUND
|
||||
# DETOURS_INCLUDE_DIRS
|
||||
# DETOURS_LIBRARIES
|
||||
# * DETOURS_FOUND
|
||||
# * DETOURS_INCLUDE_DIRS
|
||||
# * DETOURS_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# DETOURS_INCLUDE_DIR
|
||||
# DETOURS_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_DETOURS QUIET detours)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_DETOURS QUIET detours)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(DETOURS_INCLUDE_DIR
|
||||
NAMES detours.h
|
||||
HINTS
|
||||
ENV detoursPath${_lib_suffix}
|
||||
ENV detoursPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${detoursPath${_lib_suffix}}
|
||||
${detoursPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_DETOURS_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
find_path(
|
||||
DETOURS_INCLUDE_DIR
|
||||
NAMES detours.h
|
||||
HINTS ENV DETOURS_PATH ${DETOURS_PATH} ${CMAKE_SOURCE_DIR}/${DETOURS_PATH}
|
||||
${_DETOURS_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(DETOURS_LIB
|
||||
NAMES ${_DETOURS_LIBRARIES} detours
|
||||
HINTS
|
||||
ENV detoursPath${_lib_suffix}
|
||||
ENV detoursPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${detoursPath${_lib_suffix}}
|
||||
${detoursPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_DETOURS_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
DETOURS_LIB
|
||||
NAMES ${_DETOURS_LIBRARIES} detours
|
||||
HINTS ENV DETOURS_PATH ${DETOURS_PATH} ${CMAKE_SOURCE_DIR}/${DETOURS_PATH}
|
||||
${_DETOURS_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Detours DEFAULT_MSG DETOURS_LIB DETOURS_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(Detours DEFAULT_MSG DETOURS_LIB
|
||||
DETOURS_INCLUDE_DIR)
|
||||
mark_as_advanced(DETOURS_INCLUDE_DIR DETOURS_LIB)
|
||||
|
||||
if(DETOURS_FOUND)
|
||||
set(DETOURS_INCLUDE_DIRS ${DETOURS_INCLUDE_DIR})
|
||||
set(DETOURS_LIBRARIES ${DETOURS_LIB})
|
||||
set(DETOURS_INCLUDE_DIRS ${DETOURS_INCLUDE_DIR})
|
||||
set(DETOURS_LIBRARIES ${DETOURS_LIB})
|
||||
|
||||
if(NOT TARGET Detours::Detours)
|
||||
if(IS_ABSOLUTE "${DETOURS_LIBRARIES}")
|
||||
add_library(Detours::Detours UNKNOWN IMPORTED)
|
||||
set_target_properties(Detours::Detours PROPERTIES IMPORTED_LOCATION
|
||||
"${DETOURS_LIBRARIES}")
|
||||
else()
|
||||
add_library(Detours::Detours INTERFACE IMPORTED)
|
||||
set_target_properties(Detours::Detours PROPERTIES IMPORTED_LIBNAME
|
||||
"${DETOURS_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
Detours::Detours PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${DETOURS_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
# - Try to Find EGL
|
||||
# Once done, this will define
|
||||
#
|
||||
# EGL_FOUND - system has EGL installed.
|
||||
# EGL_INCLUDE_DIRS - directories which contain the EGL headers.
|
||||
# EGL_LIBRARIES - libraries required to link against EGL.
|
||||
# EGL_DEFINITIONS - Compiler switches required for using EGL.
|
||||
#
|
||||
# Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
# 2020 Georges Basile Stavracas Neto
|
||||
#
|
||||
# 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 above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``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 COPYRIGHT HOLDER OR ITS
|
||||
# CONTRIBUTORS 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.
|
||||
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(PC_EGL egl)
|
||||
|
||||
if (PC_EGL_FOUND)
|
||||
set(EGL_DEFINITIONS ${PC_EGL_CFLAGS_OTHER})
|
||||
endif ()
|
||||
|
||||
find_path(EGL_INCLUDE_DIRS NAMES EGL/egl.h
|
||||
HINTS ${PC_EGL_INCLUDE_DIR} ${PC_EGL_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(EGL_LIBRARIES NAMES egl EGL
|
||||
HINTS ${PC_EGL_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL DEFAULT_MSG EGL_INCLUDE_DIRS EGL_LIBRARIES)
|
||||
|
||||
mark_as_advanced(EGL_INCLUDE_DIRS EGL_LIBRARIES)
|
|
@ -1,155 +1,200 @@
|
|||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# FFMPEG_FOUND - All required components and the core library were found
|
||||
# FFMPEG_INCLUDE_DIRS - Combined list of all components include dirs
|
||||
# FFMPEG_LIBRARIES - Combined list of all components libraries
|
||||
# FFMPEG_VERSION_STRING - Version of the first component requested
|
||||
# FFMPEG_FOUND - All required components and the core library were found
|
||||
# FFMPEG_INCLUDE_DIRS - Combined list of all components include dirs
|
||||
# FFMPEG_LIBRARIES - Combined list of all components libraries
|
||||
# FFMPEG_VERSION_STRING - Version of the first component requested
|
||||
#
|
||||
# For each requested component the following variables are defined:
|
||||
#
|
||||
# FFMPEG_<component>_FOUND - The component was found
|
||||
# FFMPEG_<component>_INCLUDE_DIRS - The components include dirs
|
||||
# FFMPEG_<component>_LIBRARIES - The components libraries
|
||||
# FFMPEG_<component>_VERSION_STRING - The components version string
|
||||
# FFMPEG_<component>_VERSION_MAJOR - The components major version
|
||||
# FFMPEG_<component>_VERSION_MINOR - The components minor version
|
||||
# FFMPEG_<component>_VERSION_MICRO - The components micro version
|
||||
# FFMPEG_<component>_FOUND - The component was found
|
||||
# FFMPEG_<component>_INCLUDE_DIRS - The components include dirs
|
||||
# FFMPEG_<component>_LIBRARIES - The components libraries
|
||||
# FFMPEG_<component>_VERSION_STRING - The components version string
|
||||
# FFMPEG_<component>_VERSION_MAJOR - The components major version
|
||||
# FFMPEG_<component>_VERSION_MINOR - The components minor version
|
||||
# FFMPEG_<component>_VERSION_MICRO - The components micro version
|
||||
#
|
||||
# <component> is the uppercase name of the component
|
||||
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
function(find_ffmpeg_library component header)
|
||||
string(TOUPPER "${component}" component_u)
|
||||
set(FFMPEG_${component_u}_FOUND FALSE PARENT_SCOPE)
|
||||
set(FFmpeg_${component}_FOUND FALSE PARENT_SCOPE)
|
||||
string(TOUPPER "${component}" component_u)
|
||||
set(FFMPEG_${component_u}_FOUND
|
||||
FALSE
|
||||
PARENT_SCOPE)
|
||||
set(FFmpeg_${component}_FOUND
|
||||
FALSE
|
||||
PARENT_SCOPE)
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_FFMPEG_${component} QUIET lib${component})
|
||||
endif()
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_FFMPEG_${component} QUIET lib${component})
|
||||
endif()
|
||||
|
||||
find_path(FFMPEG_${component}_INCLUDE_DIR
|
||||
NAMES
|
||||
"lib${component}/${header}" "lib${component}/version.h"
|
||||
HINTS
|
||||
ENV FFmpegPath${_lib_suffix}
|
||||
ENV FFmpegPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${FFmpegPath${_lib_suffix}}
|
||||
${FFmpegPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${PC_FFMPEG_${component}_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES ffmpeg libav include)
|
||||
find_path(
|
||||
FFMPEG_${component}_INCLUDE_DIR
|
||||
NAMES "lib${component}/${header}" "lib${component}/version.h"
|
||||
HINTS ENV FFMPEG_PATH ${FFMPEG_PATH} ${CMAKE_SOURCE_DIR}/${FFMPEG_PATH}
|
||||
${PC_FFMPEG_${component}_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES ffmpeg libav include)
|
||||
|
||||
find_library(FFMPEG_${component}_LIBRARY
|
||||
NAMES
|
||||
"${component}" "lib${component}"
|
||||
HINTS
|
||||
ENV FFmpegPath${_lib_suffix}
|
||||
ENV FFmpegPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${FFmpegPath${_lib_suffix}}
|
||||
${FFmpegPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${PC_FFMPEG_${component}_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
FFMPEG_${component}_LIBRARY
|
||||
NAMES "${component}" "lib${component}"
|
||||
HINTS ENV FFMPEG_PATH ${FFMPEG_PATH} ${CMAKE_SOURCE_DIR}/${FFMPEG_PATH}
|
||||
${PC_FFMPEG_${component}_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
set(FFMPEG_${component_u}_INCLUDE_DIRS ${FFMPEG_${component}_INCLUDE_DIR} PARENT_SCOPE)
|
||||
set(FFMPEG_${component_u}_LIBRARIES ${FFMPEG_${component}_LIBRARY} PARENT_SCOPE)
|
||||
set(FFMPEG_${component_u}_INCLUDE_DIRS
|
||||
${FFMPEG_${component}_INCLUDE_DIR}
|
||||
PARENT_SCOPE)
|
||||
set(FFMPEG_${component_u}_LIBRARIES
|
||||
${FFMPEG_${component}_LIBRARY}
|
||||
PARENT_SCOPE)
|
||||
|
||||
mark_as_advanced(FFMPEG_${component}_INCLUDE_DIR FFMPEG_${component}_LIBRARY)
|
||||
mark_as_advanced(FFMPEG_${component}_INCLUDE_DIR FFMPEG_${component}_LIBRARY)
|
||||
|
||||
if(FFMPEG_${component}_INCLUDE_DIR AND FFMPEG_${component}_LIBRARY)
|
||||
set(FFMPEG_${component_u}_FOUND TRUE PARENT_SCOPE)
|
||||
set(FFmpeg_${component}_FOUND TRUE PARENT_SCOPE)
|
||||
if(FFMPEG_${component}_INCLUDE_DIR AND FFMPEG_${component}_LIBRARY)
|
||||
set(FFMPEG_${component_u}_FOUND
|
||||
TRUE
|
||||
PARENT_SCOPE)
|
||||
set(FFmpeg_${component}_FOUND
|
||||
TRUE
|
||||
PARENT_SCOPE)
|
||||
|
||||
list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_${component}_INCLUDE_DIR})
|
||||
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
|
||||
set(FFMPEG_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIRS}" PARENT_SCOPE)
|
||||
list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_${component}_INCLUDE_DIR})
|
||||
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
|
||||
set(FFMPEG_INCLUDE_DIRS
|
||||
"${FFMPEG_INCLUDE_DIRS}"
|
||||
PARENT_SCOPE)
|
||||
|
||||
list(APPEND FFMPEG_LIBRARIES ${FFMPEG_${component}_LIBRARY})
|
||||
list(REMOVE_DUPLICATES FFMPEG_LIBRARIES)
|
||||
set(FFMPEG_LIBRARIES "${FFMPEG_LIBRARIES}" PARENT_SCOPE)
|
||||
list(APPEND FFMPEG_LIBRARIES ${FFMPEG_${component}_LIBRARY})
|
||||
list(REMOVE_DUPLICATES FFMPEG_LIBRARIES)
|
||||
set(FFMPEG_LIBRARIES
|
||||
"${FFMPEG_LIBRARIES}"
|
||||
PARENT_SCOPE)
|
||||
|
||||
set(FFMPEG_${component_u}_VERSION_STRING "unknown" PARENT_SCOPE)
|
||||
set(_vfile "${FFMPEG_${component}_INCLUDE_DIR}/lib${component}/version.h")
|
||||
set(FFMPEG_${component_u}_VERSION_STRING
|
||||
"unknown"
|
||||
PARENT_SCOPE)
|
||||
set(_vfile "${FFMPEG_${component}_INCLUDE_DIR}/lib${component}/version.h")
|
||||
|
||||
if(EXISTS "${_vfile}")
|
||||
file(STRINGS "${_vfile}" _version_parse REGEX "^.*VERSION_(MAJOR|MINOR|MICRO)[ \t]+[0-9]+[ \t]*$")
|
||||
string(REGEX REPLACE ".*VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" _major "${_version_parse}")
|
||||
string(REGEX REPLACE ".*VERSION_MINOR[ \t]+([0-9]+).*" "\\1" _minor "${_version_parse}")
|
||||
string(REGEX REPLACE ".*VERSION_MICRO[ \t]+([0-9]+).*" "\\1" _micro "${_version_parse}")
|
||||
if(EXISTS "${_vfile}")
|
||||
file(STRINGS "${_vfile}" _version_parse
|
||||
REGEX "^.*VERSION_(MAJOR|MINOR|MICRO)[ \t]+[0-9]+[ \t]*$")
|
||||
string(REGEX REPLACE ".*VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" _major
|
||||
"${_version_parse}")
|
||||
string(REGEX REPLACE ".*VERSION_MINOR[ \t]+([0-9]+).*" "\\1" _minor
|
||||
"${_version_parse}")
|
||||
string(REGEX REPLACE ".*VERSION_MICRO[ \t]+([0-9]+).*" "\\1" _micro
|
||||
"${_version_parse}")
|
||||
|
||||
set(FFMPEG_${component_u}_VERSION_MAJOR "${_major}" PARENT_SCOPE)
|
||||
set(FFMPEG_${component_u}_VERSION_MINOR "${_minor}" PARENT_SCOPE)
|
||||
set(FFMPEG_${component_u}_VERSION_MICRO "${_micro}" PARENT_SCOPE)
|
||||
set(FFMPEG_${component_u}_VERSION_MAJOR
|
||||
"${_major}"
|
||||
PARENT_SCOPE)
|
||||
set(FFMPEG_${component_u}_VERSION_MINOR
|
||||
"${_minor}"
|
||||
PARENT_SCOPE)
|
||||
set(FFMPEG_${component_u}_VERSION_MICRO
|
||||
"${_micro}"
|
||||
PARENT_SCOPE)
|
||||
|
||||
set(FFMPEG_${component_u}_VERSION_STRING "${_major}.${_minor}.${_micro}" PARENT_SCOPE)
|
||||
else()
|
||||
message(STATUS "Failed parsing FFmpeg ${component} version")
|
||||
endif()
|
||||
endif()
|
||||
set(FFMPEG_${component_u}_VERSION_STRING
|
||||
"${_major}.${_minor}.${_micro}"
|
||||
PARENT_SCOPE)
|
||||
else()
|
||||
message(STATUS "Failed parsing FFmpeg ${component} version")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
set(FFMPEG_INCLUDE_DIRS)
|
||||
set(FFMPEG_LIBRARIES)
|
||||
|
||||
if(NOT FFmpeg_FIND_COMPONENTS)
|
||||
message(FATAL_ERROR "No FFmpeg components requested")
|
||||
message(FATAL_ERROR "No FFmpeg components requested")
|
||||
endif()
|
||||
|
||||
list(GET FFmpeg_FIND_COMPONENTS 0 _first_comp)
|
||||
string(TOUPPER "${_first_comp}" _first_comp)
|
||||
|
||||
foreach(component ${FFmpeg_FIND_COMPONENTS})
|
||||
if(component STREQUAL "avcodec")
|
||||
find_ffmpeg_library("${component}" "avcodec.h")
|
||||
elseif(component STREQUAL "avdevice")
|
||||
find_ffmpeg_library("${component}" "avdevice.h")
|
||||
elseif(component STREQUAL "avfilter")
|
||||
find_ffmpeg_library("${component}" "avfilter.h")
|
||||
elseif(component STREQUAL "avformat")
|
||||
find_ffmpeg_library("${component}" "avformat.h")
|
||||
elseif(component STREQUAL "avresample")
|
||||
find_ffmpeg_library("${component}" "avresample.h")
|
||||
elseif(component STREQUAL "avutil")
|
||||
find_ffmpeg_library("${component}" "avutil.h")
|
||||
elseif(component STREQUAL "postproc")
|
||||
find_ffmpeg_library("${component}" "postprocess.h")
|
||||
elseif(component STREQUAL "swresample")
|
||||
find_ffmpeg_library("${component}" "swresample.h")
|
||||
elseif(component STREQUAL "swscale")
|
||||
find_ffmpeg_library("${component}" "swscale.h")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown FFmpeg component requested: ${component}")
|
||||
endif()
|
||||
if(component STREQUAL "avcodec")
|
||||
find_ffmpeg_library("${component}" "avcodec.h")
|
||||
elseif(component STREQUAL "avdevice")
|
||||
find_ffmpeg_library("${component}" "avdevice.h")
|
||||
elseif(component STREQUAL "avfilter")
|
||||
find_ffmpeg_library("${component}" "avfilter.h")
|
||||
elseif(component STREQUAL "avformat")
|
||||
find_ffmpeg_library("${component}" "avformat.h")
|
||||
elseif(component STREQUAL "avresample")
|
||||
find_ffmpeg_library("${component}" "avresample.h")
|
||||
elseif(component STREQUAL "avutil")
|
||||
find_ffmpeg_library("${component}" "avutil.h")
|
||||
elseif(component STREQUAL "postproc")
|
||||
find_ffmpeg_library("${component}" "postprocess.h")
|
||||
elseif(component STREQUAL "swresample")
|
||||
find_ffmpeg_library("${component}" "swresample.h")
|
||||
elseif(component STREQUAL "swscale")
|
||||
find_ffmpeg_library("${component}" "swscale.h")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown FFmpeg component requested: ${component}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(FFmpeg
|
||||
FOUND_VAR FFMPEG_FOUND
|
||||
REQUIRED_VARS FFMPEG_${_first_comp}_LIBRARIES FFMPEG_${_first_comp}_INCLUDE_DIRS
|
||||
VERSION_VAR FFMPEG_${_first_comp}_VERSION_STRING
|
||||
HANDLE_COMPONENTS)
|
||||
find_package_handle_standard_args(
|
||||
FFmpeg
|
||||
FOUND_VAR FFMPEG_FOUND
|
||||
REQUIRED_VARS FFMPEG_${_first_comp}_LIBRARIES
|
||||
FFMPEG_${_first_comp}_INCLUDE_DIRS
|
||||
VERSION_VAR FFMPEG_${_first_comp}_VERSION_STRING
|
||||
HANDLE_COMPONENTS)
|
||||
|
||||
if(FFMPEG_FOUND)
|
||||
foreach(component ${FFmpeg_FIND_COMPONENTS})
|
||||
if(NOT TARGET FFmpeg::${component})
|
||||
string(TOUPPER ${component} component_u)
|
||||
if(FFMPEG_${component_u}_FOUND)
|
||||
if(IS_ABSOLUTE "${FFMPEG_${component_u}_LIBRARIES}")
|
||||
add_library(FFmpeg::${component} UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
FFmpeg::${component}
|
||||
PROPERTIES IMPORTED_LOCATION "${FFMPEG_${component_u}_LIBRARIES}")
|
||||
else()
|
||||
add_library(FFmpeg::${component} INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
FFmpeg::${component}
|
||||
PROPERTIES IMPORTED_LIBNAME "${FFMPEG_${component_u}_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
FFmpeg::${component}
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${FFMPEG_${component_u}_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# FONTCONFIG_FOUND
|
||||
# FONTCONFIG_INCLUDE_DIRS
|
||||
# FONTCONFIG_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_FONTCONFIG QUIET fontconfig)
|
||||
endif()
|
||||
|
||||
find_path(FONTCONFIG_INCLUDE_DIR
|
||||
NAMES fontconfig/fontconfig.h
|
||||
HINTS
|
||||
${_FONTCONFIG_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include)
|
||||
|
||||
find_library(FONTCONFIG_LIB
|
||||
NAMES fontconfig
|
||||
HINTS
|
||||
${_FONTCONFIG_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Fontconfig DEFAULT_MSG FONTCONFIG_LIB
|
||||
FONTCONFIG_INCLUDE_DIR)
|
||||
mark_as_advanced(FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIB)
|
||||
|
||||
if(FONTCONFIG_FOUND)
|
||||
set(FONTCONFIG_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR})
|
||||
set(FONTCONFIG_LIBRARIES "${FONTCONFIG_LIB}")
|
||||
endif()
|
|
@ -1,94 +0,0 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# FREETYPE_FOUND
|
||||
# FREETYPE_INCLUDE_DIRS
|
||||
# FREETYPE_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_FREETYPE QUIET freetype2)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(FREETYPE_INCLUDE_DIR_ft2build
|
||||
NAMES
|
||||
ft2build.h
|
||||
HINTS
|
||||
ENV FreetypePath${_lib_suffix}
|
||||
ENV FreetypePath
|
||||
ENV FREETYPE_DIR
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${FreetypePath${_lib_suffix}}
|
||||
${FreetypePath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_FREETYPE_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
freetype2 include/freetype2 include)
|
||||
|
||||
find_path(FREETYPE_INCLUDE_DIR_freetype2
|
||||
NAMES
|
||||
freetype/config/ftheader.h
|
||||
config/ftheader.h
|
||||
HINTS
|
||||
ENV FreetypePath${_lib_suffix}
|
||||
ENV FreetypePath
|
||||
ENV FREETYPE_DIR
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${FreetypePath${_lib_suffix}}
|
||||
${FreetypePath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_FREETYPE_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
freetype2 include/freetype2 include)
|
||||
|
||||
find_library(FREETYPE_LIB
|
||||
NAMES ${_FREETYPE_LIBRARIES} freetype libfreetype
|
||||
HINTS
|
||||
ENV FreetypePath${_lib_suffix}
|
||||
ENV FreetypePath
|
||||
ENV FREETYPE_DIR
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${FreetypePath${_lib_suffix}}
|
||||
${FreetypePath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_FREETYPE_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
|
||||
if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
|
||||
set(FREETYPE_INCLUDE_DIR "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
|
||||
list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIR)
|
||||
else()
|
||||
unset(FREETYPE_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Freetype DEFAULT_MSG FREETYPE_LIB FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
|
||||
mark_as_advanced(FREETYPE_INCLUDE_DIR FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_LIB)
|
||||
|
||||
if(FREETYPE_FOUND)
|
||||
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
|
||||
set(FREETYPE_LIBRARIES ${FREETYPE_LIB})
|
||||
endif()
|
|
@ -1,27 +1,53 @@
|
|||
# - Try to find Gio
|
||||
# Once done this will define
|
||||
# * Try to find Gio Once done this will define
|
||||
#
|
||||
# GIO_FOUND - system has Gio
|
||||
# GIO_INCLUDE_DIRS - the Gio include directory
|
||||
# GIO_LIBRARIES - the libraries needed to use Gio
|
||||
# GIO_DEFINITIONS - Compiler switches required for using Gio
|
||||
# GIO_FOUND - system has Gio GIO_INCLUDE_DIRS - the Gio include directory
|
||||
# GIO_LIBRARIES - the libraries needed to use Gio GIO_DEFINITIONS - Compiler
|
||||
# switches required for using Gio
|
||||
|
||||
# Use pkg-config to get the directories and then use these values
|
||||
# in the find_path() and find_library() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_GIO gio-2.0 gio-unix-2.0)
|
||||
# Use pkg-config to get the directories and then use these values in the
|
||||
# find_path() and find_library() calls
|
||||
|
||||
set(GIO_DEFINITIONS ${PC_GIO_CFLAGS})
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_GIO gio-2.0 gio-unix-2.0)
|
||||
endif()
|
||||
|
||||
find_path(GIO_INCLUDE_DIRS gio.h PATHS ${PC_GIO_INCLUDEDIR} ${PC_GIO_INCLUDE_DIRS} PATH_SUFFIXES glib-2.0/gio/)
|
||||
find_library(GIO_LIBRARIES NAMES gio-2.0 libgio-2.0 gio-unix-2.0 PATHS ${PC_GIO_LIBDIR} ${PC_GIO_LIBRARY_DIRS})
|
||||
mark_as_advanced(GIO_INCLUDE_DIRS GIO_LIBRARIES)
|
||||
find_path(
|
||||
GIO_INCLUDE_DIR
|
||||
NAMES gio.h
|
||||
HINTS ${_GIO_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES glib-2.0/gio/)
|
||||
|
||||
find_library(
|
||||
GIO_LIB
|
||||
NAMES ${_GIO_LIBRARIES} gio-2.0 libgio-2.0 gio-unix-2.0
|
||||
HINTS ${_GIO_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Gio REQUIRED_VARS GIO_LIBRARIES GIO_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(Gio REQUIRED_VARS GIO_LIB GIO_INCLUDE_DIR)
|
||||
mark_as_advanced(GIO_INCLUDE_DIR GIO_LIB)
|
||||
|
||||
if(GIO_FOUND)
|
||||
set(HAVE_DBUS "1")
|
||||
else()
|
||||
set(HAVE_DBUS "0")
|
||||
set(GIO_INCLUDE_DIRS ${GIO_INCLUDE_DIR})
|
||||
set(GIO_LIBRARIES ${GIO_LIB})
|
||||
|
||||
if(NOT TARGET GIO::GIO)
|
||||
if(IS_ABSOLUTE "${GIO_LIBRARIES}")
|
||||
add_library(GIO::GIO UNKNOWN IMPORTED)
|
||||
set_target_properties(GIO::GIO PROPERTIES IMPORTED_LOCATION
|
||||
"${GIO_LIBRARIES}")
|
||||
else()
|
||||
add_library(GIO::GIO INTERFACE IMPORTED)
|
||||
set_target_properties(GIO::GIO PROPERTIES IMPORTED_LIBNAME
|
||||
"${GIO_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
# Special case for gio, as both the
|
||||
set_target_properties(GIO::GIO PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${_GIO_INCLUDE_DIRS}")
|
||||
|
||||
target_compile_options(GIO::GIO INTERFACE ${_GIO_CFLAGS})
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# ICONV_FOUND
|
||||
# ICONV_INCLUDE_DIRS
|
||||
# ICONV_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_ICONV QUIET iconv)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(ICONV_INCLUDE_DIR
|
||||
NAMES iconv.h
|
||||
HINTS
|
||||
ENV IconvPath${_lib_suffix}
|
||||
ENV IconvPath
|
||||
${_ICONV_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include)
|
||||
|
||||
find_library(ICONV_LIB
|
||||
NAMES ${_ICONV_LIBRARIES} iconv libiconv
|
||||
HINTS
|
||||
${_ICONV_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Iconv DEFAULT_MSG ICONV_LIB ICONV_INCLUDE_DIR)
|
||||
mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIB)
|
||||
|
||||
if(ICONV_FOUND)
|
||||
set(ICONV_INCLUDE_DIRS ${ICONV_INCLUDE_DIR})
|
||||
set(ICONV_LIBRARIES ${ICONV_LIB})
|
||||
endif()
|
|
@ -1,82 +1,78 @@
|
|||
# - Try to find jack-2.6
|
||||
# Once done this will define
|
||||
# * Try to find jack-2.6 Once done this will define
|
||||
#
|
||||
# JACK_FOUND - system has jack
|
||||
# JACK_INCLUDE_DIRS - the jack include directory
|
||||
# JACK_LIBRARIES - Link these to use jack
|
||||
# JACK_DEFINITIONS - Compiler switches required for using jack
|
||||
# JACK_FOUND - system has jack JACK_INCLUDE_DIRS - the jack include directory
|
||||
# JACK_LIBRARIES - Link these to use jack JACK_DEFINITIONS - Compiler switches
|
||||
# required for using jack
|
||||
#
|
||||
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
|
||||
# Modified for other libraries by Lasse Kärkkäinen <tronic>
|
||||
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org> Modified for other
|
||||
# libraries by Lasse Kärkkäinen <tronic>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
# Redistribution and use is allowed according to the terms of the New BSD
|
||||
# license. For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
if (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
|
||||
if(JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(JACK_FOUND TRUE)
|
||||
else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
else(JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
|
||||
# use pkg-config to get the directories and then use these values in the
|
||||
# FIND_PATH() and FIND_LIBRARY() calls
|
||||
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
include(UsePkgConfig)
|
||||
pkgconfig(jack _JACK_INCLUDEDIR _JACK_LIBDIR _JACK_LDFLAGS _JACK_CFLAGS)
|
||||
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
else(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_JACK jack)
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
find_path(JACK_INCLUDE_DIR
|
||||
NAMES
|
||||
jack/jack.h
|
||||
PATHS
|
||||
${_JACK_INCLUDE_DIRS}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
)
|
||||
endif(PKG_CONFIG_FOUND)
|
||||
endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
find_path(
|
||||
JACK_INCLUDE_DIR
|
||||
NAMES jack/jack.h
|
||||
PATHS ${_JACK_INCLUDE_DIRS} /usr/include /usr/local/include
|
||||
/opt/local/include /sw/include)
|
||||
|
||||
find_library(JACK_LIBRARY
|
||||
NAMES
|
||||
jack
|
||||
PATHS
|
||||
${_JACK_LIBRARY_DIRS}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
find_library(
|
||||
JACK_LIBRARY
|
||||
NAMES jack
|
||||
PATHS ${_JACK_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib)
|
||||
|
||||
if (JACK_LIBRARY AND JACK_INCLUDE_DIR)
|
||||
if(JACK_LIBRARY AND JACK_INCLUDE_DIR)
|
||||
set(JACK_FOUND TRUE)
|
||||
|
||||
set(JACK_INCLUDE_DIRS
|
||||
${JACK_INCLUDE_DIR}
|
||||
)
|
||||
set(JACK_INCLUDE_DIRS ${JACK_INCLUDE_DIR})
|
||||
|
||||
set(JACK_LIBRARIES
|
||||
${JACK_LIBRARIES}
|
||||
${JACK_LIBRARY}
|
||||
)
|
||||
set(JACK_LIBRARIES ${JACK_LIBRARIES} ${JACK_LIBRARY})
|
||||
|
||||
endif (JACK_LIBRARY AND JACK_INCLUDE_DIR)
|
||||
endif(JACK_LIBRARY AND JACK_INCLUDE_DIR)
|
||||
|
||||
if (JACK_FOUND)
|
||||
if (NOT JACK_FIND_QUIETLY)
|
||||
if(JACK_FOUND)
|
||||
if(NOT JACK_FIND_QUIETLY)
|
||||
message(STATUS "Found jack: ${JACK_LIBRARY}")
|
||||
endif (NOT JACK_FIND_QUIETLY)
|
||||
else (JACK_FOUND)
|
||||
if (JACK_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find JACK")
|
||||
endif (JACK_FIND_REQUIRED)
|
||||
endif (JACK_FOUND)
|
||||
endif(NOT JACK_FIND_QUIETLY)
|
||||
|
||||
# show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced view
|
||||
if(NOT TARGET Jack::Jack)
|
||||
if(IS_ABSOLUTE "${JACK_LIBRARIES}")
|
||||
add_library(Jack::Jack UNKNOWN IMPORTED)
|
||||
set_target_properties(Jack::Jack PROPERTIES IMPORTED_LOCATION
|
||||
"${JACK_LIBRARIES}")
|
||||
else()
|
||||
add_library(Jack::Jack INTERFACE IMPORTED)
|
||||
set_target_properties(Jack::Jack PROPERTIES IMPORTED_LIBNAME
|
||||
"${JACK_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(Jack::Jack PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${JACK_INCLUDE_DIRS}")
|
||||
endif()
|
||||
else(JACK_FOUND)
|
||||
if(JACK_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find JACK")
|
||||
endif(JACK_FIND_REQUIRED)
|
||||
endif(JACK_FOUND)
|
||||
|
||||
# show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced
|
||||
# view
|
||||
mark_as_advanced(JACK_INCLUDE_DIRS JACK_LIBRARIES)
|
||||
|
||||
endif (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
|
||||
|
||||
endif(JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
|
||||
|
|
|
@ -1,84 +1,87 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# JANSSON_FOUND
|
||||
# JANSSON_INCLUDE_DIRS
|
||||
# JANSSON_LIBRARIES
|
||||
# JANSSON_VERSION
|
||||
# JANSSON_FOUND JANSSON_INCLUDE_DIRS JANSSON_LIBRARIES JANSSON_VERSION
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_JANSSON QUIET jansson)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_JANSSON QUIET jansson)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(Jansson_INCLUDE_DIR
|
||||
NAMES jansson.h
|
||||
HINTS
|
||||
ENV JanssonPath${_lib_suffix}
|
||||
ENV JanssonPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${JanssonPath${_lib_suffix}}
|
||||
${JanssonPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_JANSSON_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include)
|
||||
find_path(
|
||||
Jansson_INCLUDE_DIR
|
||||
NAMES jansson.h
|
||||
HINTS ENV JANSSON_PATH ${JANSSON_PATH} ${CMAKE_SOURCE_DIR}/${JANSSON_PATH}
|
||||
${_JANSSON_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include)
|
||||
|
||||
find_library(Jansson_LIB
|
||||
NAMES ${_JANSSON_LIBRARIES} jansson libjansson
|
||||
HINTS
|
||||
ENV JanssonPath${_lib_suffix}
|
||||
ENV JanssonPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${JanssonPath${_lib_suffix}}
|
||||
${JanssonPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_JANSSON_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
Jansson_LIB
|
||||
NAMES ${_JANSSON_LIBRARIES} jansson libjansson
|
||||
HINTS ENV JANSSON_PATH ${JANSSON_PATH} ${CMAKE_SOURCE_DIR}/${JANSSON_PATH}
|
||||
${_JANSSON_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
if(JANSSON_VERSION)
|
||||
set(_JANSSON_VERSION_STRING "${JANSSON_VERSION}")
|
||||
set(_JANSSON_VERSION_STRING "${JANSSON_VERSION}")
|
||||
elseif(_JANSSON_FOUND AND _JANSSON_VERSION)
|
||||
set(_JANSSON_VERSION_STRING "${_JANSSON_VERSION}")
|
||||
set(_JANSSON_VERSION_STRING "${_JANSSON_VERSION}")
|
||||
elseif(EXISTS "${Jansson_INCLUDE_DIR}/jansson.h")
|
||||
file(STRINGS "${Jansson_INCLUDE_DIR}/jansson.h" _jansson_version_parse
|
||||
REGEX "#define[ \t]+JANSSON_VERSION[ \t]+.+")
|
||||
string(REGEX REPLACE
|
||||
".*#define[ \t]+JANSSON_VERSION[ \t]+\"(.+)\".*" "\\1"
|
||||
_JANSSON_VERSION_STRING "${_jansson_version_parse}")
|
||||
file(STRINGS "${Jansson_INCLUDE_DIR}/jansson.h" _jansson_version_parse
|
||||
REGEX "#define[ \t]+JANSSON_VERSION[ \t]+.+")
|
||||
string(REGEX REPLACE ".*#define[ \t]+JANSSON_VERSION[ \t]+\"(.+)\".*" "\\1"
|
||||
_JANSSON_VERSION_STRING "${_jansson_version_parse}")
|
||||
else()
|
||||
if(NOT Jansson_FIND_QUIETLY)
|
||||
message(WARNING "Failed to find Jansson version")
|
||||
endif()
|
||||
set(_JANSSON_VERSION_STRING "unknown")
|
||||
if(NOT Jansson_FIND_QUIETLY)
|
||||
message(WARNING "Failed to find Jansson version")
|
||||
endif()
|
||||
set(_JANSSON_VERSION_STRING "unknown")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Jansson
|
||||
FOUND_VAR JANSSON_FOUND
|
||||
REQUIRED_VARS Jansson_LIB Jansson_INCLUDE_DIR
|
||||
VERSION_VAR _JANSSON_VERSION_STRING)
|
||||
find_package_handle_standard_args(
|
||||
Jansson
|
||||
FOUND_VAR JANSSON_FOUND
|
||||
REQUIRED_VARS Jansson_LIB Jansson_INCLUDE_DIR
|
||||
VERSION_VAR _JANSSON_VERSION_STRING)
|
||||
mark_as_advanced(Jansson_INCLUDE_DIR Jansson_LIB)
|
||||
|
||||
if(JANSSON_FOUND)
|
||||
set(JANSSON_INCLUDE_DIRS ${Jansson_INCLUDE_DIR})
|
||||
set(JANSSON_LIBRARIES ${Jansson_LIB})
|
||||
set(JANSSON_VERSION ${_JANSSON_VERSION_STRING})
|
||||
set(JANSSON_INCLUDE_DIRS ${Jansson_INCLUDE_DIR})
|
||||
set(JANSSON_LIBRARIES ${Jansson_LIB})
|
||||
set(JANSSON_VERSION ${_JANSSON_VERSION_STRING})
|
||||
|
||||
if(NOT TARGET Jansson::Jansson)
|
||||
if(IS_ABSOLUTE "${JANSSON_LIBRARIES}")
|
||||
add_library(Jansson::Jansson UNKNOWN IMPORTED GLOBAL)
|
||||
set_target_properties(Jansson::Jansson PROPERTIES IMPORTED_LOCATION
|
||||
"${JANSSON_LIBRARIES}")
|
||||
else()
|
||||
add_library(Jansson::Jansson INTERFACE IMPORTED GLOBAL)
|
||||
set_target_properties(Jansson::Jansson PROPERTIES IMPORTED_LIBNAME
|
||||
"${JANSSON_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
Jansson::Jansson PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${JANSSON_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,113 +1,151 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBAJANTV2_FOUND
|
||||
# LIBAJANTV2_INCLUDE_DIRS
|
||||
# LIBAJANTV2_LIBRARIES
|
||||
# LIBAJANTV2_FOUND LIBAJANTV2_INCLUDE_DIRS LIBAJANTV2_LIBRARIES
|
||||
#
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_AJA QUIET ajantv2)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_AJA QUIET ajantv2)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(AJA_LIBRARIES_INCLUDE_DIR
|
||||
NAMES ajalibraries
|
||||
HINTS
|
||||
ENV AJASDKPath${_lib_suffix}
|
||||
ENV AJASDKPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${AJASDKPath${_lib_suffix}}
|
||||
${AJASDKPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_AJA_NTV2_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
find_path(
|
||||
AJA_LIBRARIES_INCLUDE_DIR
|
||||
NAMES ajalibraries
|
||||
HINTS ENV
|
||||
AJASDKPath${_lib_suffix}
|
||||
ENV
|
||||
AJASDKPath
|
||||
ENV
|
||||
DepsPath${_lib_suffix}
|
||||
ENV
|
||||
DepsPath
|
||||
${AJASDKPath${_lib_suffix}}
|
||||
${AJASDKPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_AJA_NTV2_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(AJA_NTV2_LIB
|
||||
NAMES ${_AJA_NTV2_LIBRARIES} ajantv2 libajantv2
|
||||
HINTS
|
||||
ENV AJASDKPath${_lib_suffix}
|
||||
ENV AJASDKPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${AJASDKPath${_lib_suffix}}
|
||||
${AJASDKPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_AJA_NTV2_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
AJA_NTV2_LIB
|
||||
NAMES ${_AJA_NTV2_LIBRARIES} ajantv2 libajantv2
|
||||
HINTS ENV
|
||||
AJASDKPath${_lib_suffix}
|
||||
ENV
|
||||
AJASDKPath
|
||||
ENV
|
||||
DepsPath${_lib_suffix}
|
||||
ENV
|
||||
DepsPath
|
||||
${AJASDKPath${_lib_suffix}}
|
||||
${AJASDKPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_AJA_NTV2_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
find_library(AJA_NTV2_DEBUG_LIB
|
||||
NAMES ajantv2d libajantv2d
|
||||
HINTS
|
||||
ENV AJASDKPath${_lib_suffix}
|
||||
ENV AJASDKPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${AJASDKPath${_lib_suffix}}
|
||||
${AJASDKPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_AJA_NTV2_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
AJA_NTV2_DEBUG_LIB
|
||||
NAMES ajantv2d libajantv2d
|
||||
HINTS ENV
|
||||
AJASDKPath${_lib_suffix}
|
||||
ENV
|
||||
AJASDKPath
|
||||
ENV
|
||||
DepsPath${_lib_suffix}
|
||||
ENV
|
||||
DepsPath
|
||||
${AJASDKPath${_lib_suffix}}
|
||||
${AJASDKPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_AJA_NTV2_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibAJANTV2 DEFAULT_MSG AJA_LIBRARIES_INCLUDE_DIR AJA_NTV2_LIB)
|
||||
find_package_handle_standard_args(LibAJANTV2 DEFAULT_MSG
|
||||
AJA_LIBRARIES_INCLUDE_DIR AJA_NTV2_LIB)
|
||||
mark_as_advanced(AJA_LIBRARIES_INCLUDE_DIR AJA_NTV2_LIB)
|
||||
|
||||
if(LIBAJANTV2_FOUND)
|
||||
set(AJA_LIBRARIES_INCLUDE_DIR
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajalibraries)
|
||||
set(AJA_LIBRARIES_INCLUDE_DIRS
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajaanc
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajabase
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/includes
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/src)
|
||||
if (WIN32)
|
||||
set(AJA_LIBRARIES_INCLUDE_DIRS
|
||||
${AJA_LIBRARIES_INCLUDE_DIRS}
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/src/win)
|
||||
elseif (APPLE)
|
||||
set(AJA_LIBRARIES_INCLUDE_DIRS
|
||||
${AJA_LIBRARIES_INCLUDE_DIRS}
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/src/mac)
|
||||
elseif(UNIX AND NOT APPLE)
|
||||
set(AJA_LIBRARIES_INCLUDE_DIRS
|
||||
${AJA_LIBRARIES_INCLUDE_DIRS}
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/src/lin)
|
||||
endif()
|
||||
set(AJA_LIBRARIES_INCLUDE_DIR ${AJA_LIBRARIES_INCLUDE_DIR}/ajalibraries)
|
||||
set(AJA_LIBRARIES_INCLUDE_DIRS
|
||||
${AJA_LIBRARIES_INCLUDE_DIR} ${AJA_LIBRARIES_INCLUDE_DIR}/ajaanc
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajabase ${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2
|
||||
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/includes)
|
||||
|
||||
set(LIBAJANTV2_LIBRARIES ${AJA_NTV2_LIB})
|
||||
if(AJA_NTV2_DEBUG_LIB STREQUAL "AJA_NTV2_DEBUG_LIB-NOTFOUND")
|
||||
set(AJA_NTV2_DEBUG_LIB ${AJA_NTV2_LIB})
|
||||
endif()
|
||||
set(LIBAJANTV2_DEBUG_LIBRARIES ${AJA_NTV2_DEBUG_LIB})
|
||||
set(LIBAJANTV2_INCLUDE_DIRS ${AJA_LIBRARIES_INCLUDE_DIRS})
|
||||
set(LIBAJANTV2_LIBRARIES ${AJA_NTV2_LIB})
|
||||
if(AJA_NTV2_DEBUG_LIB STREQUAL "AJA_NTV2_DEBUG_LIB-NOTFOUND")
|
||||
set(AJA_NTV2_DEBUG_LIB ${AJA_NTV2_LIB})
|
||||
mark_as_advanced(AJA_NTV2_DEBUG_LIB)
|
||||
endif()
|
||||
set(LIBAJANTV2_DEBUG_LIBRARIES ${AJA_NTV2_DEBUG_LIB})
|
||||
set(LIBAJANTV2_INCLUDE_DIRS ${AJA_LIBRARIES_INCLUDE_DIRS})
|
||||
|
||||
if(NOT TARGET AJA::LibAJANTV2)
|
||||
if(IS_ABSOLUTE "${LIBAJANTV2_LIBRARIES}")
|
||||
add_library(AJA::LibAJANTV2 UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
AJA::LibAJANTV2 PROPERTIES IMPORTED_LOCATION "${LIBAJANTV2_LIBRARIES}")
|
||||
|
||||
if(DEFINED LIBAJANTV2_DEBUG_LIBRARIES)
|
||||
set_target_properties(
|
||||
AJA::LibAJANTV2 PROPERTIES IMPORTED_LOCATION_DEBUG
|
||||
"${LIBAJANTV2_DEBUG_LIBRARIES}")
|
||||
endif()
|
||||
else()
|
||||
add_library(AJA::LibAJANTV2 INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
AJA::LibAJANTV2 PROPERTIES IMPORTED_LIBNAME "${LIBAJANTV2_LIBRARIES}")
|
||||
|
||||
if(DEFINED LIBAJANTV2_DEBUG_LIBRARIES)
|
||||
set_target_properties(
|
||||
AJA::LibAJANTV2 PROPERTIES IMPORTED_LIBNAME_DEBUG
|
||||
"${LIBAJANTV2_DEBUG_LIBRARIES}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
AJA::LibAJANTV2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${LIBAJANTV2_INCLUDE_DIRS}")
|
||||
|
||||
target_compile_definitions(
|
||||
AJA::LibAJANTV2
|
||||
INTERFACE "$<$<BOOL:${OS_WINDOWS}>:AJA_WINDOWS;_WINDOWS;WIN32;MSWindows>"
|
||||
"$<$<AND:$<BOOL:${OS_WINDOWS}>,$<CONFIG:DEBUG>>:_DEBUG;_NDEBUG>"
|
||||
"$<$<BOOL:${OS_MACOS}>:AJAMac;AJA_MAC>"
|
||||
"$<$<BOOL:${OS_LINUX}>:AJA_LINUX;AJALinux>")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,59 +1,46 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBVLC_FOUND
|
||||
# LIBVLC_INCLUDE_DIRS
|
||||
# LIBVLC_LIBRARIES
|
||||
# LIBVLC_FOUND LIBVLC_INCLUDE_DIRS LIBVLC_LIBRARIES
|
||||
#
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_VLC QUIET libvlc)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_VLC QUIET libvlc)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(VLC_INCLUDE_DIR
|
||||
NAMES libvlc.h
|
||||
HINTS
|
||||
ENV VLCPath${_lib_suffix}
|
||||
ENV VLCPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${VLCPath${_lib_suffix}}
|
||||
${VLCPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_VLC_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
vlc include/vlc include)
|
||||
find_path(
|
||||
VLC_INCLUDE_DIR
|
||||
NAMES libvlc.h
|
||||
HINTS ENV VLC_PATH ${VLC_PATH} ${CMAKE_SOURCE_DIR}/${VLC_PATH}
|
||||
${_VLC_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES vlc include/vlc include)
|
||||
|
||||
find_library(VLC_LIB
|
||||
NAMES ${_VLC_LIBRARIES} VLC libVLC
|
||||
HINTS
|
||||
ENV VLCPath${_lib_suffix}
|
||||
ENV VLCPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${VLCPath${_lib_suffix}}
|
||||
${VLCPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_VLC_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
VLC_LIB
|
||||
NAMES ${_VLC_LIBRARIES} VLC libVLC
|
||||
HINTS ENV VLC_PATH ${VLC_PATH} ${CMAKE_SOURCE_DIR}/${VLC_PATH}
|
||||
${_VLC_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# OBS doesnt depend on linking, so we dont include VLC_LIB here as required.
|
||||
|
@ -61,6 +48,12 @@ find_package_handle_standard_args(LibVLC DEFAULT_MSG VLC_INCLUDE_DIR)
|
|||
mark_as_advanced(VLC_INCLUDE_DIR VLC_LIB)
|
||||
|
||||
if(LIBVLC_FOUND)
|
||||
set(LIBVLC_LIBRARIES ${VLC_LIB})
|
||||
set(LIBVLC_INCLUDE_DIRS ${VLC_INCLUDE_DIR})
|
||||
set(LIBVLC_LIBRARIES ${VLC_LIB})
|
||||
set(LIBVLC_INCLUDE_DIRS ${VLC_INCLUDE_DIR})
|
||||
|
||||
if(NOT TARGET VLC::LibVLC)
|
||||
add_library(VLC::LibVLC INTERFACE IMPORTED)
|
||||
set_target_properties(VLC::LibVLC PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${LIBVLC_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBCURL_FOUND
|
||||
# LIBCURL_INCLUDE_DIRS
|
||||
# LIBCURL_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# CURL_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_CURL QUIET curl libcurl)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(CURL_INCLUDE_DIR
|
||||
NAMES curl/curl.h
|
||||
HINTS
|
||||
ENV curlPath${_lib_suffix}
|
||||
ENV curlPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${curlPath${_lib_suffix}}
|
||||
${curlPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_CURL_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
|
||||
if(APPLE)
|
||||
find_library(CURL_LIB
|
||||
NAMES ${_CURL_LIBRARIES} curl libcurl
|
||||
HINTS
|
||||
ENV curlPath${_lib_suffix}
|
||||
ENV curlPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${curlPath${_lib_suffix}}
|
||||
${curlPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_CURL_LIBRARY_DIRS}
|
||||
)
|
||||
else()
|
||||
find_library(CURL_LIB
|
||||
NAMES ${_CURL_LIBRARIES} curl libcurl
|
||||
HINTS
|
||||
ENV curlPath${_lib_suffix}
|
||||
ENV curlPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${curlPath${_lib_suffix}}
|
||||
${curlPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_CURL_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin
|
||||
"build/Win${_lib_suffix}/VC12/DLL Release - DLL Windows SSPI"
|
||||
"../build/Win${_lib_suffix}/VC12/DLL Release - DLL Windows SSPI")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libcurl DEFAULT_MSG CURL_LIB CURL_INCLUDE_DIR)
|
||||
mark_as_advanced(CURL_INCLUDE_DIR CURL_LIB)
|
||||
|
||||
if(LIBCURL_FOUND)
|
||||
set(LIBCURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
|
||||
set(LIBCURL_LIBRARIES ${CURL_LIB})
|
||||
endif()
|
|
@ -1,33 +1,37 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBDRM_FOUND
|
||||
# LIBDRM_INCLUDE_DIRS
|
||||
# LIBDRM_LIBRARIES
|
||||
# LIBDRM_FOUND LIBDRM_INCLUDE_DIRS LIBDRM_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_LIBDRM QUIET libdrm)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_LIBDRM QUIET libdrm)
|
||||
endif()
|
||||
|
||||
find_path(LIBDRM_INCLUDE_DIR
|
||||
NAMES libdrm/drm_fourcc.h
|
||||
HINTS
|
||||
${_LIBDRM_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include)
|
||||
find_path(
|
||||
LIBDRM_INCLUDE_DIR
|
||||
NAMES libdrm/drm_fourcc.h
|
||||
HINTS ${_LIBDRM_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include)
|
||||
|
||||
find_library(LIBDRM_LIB
|
||||
NAMES drm libdrm
|
||||
HINTS
|
||||
${_LIBDRM_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib)
|
||||
find_library(
|
||||
LIBDRM_LIB
|
||||
NAMES drm libdrm
|
||||
HINTS ${_LIBDRM_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libdrm DEFAULT_MSG LIBDRM_LIB LIBDRM_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(Libdrm DEFAULT_MSG LIBDRM_LIB
|
||||
LIBDRM_INCLUDE_DIR)
|
||||
mark_as_advanced(LIBDRM_INCLUDE_DIR LIBDRM_LIB)
|
||||
|
||||
if(LIBDRM_FOUND)
|
||||
set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR})
|
||||
set(LIBDRM_LIBRARIES ${LIBDRM_LIB})
|
||||
set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR})
|
||||
set(LIBDRM_LIBRARIES ${LIBDRM_LIB})
|
||||
|
||||
if(NOT TARGET Libdrm::Libdrm)
|
||||
add_library(Libdrm::Libdrm INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
Libdrm::Libdrm PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${LIBDRM_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,68 +1,73 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBFDK_FOUND
|
||||
# LIBFDK_INCLUDE_DIRS
|
||||
# LIBFDK_LIBRARIES
|
||||
# LIBFDK_FOUND LIBFDK_INCLUDE_DIRS LIBFDK_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
# For use in OBS:
|
||||
#
|
||||
# Libfdk_INCLUDE_DIR
|
||||
# Libfdk_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_LIBFDK QUIET fdk-aac)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_LIBFDK fdk-aac)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(Libfdk_INCLUDE_DIR
|
||||
NAMES fdk-aac/aacenc_lib.h
|
||||
HINTS
|
||||
ENV LibfdkPath${_lib_suffix}
|
||||
ENV LibfdkPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${LibfdkPath${_lib_suffix}}
|
||||
${LibfdkPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_LIBFDK_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
find_path(
|
||||
Libfdk_INCLUDE_DIR
|
||||
NAMES fdk-aac/aacenc_lib.h
|
||||
HINTS ENV LIBFDK_PATH ${LIBFDK_PATH} ${CMAKE_SOURCE_DIR}/${LIBFDK_PATH}
|
||||
${_LIBFDK_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(Libfdk_LIB
|
||||
NAMES ${_LIBFDK_LIBRARIES} fdk-aac libfdk-aac
|
||||
HINTS
|
||||
ENV LibfdkPath${_lib_suffix}
|
||||
ENV LibfdkPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${LibfdkPath${_lib_suffix}}
|
||||
${LibfdkPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_LIBFDK_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
Libfdk_LIB
|
||||
NAMES ${_LIBFDK_LIBRARIES} fdk-aac libfdk-aac
|
||||
HINTS ENV LIBFDK_PATH ${LIBFDK_PATH} ${CMAKE_SOURCE_DIR}/${LIBFDK_PATH}
|
||||
${_LIBFDK_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libfdk DEFAULT_MSG Libfdk_LIB Libfdk_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(Libfdk DEFAULT_MSG Libfdk_LIB
|
||||
Libfdk_INCLUDE_DIR)
|
||||
mark_as_advanced(Libfdk_INCLUDE_DIR Libfdk_LIB)
|
||||
|
||||
if(LIBFDK_FOUND)
|
||||
set(LIBFDK_INCLUDE_DIRS ${Libfdk_INCLUDE_DIR})
|
||||
set(LIBFDK_LIBRARIES ${Libfdk_LIB})
|
||||
set(LIBFDK_INCLUDE_DIRS ${Libfdk_INCLUDE_DIR})
|
||||
set(LIBFDK_LIBRARIES ${Libfdk_LIB})
|
||||
|
||||
if(NOT TARGET LibFDK::LibFDK)
|
||||
if(IS_ABSOLUTE "${LIBFDK_LIBRARIES}")
|
||||
add_library(LibFDK::LibFDK UNKNOWN IMPORTED)
|
||||
set_target_properties(LibFDK::LibFDK PROPERTIES IMPORTED_LOCATION
|
||||
"${LIBFDK_LIBRARIES}")
|
||||
else()
|
||||
add_library(LibFDK::LibFDK INTERFACE IMPORTED)
|
||||
set_target_properties(LibFDK::LibFDK PROPERTIES IMPORTED_LIBNAME
|
||||
"${LIBFDK_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
LibFDK::LibFDK PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${LIBFDK_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# * Try to find Libpci
|
||||
# Once done this will define
|
||||
# * Try to find Libpci Once done this will define
|
||||
#
|
||||
# LIBPCI_FOUND - system has Libpci
|
||||
# LIBPCI_INCLUDE_DIRS - the Libpci include directory
|
||||
# LIBPCI_LIBRARIES - the libraries needed to use Libpci
|
||||
# LIBPCI_DEFINITIONS - Compiler switches required for using Libpci
|
||||
# * LIBPCI_FOUND - system has Libpci
|
||||
# * LIBPCI_INCLUDE_DIRS - the Libpci include directory
|
||||
# * LIBPCI_LIBRARIES - the libraries needed to use Libpci
|
||||
# * LIBPCI_DEFINITIONS - Compiler switches required for using Libpci
|
||||
|
||||
# Use pkg-config to get the directories and then use these values in the
|
||||
# find_path() and find_library() calls
|
||||
|
@ -28,7 +27,8 @@ find_library(
|
|||
PATHS /usr/lib /usr/local/lib /opt/local/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libpci REQUIRED_VARS LIBPCI_LIB LIBPCI_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(Libpci REQUIRED_VARS LIBPCI_LIB
|
||||
LIBPCI_INCLUDE_DIR)
|
||||
mark_as_advanced(LIBPCI_INCLUDE_DIR LIBPCI_LIB)
|
||||
|
||||
if(LIBPCI_FOUND)
|
||||
|
@ -39,11 +39,11 @@ if(LIBPCI_FOUND)
|
|||
if(IS_ABSOLUTE "${LIBPCI_LIBRARIES}")
|
||||
add_library(LIBPCI::LIBPCI UNKNOWN IMPORTED)
|
||||
set_target_properties(LIBPCI::LIBPCI PROPERTIES IMPORTED_LOCATION
|
||||
"${LIBPCI_LIBRARIES}")
|
||||
"${LIBPCI_LIBRARIES}")
|
||||
else()
|
||||
add_library(LIBPCI::LIBPCI INTERFACE IMPORTED)
|
||||
set_target_properties(LIBPCI::LIBPCI PROPERTIES IMPORTED_LIBNAME
|
||||
"${LIBPCI_LIBRARIES}")
|
||||
"${LIBPCI_LIBRARIES}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,68 +1,74 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBRNNOISE_FOUND
|
||||
# LIBRNNOISE_INCLUDE_DIRS
|
||||
# LIBRNNOISE_LIBRARIES
|
||||
# LIBRNNOISE_FOUND LIBRNNOISE_INCLUDE_DIRS LIBRNNOISE_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# RNNOISE_INCLUDE_DIR
|
||||
# RNNOISE_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_RNNOISE QUIET rnnoise)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_RNNOISE QUIET rnnoise)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(RNNOISE_INCLUDE_DIR
|
||||
NAMES rnnoise.h
|
||||
HINTS
|
||||
ENV rnnoisePath${_lib_suffix}
|
||||
ENV rnnoisePath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${rnnoisePath${_lib_suffix}}
|
||||
${rnnoisePath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_RNNOISE_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
find_path(
|
||||
RNNOISE_INCLUDE_DIR
|
||||
NAMES rnnoise.h
|
||||
HINTS ENV RNNOISE_PATH ${RNNOISE_PATH} ${CMAKE_SOURCE_DIR}/${RNNOISE_PATH}
|
||||
${_RNNOISE_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(RNNOISE_LIB
|
||||
NAMES ${_RNNOISE_LIBRARIES} rnnoise
|
||||
HINTS
|
||||
ENV rnnoisePath${_lib_suffix}
|
||||
ENV rnnoisePath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${rnnoisePath${_lib_suffix}}
|
||||
${rnnoisePath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_RNNOISE_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
RNNOISE_LIB
|
||||
NAMES ${_RNNOISE_LIBRARIES} rnnoise
|
||||
HINTS ENV RNNOISE_PATH ${RNNOISE_PATH} ${CMAKE_SOURCE_DIR}/${RNNOISE_PATH}
|
||||
${_RNNOISE_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Librnnoise DEFAULT_MSG RNNOISE_LIB RNNOISE_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(Librnnoise DEFAULT_MSG RNNOISE_LIB
|
||||
RNNOISE_INCLUDE_DIR)
|
||||
mark_as_advanced(RNNOISE_INCLUDE_DIR RNNOISE_LIB)
|
||||
|
||||
if(LIBRNNOISE_FOUND)
|
||||
set(LIBRNNOISE_INCLUDE_DIRS ${RNNOISE_INCLUDE_DIR})
|
||||
set(LIBRNNOISE_LIBRARIES ${RNNOISE_LIB})
|
||||
set(LIBRNNOISE_INCLUDE_DIRS ${RNNOISE_INCLUDE_DIR})
|
||||
set(LIBRNNOISE_LIBRARIES ${RNNOISE_LIB})
|
||||
|
||||
if(NOT TARGET Librnnoise::Librnnoise)
|
||||
if(IS_ABSOLUTE "${LIBRNNOISE_LIBRARIES}")
|
||||
add_library(Librnnoise::Librnnoise UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
Librnnoise::Librnnoise PROPERTIES IMPORTED_LOCATION
|
||||
"${LIBRNNOISE_LIBRARIES}")
|
||||
else()
|
||||
add_library(Librnnoise::Librnnoise INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
Librnnoise::Librnnoise PROPERTIES IMPORTED_LIBNAME
|
||||
"${LIBRNNOISE_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
Librnnoise::Librnnoise PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${LIBRNNOISE_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,68 +1,74 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBSPEEXDSP_FOUND
|
||||
# LIBSPEEXDSP_INCLUDE_DIRS
|
||||
# LIBSPEEXDSP_LIBRARIES
|
||||
# LIBSPEEXDSP_FOUND LIBSPEEXDSP_INCLUDE_DIRS LIBSPEEXDSP_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# SPEEXDSP_INCLUDE_DIR
|
||||
# SPEEXDSP_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_SPEEXDSP QUIET speexdsp libspeexdsp)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_SPEEXDSP QUIET speexdsp libspeexdsp)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(SPEEXDSP_INCLUDE_DIR
|
||||
NAMES speex/speex_preprocess.h
|
||||
HINTS
|
||||
ENV speexPath${_lib_suffix}
|
||||
ENV speexPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${speexPath${_lib_suffix}}
|
||||
${speexPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_SPEEXDSP_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
find_path(
|
||||
SPEEXDSP_INCLUDE_DIR
|
||||
NAMES speex/speex_preprocess.h
|
||||
HINTS ENV SPEEX_PATH ${SPEEX_PATH} ${CMAKE_SOURCE_DIR}/${SPEEX_PATH}
|
||||
${_SPEEXDSP_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(SPEEXDSP_LIB
|
||||
NAMES ${_SPEEXDSP_LIBRARIES} speexdsp libspeexdsp
|
||||
HINTS
|
||||
ENV speexPath${_lib_suffix}
|
||||
ENV speexPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${speexPath${_lib_suffix}}
|
||||
${speexPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_SPEEXDSP_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
SPEEXDSP_LIB
|
||||
NAMES ${_SPEEXDSP_LIBRARIES} speexdsp libspeexdsp
|
||||
HINTS ENV SPEEX_PATH ${SPEEX_PATH} ${CMAKE_SOURCE_DIR}/${SPEEX_PATH}
|
||||
${_SPEEXDSP_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libspeexdsp DEFAULT_MSG SPEEXDSP_LIB SPEEXDSP_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(Libspeexdsp DEFAULT_MSG SPEEXDSP_LIB
|
||||
SPEEXDSP_INCLUDE_DIR)
|
||||
mark_as_advanced(SPEEXDSP_INCLUDE_DIR SPEEXDSP_LIB)
|
||||
|
||||
if(LIBSPEEXDSP_FOUND)
|
||||
set(LIBSPEEXDSP_INCLUDE_DIRS ${SPEEXDSP_INCLUDE_DIR})
|
||||
set(LIBSPEEXDSP_LIBRARIES ${SPEEXDSP_LIB})
|
||||
set(LIBSPEEXDSP_INCLUDE_DIRS ${SPEEXDSP_INCLUDE_DIR})
|
||||
set(LIBSPEEXDSP_LIBRARIES ${SPEEXDSP_LIB})
|
||||
|
||||
if(NOT TARGET LibspeexDSP::LibspeexDSP)
|
||||
if(IS_ABSOLUTE "${LIBSPEEXDSP_LIBRARIES}")
|
||||
add_library(LibspeexDSP::LibspeexDSP UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
LibspeexDSP::LibspeexDSP PROPERTIES IMPORTED_LOCATION
|
||||
"${LIBSPEEXDSP_LIBRARIES}")
|
||||
else()
|
||||
add_library(LibspeexDSP::LibspeexDSP INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
LibspeexDSP::LibspeexDSP PROPERTIES IMPORTED_LIBNAME
|
||||
"${LIBSPEEXDSP_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
LibspeexDSP::LibspeexDSP PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${LIBSPEEXDSP_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# SYSINFO_FOUND
|
||||
# SYSINFO_INCLUDE_DIRS
|
||||
# SYSINFO_LIBRARIES
|
||||
|
||||
find_path(SYSINFO_INCLUDE_DIR
|
||||
NAMES sys/sysinfo.h
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include)
|
||||
|
||||
find_library(SYSINFO_LIB
|
||||
NAMES sysinfo libsysinfo
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(sysinfo DEFAULT_MSG SYSINFO_LIB SYSINFO_INCLUDE_DIR)
|
||||
mark_as_advanced(SYSINFO_INCLUDE_DIR SYSINFO_LIB)
|
||||
|
||||
if(SYSINFO_FOUND)
|
||||
set(SYSINFO_INCLUDE_DIRS ${SYSINFO_INCLUDE_DIR})
|
||||
set(SYSINFO_LIBRARIES ${SYSINFO_LIB})
|
||||
endif()
|
|
@ -1,33 +1,45 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBV4L2_FOUND
|
||||
# LIBV4L2_INCLUDE_DIRS
|
||||
# LIBV4L2_LIBRARIES
|
||||
# LIBV4L2_FOUND LIBV4L2_INCLUDE_DIRS LIBV4L2_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_V4L2 QUIET v4l-utils)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_V4L2 QUIET v4l-utils)
|
||||
endif()
|
||||
|
||||
find_path(V4L2_INCLUDE_DIR
|
||||
NAMES libv4l2.h
|
||||
HINTS
|
||||
${_V4L2_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include)
|
||||
find_path(
|
||||
V4L2_INCLUDE_DIR
|
||||
NAMES libv4l2.h
|
||||
HINTS ${_V4L2_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include)
|
||||
|
||||
find_library(V4L2_LIB
|
||||
NAMES v4l2
|
||||
HINTS
|
||||
${_V4L2_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib)
|
||||
find_library(
|
||||
V4L2_LIB
|
||||
NAMES v4l2
|
||||
HINTS ${_V4L2_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libv4l2 DEFAULT_MSG V4L2_LIB V4L2_INCLUDE_DIR)
|
||||
mark_as_advanced(V4L2_INCLUDE_DIR V4L2_LIB)
|
||||
|
||||
if(LIBV4L2_FOUND)
|
||||
set(LIBV4L2_INCLUDE_DIRS ${V4L2_INCLUDE_DIR})
|
||||
set(LIBV4L2_LIBRARIES ${V4L2_LIB})
|
||||
set(LIBV4L2_INCLUDE_DIRS ${V4L2_INCLUDE_DIR})
|
||||
set(LIBV4L2_LIBRARIES ${V4L2_LIB})
|
||||
|
||||
if(NOT TARGET LIB4L2::LIB4L2)
|
||||
if(IS_ABSOLUTE "${LIBV4L2_LIBRARIES}")
|
||||
add_library(LIB4L2::LIB4L2 UNKNOWN IMPORTED)
|
||||
set_target_properties(LIB4L2::LIB4L2 PROPERTIES IMPORTED_LOCATION
|
||||
"${LIBV4L2_LIBRARIES}")
|
||||
else()
|
||||
add_library(LIB4L2::LIB4L2 INTERFACE IMPORTED)
|
||||
set_target_properties(LIB4L2::LIB4L2 PROPERTIES IMPORTED_LIBNAME
|
||||
"${LIBV4L2_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
LIB4L2::LIB4L2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${LIBV4L2_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,68 +1,71 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBX264_FOUND
|
||||
# LIBX264_INCLUDE_DIRS
|
||||
# LIBX264_LIBRARIES
|
||||
# LIBX264_FOUND LIBX264_INCLUDE_DIRS LIBX264_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
# For use in OBS:
|
||||
#
|
||||
# X264_INCLUDE_DIR
|
||||
# X264_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_X264 QUIET x264)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_X264 QUIET x264)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(X264_INCLUDE_DIR
|
||||
NAMES x264.h
|
||||
HINTS
|
||||
ENV x264Path${_lib_suffix}
|
||||
ENV x264Path
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${x264Path${_lib_suffix}}
|
||||
${x264Path}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_X264_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
find_path(
|
||||
X264_INCLUDE_DIR
|
||||
NAMES x264.h
|
||||
HINTS ENV X264_PATH ${X264_PATH} ${CMAKE_SOURCE_DIR}/${X264_PATH}
|
||||
${_X264_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(X264_LIB
|
||||
NAMES ${_X264_LIBRARIES} x264 libx264
|
||||
HINTS
|
||||
ENV x264Path${_lib_suffix}
|
||||
ENV x264Path
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${x264Path${_lib_suffix}}
|
||||
${x264Path}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_X264_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
X264_LIB
|
||||
NAMES ${_X264_LIBRARIES} x264 libx264
|
||||
HINTS ENV X264_PATH ${X264_PATH} ${CMAKE_SOURCE_DIR}/${X264_PATH}
|
||||
${_X264_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libx264 DEFAULT_MSG X264_LIB X264_INCLUDE_DIR)
|
||||
mark_as_advanced(X264_INCLUDE_DIR X264_LIB)
|
||||
|
||||
if(LIBX264_FOUND)
|
||||
set(LIBX264_INCLUDE_DIRS ${X264_INCLUDE_DIR})
|
||||
set(LIBX264_LIBRARIES ${X264_LIB})
|
||||
set(LIBX264_INCLUDE_DIRS ${X264_INCLUDE_DIR})
|
||||
set(LIBX264_LIBRARIES ${X264_LIB})
|
||||
|
||||
if(NOT TARGET LIBX264::LIBX264)
|
||||
if(IS_ABSOLUTE "${LIBX264_LIBRARIES}")
|
||||
add_library(LIBX264::LIBX264 UNKNOWN IMPORTED)
|
||||
set_target_properties(LIBX264::LIBX264 PROPERTIES IMPORTED_LOCATION
|
||||
"${LIBX264_LIBRARIES}")
|
||||
else()
|
||||
add_library(LIBX264::LIBX264 INTERFACE IMPORTED)
|
||||
set_target_properties(LIBX264::LIBX264 PROPERTIES IMPORTED_LIBNAME
|
||||
"${LIBX264_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
LIBX264::LIBX264 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${LIBX264_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,88 +1,92 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LUAJIT_FOUND
|
||||
# LUAJIT_INCLUDE_DIRS
|
||||
# LUAJIT_LIBRARIES
|
||||
# LUAJIT_FOUND LUAJIT_INCLUDE_DIRS LUAJIT_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
# For use in OBS:
|
||||
#
|
||||
# LUAJIT_INCLUDE_DIR
|
||||
# LUAJIT_INCLUDE_DIR
|
||||
|
||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(_LIB_SUFFIX 64)
|
||||
ELSE()
|
||||
SET(_LIB_SUFFIX 32)
|
||||
ENDIF()
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_LIB_SUFFIX 64)
|
||||
else()
|
||||
set(_LIB_SUFFIX 32)
|
||||
endif()
|
||||
|
||||
FIND_PATH(LUAJIT_INCLUDE_DIR
|
||||
NAMES lua.h lualib.h
|
||||
HINTS
|
||||
ENV LuajitPath${_LIB_SUFFIX}
|
||||
ENV LuajitPath
|
||||
ENV DepsPath${_LIB_SUFFIX}
|
||||
ENV DepsPath
|
||||
${LuajitPath${_LIB_SUFFIX}}
|
||||
${LuajitPath}
|
||||
${DepsPath${_LIB_SUFFIX}}
|
||||
${DepsPath}
|
||||
${_LUAJIT_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/opt/local
|
||||
/sw/include
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
luajit
|
||||
luajit/src
|
||||
include/luajit
|
||||
include/luajit/src
|
||||
luajit-2.0
|
||||
include/luajit-2.0
|
||||
luajit2.0
|
||||
include/luajit2.0
|
||||
luajit-2.1
|
||||
include/luajit-2.1
|
||||
luajit2.1
|
||||
include/luajit2.1
|
||||
)
|
||||
find_path(
|
||||
LUAJIT_INCLUDE_DIR
|
||||
NAMES lua.h lualib.h
|
||||
HINTS ENV LUAJIT_PATH ${LUAJIT_PATH} ${CMAKE_SOURCE_DIR}/${LUAJIT_PATH}
|
||||
${_LUAJIT_INCLUDE_DIRS}
|
||||
PATHS /usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/opt/local
|
||||
/sw/include
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
luajit
|
||||
luajit/src
|
||||
include/luajit
|
||||
include/luajit/src
|
||||
luajit-2.0
|
||||
include/luajit-2.0
|
||||
luajit2.0
|
||||
include/luajit2.0
|
||||
luajit-2.1
|
||||
include/luajit-2.1
|
||||
luajit2.1
|
||||
include/luajit2.1)
|
||||
|
||||
find_library(LUAJIT_LIB
|
||||
NAMES ${_LUAJIT_LIBRARIES} luajit luajit-51 luajit-5.1 lua51
|
||||
HINTS
|
||||
ENV LuajitPath${_lib_suffix}
|
||||
ENV LuajitPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${LuajitPath${_lib_suffix}}
|
||||
${LuajitPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_LUAJIT_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/opt/local
|
||||
/sw/lib
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
LUAJIT_LIB
|
||||
NAMES ${_LUAJIT_LIBRARIES} luajit luajit-51 luajit-5.1 lua51
|
||||
HINTS ENV LUAJIT_PATH ${LUAJIT_PATH} ${CMAKE_SOURCE_DIR}/${LUAJIT_PATH}
|
||||
${_LUAJIT_LIBRARY_DIRS}
|
||||
PATHS /usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/opt/local
|
||||
/sw/lib
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Luajit DEFAULT_MSG LUAJIT_LIB LUAJIT_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(Luajit DEFAULT_MSG LUAJIT_LIB
|
||||
LUAJIT_INCLUDE_DIR)
|
||||
mark_as_advanced(LUAJIT_INCLUDE_DIR LUAJIT_LIB)
|
||||
|
||||
if(LUAJIT_FOUND)
|
||||
set(LUAJIT_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIR})
|
||||
set(LUAJIT_LIBRARIES ${LUAJIT_LIB})
|
||||
set(LUAJIT_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIR})
|
||||
set(LUAJIT_LIBRARIES ${LUAJIT_LIB})
|
||||
|
||||
if(NOT TARGET Luajit::Luajit)
|
||||
if(IS_ABSOLUTE "${LUAJIT_LIBRARIES}")
|
||||
add_library(Luajit::Luajit UNKNOWN IMPORTED)
|
||||
set_target_properties(Luajit::Luajit PROPERTIES IMPORTED_LOCATION
|
||||
"${LUAJIT_LIBRARIES}")
|
||||
else()
|
||||
add_library(Luajit::Luajit INTERFACE IMPORTED)
|
||||
set_target_properties(Luajit::Luajit PROPERTIES IMPORTED_LIBNAME
|
||||
"${LUAJIT_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
Luajit::Luajit PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${LUAJIT_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,137 +1,173 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# MBEDTLS_FOUND
|
||||
# MBEDTLS_INCLUDE_DIRS
|
||||
# MBEDTLS_LIBRARIES
|
||||
# * MBEDTLS_FOUND
|
||||
# * MBEDTLS_INCLUDE_DIRS
|
||||
# * MBEDTLS_LIBRARIES
|
||||
#
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_MBEDTLS QUIET mbedtls)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_MBEDTLS QUIET mbedtls)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
# If we're on MacOS or Linux, please try to statically-link mbedtls.
|
||||
if(STATIC_MBEDTLS AND (APPLE OR UNIX))
|
||||
set(_MBEDTLS_LIBRARIES libmbedtls.a)
|
||||
set(_MBEDCRYPTO_LIBRARIES libmbedcrypto.a)
|
||||
set(_MBEDX509_LIBRARIES libmbedx509.a)
|
||||
if(ENABLE_STATIC_MBEDTLS AND (APPLE OR UNIX))
|
||||
set(_MBEDTLS_LIBRARIES libmbedtls.a)
|
||||
set(_MBEDCRYPTO_LIBRARIES libmbedcrypto.a)
|
||||
set(_MBEDX509_LIBRARIES libmbedx509.a)
|
||||
endif()
|
||||
|
||||
find_path(MBEDTLS_INCLUDE_DIR
|
||||
NAMES mbedtls/ssl.h
|
||||
HINTS
|
||||
ENV mbedtlsPath${_lib_suffix}
|
||||
ENV mbedtlsPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${mbedtlsPath${_lib_suffix}}
|
||||
${mbedtlsPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_MBEDTLS_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
find_path(
|
||||
MBEDTLS_INCLUDE_DIR
|
||||
NAMES mbedtls/ssl.h
|
||||
HINTS ENV MBEDTLS_PATH ${MBEDTLS_PATH} ${CMAKE_SOURCE_DIR}/${MBEDTLS_PATH}
|
||||
${_MBEDTLS_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(MBEDTLS_LIB
|
||||
NAMES ${_MBEDTLS_LIBRARIES} mbedtls libmbedtls
|
||||
HINTS
|
||||
ENV mbedtlsPath${_lib_suffix}
|
||||
ENV mbedtlsPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${mbedtlsPath${_lib_suffix}}
|
||||
${mbedtlsPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_MBEDTLS_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
MBEDTLS_LIB
|
||||
NAMES ${_MBEDTLS_LIBRARIES} mbedtls libmbedtls
|
||||
HINTS ENV MBEDTLS_PATH ${MBEDTLS_PATH} ${CMAKE_SOURCE_DIR}/${MBEDTLS_PATH}
|
||||
${_MBEDTLS_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
find_library(MBEDCRYPTO_LIB
|
||||
NAMES ${_MBEDCRYPTO_LIBRARIES} mbedcrypto libmbedcrypto
|
||||
HINTS
|
||||
ENV mbedcryptoPath${_lib_suffix}
|
||||
ENV mbedcryptoPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${mbedcryptoPath${_lib_suffix}}
|
||||
${mbedcryptoPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_MBEDCRYPTO_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
MBEDCRYPTO_LIB
|
||||
NAMES ${_MBEDCRYPTO_LIBRARIES} mbedcrypto libmbedcrypto
|
||||
HINTS ENV MBEDCRYPTO_PATH ${MBEDCRYPTO_PATH}
|
||||
${CMAKE_SOURCE_DIR}/${MBEDCRYPTO_PATH} ${_MBEDCRYPTO_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
find_library(MBEDX509_LIB
|
||||
NAMES ${_MBEDX509_LIBRARIES} mbedx509 libmbedx509
|
||||
HINTS
|
||||
ENV mbedx509Path${_lib_suffix}
|
||||
ENV mbedx509Path
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${mbedx509Path${_lib_suffix}}
|
||||
${mbedx509Path}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_MBEDX509_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
find_library(
|
||||
MBEDX509_LIB
|
||||
NAMES ${_MBEDX509_LIBRARIES} mbedx509 libmbedx509
|
||||
HINTS ENV MBEDX509_PATH ${MBEDX509_PATH} ${CMAKE_SOURCE_DIR}/${MBEDX509_PATH}
|
||||
${_MBEDX509_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
# Sometimes mbedtls is split between three libs, and sometimes it isn't.
|
||||
# If it isn't, let's check if the symbols we need are all in MBEDTLS_LIB.
|
||||
if(MBEDTLS_LIB AND NOT MBEDCRYPTO_LIB AND NOT MBEDX509_LIB)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${MBEDTLS_LIB})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${MBEDTLS_INCLUDE_DIR})
|
||||
check_symbol_exists(mbedtls_x509_crt_init "mbedtls/x509_crt.h" MBEDTLS_INCLUDES_X509)
|
||||
check_symbol_exists(mbedtls_sha256_init "mbedtls/sha256.h" MBEDTLS_INCLUDES_CRYPTO)
|
||||
unset(CMAKE_REQUIRED_INCLUDES)
|
||||
unset(CMAKE_REQUIRED_LIBRARIES)
|
||||
# Sometimes mbedtls is split between three libs, and sometimes it isn't. If it
|
||||
# isn't, let's check if the symbols we need are all in MBEDTLS_LIB.
|
||||
if(MBEDTLS_LIB
|
||||
AND NOT MBEDCRYPTO_LIB
|
||||
AND NOT MBEDX509_LIB)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${MBEDTLS_LIB})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${MBEDTLS_INCLUDE_DIR})
|
||||
check_symbol_exists(mbedtls_x509_crt_init "mbedtls/x509_crt.h"
|
||||
MBEDTLS_INCLUDES_X509)
|
||||
check_symbol_exists(mbedtls_sha256_init "mbedtls/sha256.h"
|
||||
MBEDTLS_INCLUDES_CRYPTO)
|
||||
unset(CMAKE_REQUIRED_INCLUDES)
|
||||
unset(CMAKE_REQUIRED_LIBRARIES)
|
||||
endif()
|
||||
|
||||
# If we find all three libraries, then go ahead.
|
||||
if(MBEDTLS_LIB AND MBEDCRYPTO_LIB AND MBEDX509_LIB)
|
||||
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
|
||||
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIB} ${MBEDCRYPTO_LIB} ${MBEDX509_LIB})
|
||||
if(MBEDTLS_LIB
|
||||
AND MBEDCRYPTO_LIB
|
||||
AND MBEDX509_LIB)
|
||||
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
|
||||
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIB} ${MBEDCRYPTO_LIB} ${MBEDX509_LIB})
|
||||
|
||||
# Otherwise, if we find MBEDTLS_LIB, and it has both CRYPTO and x509
|
||||
# within the single lib (i.e. a windows build environment), then also
|
||||
# feel free to go ahead.
|
||||
elseif(MBEDTLS_LIB AND MBEDTLS_INCLUDES_CRYPTO AND MBEDTLS_INCLUDES_X509)
|
||||
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
|
||||
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIB})
|
||||
foreach(component TLS CRYPTO X509)
|
||||
if(NOT TARGET Mbedtls::${component} AND MBED${component}_LIB)
|
||||
if(IS_ABSOLUTE "${MBED${component}_LIB}")
|
||||
add_library(Mbedtls::${component} UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
Mbedtls::${component} PROPERTIES IMPORTED_LOCATION
|
||||
"${MBED${component}_LIB}")
|
||||
else()
|
||||
add_library(Mbedtls::${component} INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
Mbedtls::${component} PROPERTIES IMPORTED_LIBNAME
|
||||
"${MBED${component}_LIB}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
Mbedtls::${component} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${MBED${component}_INCLUDE_DIR}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT TARGET Mbedtls::Mbedtls)
|
||||
add_library(Mbedtls::Mbedtls INTERFACE IMPORTED)
|
||||
target_link_libraries(Mbedtls::Mbedtls
|
||||
INTERFACE Mbedtls::TLS Mbedtls::CRYPTO Mbedtls::X509)
|
||||
endif()
|
||||
|
||||
# Otherwise, if we find MBEDTLS_LIB, and it has both CRYPTO and x509 within
|
||||
# the single lib (i.e. a windows build environment), then also feel free to go
|
||||
# ahead.
|
||||
elseif(
|
||||
MBEDTLS_LIB
|
||||
AND MBEDTLS_INCLUDES_CRYPTO
|
||||
AND MBEDTLS_INCLUDES_X509)
|
||||
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
|
||||
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIB})
|
||||
|
||||
if(NOT TARGET Mbedtls::Mbedtls)
|
||||
if(IS_ABSOLUTE "${MBED${component}_LIB}")
|
||||
add_library(Mbedtls::${component} UNKNOWN IMPORTED)
|
||||
set_target_properties(Mbedtls::${component}
|
||||
PROPERTIES IMPORTED_LOCATION "${MBEDTLS_LIBRARIES}")
|
||||
else()
|
||||
add_library(Mbedtls::${component} INTERFACE IMPORTED)
|
||||
set_target_properties(Mbedtls::${component}
|
||||
PROPERTIES IMPORTED_LIBNAME "${MBEDTLS_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
Mbedtls::${component} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${MBEDTLS_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Now we've accounted for the 3-vs-1 library case:
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MbedTLS DEFAULT_MSG MBEDTLS_LIBRARIES MBEDTLS_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(MbedTLS DEFAULT_MSG MBEDTLS_LIBRARIES
|
||||
MBEDTLS_INCLUDE_DIRS)
|
||||
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIB MBEDCRYPTO_LIB MBEDX509_LIB)
|
||||
|
||||
|
|
|
@ -1,33 +1,36 @@
|
|||
# Try to find OSS on a *nix system
|
||||
#
|
||||
# OSS_FOUND - True if OSS is available
|
||||
# OSS_INCLUDE_DIR - Include directory of OSS header
|
||||
# OSS_HEADER_NAME - OSS header file name
|
||||
# OSS_FOUND - True if OSS is available OSS_INCLUDE_DIR - Include
|
||||
# directory of OSS header OSS_HEADER_NAME - OSS header file name
|
||||
#
|
||||
|
||||
IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
set(OSS_HEADER_NAME "sys/soundcard.h")
|
||||
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "DragonFly")
|
||||
set(OSS_HEADER_NAME "sys/soundcard.h")
|
||||
ENDIF()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
set(OSS_HEADER_NAME "sys/soundcard.h")
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly")
|
||||
set(OSS_HEADER_NAME "sys/soundcard.h")
|
||||
endif()
|
||||
|
||||
find_path(OSS_INCLUDE_DIR "${OSS_HEADER_NAME}"
|
||||
"/usr/include"
|
||||
"/usr/local/include"
|
||||
)
|
||||
find_path(OSS_INCLUDE_DIR "${OSS_HEADER_NAME}" "/usr/include"
|
||||
"/usr/local/include")
|
||||
|
||||
if (OSS_INCLUDE_DIR)
|
||||
set(OSS_FOUND True)
|
||||
else (OSS_INCLUDE_DIR)
|
||||
set(OSS_FOUND)
|
||||
endif (OSS_INCLUDE_DIR)
|
||||
if(OSS_INCLUDE_DIR)
|
||||
set(OSS_FOUND True)
|
||||
else(OSS_INCLUDE_DIR)
|
||||
set(OSS_FOUND)
|
||||
endif(OSS_INCLUDE_DIR)
|
||||
|
||||
if (OSS_FOUND)
|
||||
message(STATUS "Found OSS header: ${OSS_INCLUDE_DIR}/${OSS_HEADER_NAME}")
|
||||
else (OSS_FOUND)
|
||||
if (OSS_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find OSS header file")
|
||||
endif (OSS_FIND_REQUIRED)
|
||||
endif (OSS_FOUND)
|
||||
if(OSS_FOUND)
|
||||
message(STATUS "Found OSS header: ${OSS_INCLUDE_DIR}/${OSS_HEADER_NAME}")
|
||||
else(OSS_FOUND)
|
||||
if(OSS_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find OSS header file")
|
||||
endif(OSS_FIND_REQUIRED)
|
||||
endif(OSS_FOUND)
|
||||
|
||||
mark_as_advanced(OSS_FOUND OSS_INCLUDE_DIR OSS_HEADER_NAME)
|
||||
|
||||
if(OSS_FOUND AND NOT TARGET OSS::OSS)
|
||||
add_library(OSS::OSS INTERFACE IMPORTED)
|
||||
set_target_properties(OSS::OSS PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${OSS_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
|
|
@ -1,65 +1,56 @@
|
|||
#.rst:
|
||||
# FindPipeWire
|
||||
# .rst: FindPipeWire
|
||||
# -------
|
||||
#
|
||||
# Try to find PipeWire on a Unix system.
|
||||
#
|
||||
# This will define the following variables:
|
||||
#
|
||||
# ``PIPEWIRE_FOUND``
|
||||
# True if (the requested version of) PipeWire is available
|
||||
# ``PIPEWIRE_VERSION``
|
||||
# The version of PipeWire
|
||||
# ``PIPEWIRE_LIBRARIES``
|
||||
# This can be passed to target_link_libraries() instead of the ``PipeWire::PipeWire``
|
||||
# target
|
||||
# ``PIPEWIRE_INCLUDE_DIRS``
|
||||
# This should be passed to target_include_directories() if the target is not
|
||||
# used for linking
|
||||
# ``PIPEWIRE_DEFINITIONS``
|
||||
# This should be passed to target_compile_options() if the target is not
|
||||
# used for linking
|
||||
# ``PIPEWIRE_FOUND`` True if (the requested version of) PipeWire is available
|
||||
# ``PIPEWIRE_VERSION`` The version of PipeWire ``PIPEWIRE_LIBRARIES`` This can
|
||||
# be passed to target_link_libraries() instead of the ``PipeWire::PipeWire``
|
||||
# target ``PIPEWIRE_INCLUDE_DIRS`` This should be passed to
|
||||
# target_include_directories() if the target is not used for linking
|
||||
# ``PIPEWIRE_DEFINITIONS`` This should be passed to target_compile_options() if
|
||||
# the target is not used for linking
|
||||
#
|
||||
# If ``PIPEWIRE_FOUND`` is TRUE, it will also define the following imported target:
|
||||
# If ``PIPEWIRE_FOUND`` is TRUE, it will also define the following imported
|
||||
# target:
|
||||
#
|
||||
# ``PipeWire::PipeWire``
|
||||
# The PipeWire library
|
||||
# ``PipeWire::PipeWire`` The PipeWire library
|
||||
#
|
||||
# In general we recommend using the imported target, as it is easier to use.
|
||||
# Bear in mind, however, that if the target is in the link interface of an
|
||||
# exported library, it must be made available by the package config file.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2014 Alex Merry <alex.merry@kde.org>
|
||||
# Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
|
||||
# Copyright 2018-2020 Jan Grulich <jgrulich@redhat.com>
|
||||
# =============================================================================
|
||||
# Copyright 2014 Alex Merry <alex.merry@kde.org> Copyright 2014 Martin Gräßlin
|
||||
# <mgraesslin@kde.org> Copyright 2018-2020 Jan Grulich <jgrulich@redhat.com>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 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.
|
||||
# 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.
|
||||
#=============================================================================
|
||||
# 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.
|
||||
# =============================================================================
|
||||
|
||||
# Use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
# Use pkg-config to get the directories and then use these values in the
|
||||
# FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_search_module(PKG_PIPEWIRE QUIET libpipewire-0.3)
|
||||
|
@ -68,54 +59,42 @@ pkg_search_module(PKG_SPA QUIET libspa-0.2)
|
|||
set(PIPEWIRE_DEFINITIONS "${PKG_PIPEWIRE_CFLAGS}" "${PKG_SPA_CFLAGS}")
|
||||
set(PIPEWIRE_VERSION "${PKG_PIPEWIRE_VERSION}")
|
||||
|
||||
find_path(PIPEWIRE_INCLUDE_DIRS
|
||||
NAMES
|
||||
pipewire/pipewire.h
|
||||
HINTS
|
||||
${PKG_PIPEWIRE_INCLUDE_DIRS}
|
||||
${PKG_PIPEWIRE_INCLUDE_DIRS}/pipewire-0.3
|
||||
)
|
||||
find_path(
|
||||
PIPEWIRE_INCLUDE_DIRS
|
||||
NAMES pipewire/pipewire.h
|
||||
HINTS ${PKG_PIPEWIRE_INCLUDE_DIRS} ${PKG_PIPEWIRE_INCLUDE_DIRS}/pipewire-0.3)
|
||||
|
||||
find_path(SPA_INCLUDE_DIRS
|
||||
NAMES
|
||||
spa/param/props.h
|
||||
HINTS
|
||||
${PKG_SPA_INCLUDE_DIRS}
|
||||
${PKG_SPA_INCLUDE_DIRS}/spa-0.2
|
||||
)
|
||||
find_path(
|
||||
SPA_INCLUDE_DIRS
|
||||
NAMES spa/param/props.h
|
||||
HINTS ${PKG_SPA_INCLUDE_DIRS} ${PKG_SPA_INCLUDE_DIRS}/spa-0.2)
|
||||
|
||||
find_library(PIPEWIRE_LIBRARIES
|
||||
NAMES
|
||||
pipewire-0.3
|
||||
HINTS
|
||||
${PKG_PIPEWIRE_LIBRARY_DIRS}
|
||||
)
|
||||
find_library(
|
||||
PIPEWIRE_LIBRARIES
|
||||
NAMES pipewire-0.3
|
||||
HINTS ${PKG_PIPEWIRE_LIBRARY_DIRS})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(PipeWire
|
||||
FOUND_VAR
|
||||
PIPEWIRE_FOUND
|
||||
REQUIRED_VARS
|
||||
PIPEWIRE_LIBRARIES
|
||||
PIPEWIRE_INCLUDE_DIRS
|
||||
SPA_INCLUDE_DIRS
|
||||
VERSION_VAR
|
||||
PIPEWIRE_VERSION
|
||||
)
|
||||
find_package_handle_standard_args(
|
||||
PipeWire
|
||||
FOUND_VAR PIPEWIRE_FOUND
|
||||
REQUIRED_VARS PIPEWIRE_LIBRARIES PIPEWIRE_INCLUDE_DIRS SPA_INCLUDE_DIRS
|
||||
VERSION_VAR PIPEWIRE_VERSION)
|
||||
|
||||
if(PIPEWIRE_FOUND AND NOT TARGET PipeWire::PipeWire)
|
||||
add_library(PipeWire::PipeWire UNKNOWN IMPORTED)
|
||||
set_target_properties(PipeWire::PipeWire PROPERTIES
|
||||
IMPORTED_LOCATION "${PIPEWIRE_LIBRARIES}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PIPEWIRE_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PIPEWIRE_INCLUDE_DIRS};${SPA_INCLUDE_DIRS}"
|
||||
)
|
||||
add_library(PipeWire::PipeWire UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
PipeWire::PipeWire
|
||||
PROPERTIES IMPORTED_LOCATION "${PIPEWIRE_LIBRARIES}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PIPEWIRE_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${PIPEWIRE_INCLUDE_DIRS};${SPA_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(PIPEWIRE_LIBRARIES PIPEWIRE_INCLUDE_DIRS)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(PipeWire PROPERTIES
|
||||
URL "https://www.pipewire.org"
|
||||
DESCRIPTION "PipeWire - multimedia processing"
|
||||
)
|
||||
set_package_properties(
|
||||
PipeWire PROPERTIES
|
||||
URL "https://www.pipewire.org"
|
||||
DESCRIPTION "PipeWire - multimedia processing")
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# PYTHON_FOUND
|
||||
# PYTHON_INCLUDE_DIRS
|
||||
# PYTHON_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# PYTHON_INCLUDE_DIR
|
||||
|
||||
if(NOT WIN32)
|
||||
set(Python_ADDITIONAL_VERSIONS 3.4)
|
||||
find_package(PythonLibs QUIET 3.4)
|
||||
return()
|
||||
endif()
|
||||
|
||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(_LIB_SUFFIX 64)
|
||||
ELSE()
|
||||
SET(_LIB_SUFFIX 32)
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(PYTHON_INCLUDE_DIR
|
||||
NAMES Python.h
|
||||
HINTS
|
||||
ENV PythonPath${_LIB_SUFFIX}
|
||||
ENV PythonPath
|
||||
ENV DepsPath${_LIB_SUFFIX}
|
||||
ENV DepsPath
|
||||
${PythonPath${_LIB_SUFFIX}}
|
||||
${PythonPath}
|
||||
${DepsPath${_LIB_SUFFIX}}
|
||||
${DepsPath}
|
||||
${_PYTHON_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
include/python
|
||||
)
|
||||
|
||||
find_library(PYTHON_LIB
|
||||
NAMES ${_PYTHON_LIBRARIES} python36
|
||||
HINTS
|
||||
ENV PythonPath${_lib_suffix}
|
||||
ENV PythonPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${PythonPath${_lib_suffix}}
|
||||
${PythonPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_PYTHON_LIBRARY_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Python DEFAULT_MSG PYTHON_LIB PYTHON_INCLUDE_DIR)
|
||||
mark_as_advanced(PYTHON_INCLUDE_DIR PYTHON_LIB)
|
||||
|
||||
if(PYTHON_FOUND)
|
||||
set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
|
||||
set(PYTHON_LIBRARIES ${PYTHON_LIB})
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
endif()
|
|
@ -0,0 +1,65 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# PYTHON_FOUND PYTHON_INCLUDE_DIRS PYTHON_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# PYTHON_INCLUDE_DIR
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_LIB_SUFFIX 64)
|
||||
else()
|
||||
set(_LIB_SUFFIX 32)
|
||||
endif()
|
||||
|
||||
find_path(
|
||||
PYTHON_INCLUDE_DIR
|
||||
NAMES Python.h
|
||||
HINTS ${_PYTHON_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES include include/python)
|
||||
|
||||
find_library(
|
||||
PYTHON_LIB
|
||||
NAMES ${_PYTHON_LIBRARIES} python36
|
||||
HINTS ${_PYTHON_LIBRARY_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix}
|
||||
lib
|
||||
libs${_lib_suffix}
|
||||
libs
|
||||
bin${_lib_suffix}
|
||||
bin
|
||||
../lib${_lib_suffix}
|
||||
../lib
|
||||
../libs${_lib_suffix}
|
||||
../libs
|
||||
../bin${_lib_suffix}
|
||||
../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(PythonWindows DEFAULT_MSG PYTHON_LIB
|
||||
PYTHON_INCLUDE_DIR)
|
||||
mark_as_advanced(PYTHON_INCLUDE_DIR PYTHON_LIB)
|
||||
|
||||
if(PYTHONWINDOWS_FOUND)
|
||||
set(Python_FOUND TRUE)
|
||||
set(Python_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
|
||||
set(Python_LIBRARIES ${PYTHON_LIB})
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
|
||||
if(NOT TARGET Python::Python)
|
||||
if(IS_ABSOLUTE "${Python_LIBRARIES}")
|
||||
add_library(Python::Python UNKNOWN IMPORTED)
|
||||
set_target_properties(Python::Python PROPERTIES IMPORTED_LOCATION
|
||||
"${Python_LIBRARIES}")
|
||||
else()
|
||||
add_library(Python::Python INTERFACE IMPORTED)
|
||||
set_target_properties(Python::Python PROPERTIES IMPORTED_LIBNAME
|
||||
"${Python_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
Python::Python PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${Python_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
|
@ -1,40 +1,49 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# RSSDK_FOUND
|
||||
# RSSDK_INCLUDE_DIRS
|
||||
# RSSDK_LIBRARIES
|
||||
# RSSDK_FOUND RSSDK_INCLUDE_DIRS RSSDK_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# RSSDK_INCLUDE_DIR
|
||||
# RSSDK_INCLUDE_DIR
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_RSSDK_lib_dir "x64")
|
||||
set(_RSSDK_lib_dir "x64")
|
||||
else()
|
||||
set(_RSSDK_lib_dir "Win32")
|
||||
set(_RSSDK_lib_dir "Win32")
|
||||
endif()
|
||||
|
||||
find_path(RSSDK_INCLUDE_DIR
|
||||
NAMES pxcsession.h
|
||||
HINTS
|
||||
ENV RSSDK_DIR
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
find_path(
|
||||
RSSDK_INCLUDE_DIR
|
||||
NAMES pxcsession.h
|
||||
HINTS ENV RSSDK_DIR
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(RSSDK_LIB
|
||||
NAMES libpxc
|
||||
HINTS
|
||||
ENV RSSDK_DIR
|
||||
PATH_SUFFIXES
|
||||
lib/${_RSSDK_lib_dir}
|
||||
)
|
||||
find_library(
|
||||
RSSDK_LIB
|
||||
NAMES libpxc
|
||||
HINTS ENV RSSDK_DIR
|
||||
PATH_SUFFIXES lib/${_RSSDK_lib_dir})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(RSSDK DEFAULT_MSG RSSDK_LIB RSSDK_INCLUDE_DIR)
|
||||
mark_as_advanced(RSSDK_INCLUDE_DIR RSSDK_LIB)
|
||||
|
||||
if(RSSDK_FOUND)
|
||||
set(RSSDK_INCLUDE_DIRS ${RSSDK_INCLUDE_DIR})
|
||||
set(RSSDK_LIBRARIES ${RSSDK_LIB})
|
||||
endif()
|
||||
set(RSSDK_INCLUDE_DIRS ${RSSDK_INCLUDE_DIR})
|
||||
set(RSSDK_LIBRARIES ${RSSDK_LIB})
|
||||
|
||||
if(NOT TARGET RSS::SDK)
|
||||
if(IS_ABSOLUTE "${RSSDK_LIBRARIES}")
|
||||
add_library(RSS:SDK UNKNOWN IMPORTED)
|
||||
set_target_properties(RSS:SDK PROPERTIES IMPORTED_LOCATION
|
||||
"${RSSDK_LIBRARIES}")
|
||||
else()
|
||||
add_library(RSS:SDK INTERFACE IMPORTED)
|
||||
set_target_properties(RSS:SDK PROPERTIES IMPORTED_LIBNAME
|
||||
"${RSSDK_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(RSS:SDK PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${RSSDK_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -45,12 +45,10 @@ find_path(Sndio_INCLUDE_DIR sndio.h)
|
|||
find_library(Sndio_LIBRARY sndio)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Sndio
|
||||
find_package_handle_standard_args(
|
||||
Sndio
|
||||
FOUND_VAR Sndio_FOUND
|
||||
REQUIRED_VARS
|
||||
Sndio_LIBRARY
|
||||
Sndio_INCLUDE_DIR
|
||||
)
|
||||
REQUIRED_VARS Sndio_LIBRARY Sndio_INCLUDE_DIR)
|
||||
|
||||
if(Sndio_FOUND)
|
||||
set(Sndio_LIBRARIES ${Sndio_LIBRARY})
|
||||
|
@ -59,13 +57,10 @@ endif()
|
|||
|
||||
if(Sndio_FOUND AND NOT TARGET Sndio::Sndio)
|
||||
add_library(Sndio::Sndio UNKNOWN IMPORTED)
|
||||
set_target_properties(Sndio::Sndio PROPERTIES
|
||||
IMPORTED_LOCATION "${Sndio_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Sndio_INCLUDE_DIR}"
|
||||
)
|
||||
set_target_properties(
|
||||
Sndio::Sndio
|
||||
PROPERTIES IMPORTED_LOCATION "${Sndio_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Sndio_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
Sndio_INCLUDE_DIR
|
||||
Sndio_LIBRARY
|
||||
)
|
||||
mark_as_advanced(Sndio_INCLUDE_DIR Sndio_LIBRARY)
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
if(DEFINED SWIGDIR)
|
||||
list(APPEND CMAKE_PREFIX_PATH "${SWIGDIR}")
|
||||
elseif(DEFINED ENV{SWIGDIR})
|
||||
list(APPEND CMAKE_PREFIX_PATH "$ENV{SWIGDIR}")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(_LIB_SUFFIX 64)
|
||||
ELSE()
|
||||
SET(_LIB_SUFFIX 32)
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(SWIG_DIR
|
||||
NAMES swigrun.i
|
||||
HINTS
|
||||
ENV SwigPath${_LIB_SUFFIX}
|
||||
ENV SwigPath
|
||||
ENV DepsPath${_LIB_SUFFIX}
|
||||
ENV DepsPath
|
||||
${SwigPath${_LIB_SUFFIX}}
|
||||
${SwigPath}
|
||||
${DepsPath${_LIB_SUFFIX}}
|
||||
${DepsPath}
|
||||
${_PYTHON_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES
|
||||
../swig/Lib
|
||||
swig/Lib
|
||||
)
|
||||
|
||||
find_program(SWIG_EXECUTABLE
|
||||
NAMES swig
|
||||
HINTS
|
||||
ENV SwigPath${_LIB_SUFFIX}
|
||||
ENV SwigPath
|
||||
ENV DepsPath${_LIB_SUFFIX}
|
||||
ENV DepsPath
|
||||
${SwigPath${_LIB_SUFFIX}}
|
||||
${SwigPath}
|
||||
${DepsPath${_LIB_SUFFIX}}
|
||||
${DepsPath}
|
||||
${_PYTHON_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES
|
||||
../swig
|
||||
swig
|
||||
)
|
||||
endif()
|
||||
|
||||
find_package(SWIG QUIET 2)
|
|
@ -0,0 +1,19 @@
|
|||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_LIB_SUFFIX 64)
|
||||
else()
|
||||
set(_LIB_SUFFIX 32)
|
||||
endif()
|
||||
|
||||
find_path(
|
||||
SWIG_DIR
|
||||
NAMES swigrun.i
|
||||
HINTS ENV SWIG_PATH ${SWIG_PATH} ${CMAKE_SOURCE_DIR}/${SWIG_PATH}
|
||||
PATH_SUFFIXES ../swig/Lib swig/Lib)
|
||||
|
||||
find_program(
|
||||
SWIG_EXECUTABLE
|
||||
NAMES swig
|
||||
HINTS ENV SWIG_PATH ${SWIG_PATH} ${CMAKE_SOURCE_DIR}/${SWIG_PATH}
|
||||
PATH_SUFFIXES ../swig swig)
|
||||
|
||||
find_package(SWIG QUIET 2)
|
|
@ -0,0 +1,39 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# SYSINFO_FOUND SYSINFO_INCLUDE_DIRS SYSINFO_LIBRARIES
|
||||
|
||||
find_path(
|
||||
SYSINFO_INCLUDE_DIR
|
||||
NAMES sys/sysinfo.h
|
||||
PATHS /usr/include /usr/local/include /opt/local/include)
|
||||
|
||||
find_library(
|
||||
SYSINFO_LIB
|
||||
NAMES sysinfo libsysinfo
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Sysinfo DEFAULT_MSG SYSINFO_LIB
|
||||
SYSINFO_INCLUDE_DIR)
|
||||
mark_as_advanced(SYSINFO_INCLUDE_DIR SYSINFO_LIB)
|
||||
|
||||
if(SYSINFO_FOUND)
|
||||
set(SYSINFO_INCLUDE_DIRS ${SYSINFO_INCLUDE_DIR})
|
||||
set(SYSINFO_LIBRARIES ${SYSINFO_LIB})
|
||||
|
||||
if(NOT TARGET Sysinfo::Sysinfo)
|
||||
if(IS_ABSOLUTE "${SYSINFO_LIBRARIES}")
|
||||
add_library(Sysinfo::Sysinfo UNKNOWN IMPORTED)
|
||||
set_target_properties(Sysinfo::Sysinfo PROPERTIES IMPORTED_LOCATION
|
||||
"${SYSINFO_LIBRARIES}")
|
||||
else()
|
||||
add_library(Sysinfo::Sysinfo INTERFACE IMPORTED)
|
||||
set_target_properties(Sysinfo::Sysinfo PROPERTIES IMPORTED_LIBNAME
|
||||
"${SYSINFO_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
Sysinfo::Sysinfo PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${SYSINFO_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
|
@ -1,33 +0,0 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# UDEV_FOUND
|
||||
# UDEV_INCLUDE_DIRS
|
||||
# UDEV_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_UDEV QUIET libudev)
|
||||
endif()
|
||||
|
||||
find_path(UDEV_INCLUDE_DIR
|
||||
NAMES libudev.h
|
||||
HINTS
|
||||
${_UDEV_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include)
|
||||
|
||||
find_library(UDEV_LIB
|
||||
NAMES udev libudev
|
||||
HINTS
|
||||
${_UDEV_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(UDev DEFAULT_MSG UDEV_LIB UDEV_INCLUDE_DIR)
|
||||
mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIB)
|
||||
|
||||
if(UDEV_FOUND)
|
||||
set(UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR})
|
||||
set(UDEV_LIBRARIES ${UDEV_LIB})
|
||||
endif()
|
|
@ -0,0 +1,44 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# UDEV_FOUND UDEV_INCLUDE_DIRS UDEV_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_UDEV QUIET libudev)
|
||||
endif()
|
||||
|
||||
find_path(
|
||||
UDEV_INCLUDE_DIR
|
||||
NAMES libudev.h
|
||||
HINTS ${_UDEV_INCLUDE_DIRS}
|
||||
PATHS /usr/include /usr/local/include /opt/local/include)
|
||||
|
||||
find_library(
|
||||
UDEV_LIB
|
||||
NAMES udev libudev
|
||||
HINTS ${_UDEV_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Udev DEFAULT_MSG UDEV_LIB UDEV_INCLUDE_DIR)
|
||||
mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIB)
|
||||
|
||||
if(UDEV_FOUND)
|
||||
set(UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR})
|
||||
set(UDEV_LIBRARIES ${UDEV_LIB})
|
||||
|
||||
if(NOT TARGET Udev::Udev)
|
||||
if(IS_ABSOLUTE "${UDEV_LIBRARIES}")
|
||||
add_library(Udev::Udev UNKNOWN IMPORTED)
|
||||
set_target_properties(Udev::Udev PROPERTIES IMPORTED_LOCATION
|
||||
"${UDEV_LIBRARIES}")
|
||||
else()
|
||||
add_library(Udev::Udev INTERFACE IMPORTED)
|
||||
set_target_properties(Udev::Udev PROPERTIES IMPORTED_LIBNAME
|
||||
"${UDEV_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(Udev::Udev PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${UDEV_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
|
@ -1,70 +0,0 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# VULKAN_FOUND
|
||||
# VULKAN_INCLUDE_DIRS
|
||||
# VULKAN_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# VULKAN_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_VULKAN QUIET vulkan)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(VULKAN_INCLUDE_DIR
|
||||
NAMES vulkan/vulkan.h
|
||||
HINTS
|
||||
ENV vulkanPath${_lib_suffix}
|
||||
ENV vulkanPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
ENV VULKAN_SDK
|
||||
${vulkanPath${_lib_suffix}}
|
||||
${vulkanPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_VULKAN_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
|
||||
find_library(VULKAN_LIB
|
||||
NAMES ${_VULKAN_LIBRARIES} vulkan-1 vulkan libvulkan
|
||||
HINTS
|
||||
ENV vulkanPath${_lib_suffix}
|
||||
ENV vulkanPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
ENV VULKAN_SDK
|
||||
${vulkanPath${_lib_suffix}}
|
||||
${vulkanPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_VULKAN_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Vulkan DEFAULT_MSG VULKAN_LIB VULKAN_INCLUDE_DIR)
|
||||
mark_as_advanced(VULKAN_INCLUDE_DIR VULKAN_LIB)
|
||||
|
||||
if(VULKAN_FOUND)
|
||||
set(VULKAN_INCLUDE_DIRS ${VULKAN_INCLUDE_DIR})
|
||||
set(VULKAN_LIBRARIES ${VULKAN_LIB})
|
||||
endif()
|
|
@ -2,77 +2,131 @@
|
|||
#
|
||||
# This will define:
|
||||
#
|
||||
# WAYLAND_FOUND - True if Wayland is found
|
||||
# WAYLAND_LIBRARIES - Link these to use Wayland
|
||||
# WAYLAND_INCLUDE_DIRS - Include directory for Wayland
|
||||
# WAYLAND_DEFINITIONS - Compiler flags for using Wayland
|
||||
# WAYLAND_FOUND - True if Wayland is found WAYLAND_LIBRARIES - Link
|
||||
# these to use Wayland WAYLAND_INCLUDE_DIRS - Include directory for Wayland
|
||||
# WAYLAND_DEFINITIONS - Compiler flags for using Wayland
|
||||
#
|
||||
# In addition the following more fine grained variables will be defined:
|
||||
#
|
||||
# Wayland_Client_FOUND WAYLAND_CLIENT_INCLUDE_DIRS WAYLAND_CLIENT_LIBRARIES
|
||||
# Wayland_Server_FOUND WAYLAND_SERVER_INCLUDE_DIRS WAYLAND_SERVER_LIBRARIES
|
||||
# Wayland_EGL_FOUND WAYLAND_EGL_INCLUDE_DIRS WAYLAND_EGL_LIBRARIES
|
||||
# Wayland_Cursor_FOUND WAYLAND_CURSOR_INCLUDE_DIRS WAYLAND_CURSOR_LIBRARIES
|
||||
# Wayland_Client_FOUND WAYLAND_CLIENT_INCLUDE_DIRS WAYLAND_CLIENT_LIBRARIES
|
||||
# Wayland_Server_FOUND WAYLAND_SERVER_INCLUDE_DIRS WAYLAND_SERVER_LIBRARIES
|
||||
# Wayland_EGL_FOUND WAYLAND_EGL_INCLUDE_DIRS WAYLAND_EGL_LIBRARIES
|
||||
# Wayland_Cursor_FOUND WAYLAND_CURSOR_INCLUDE_DIRS WAYLAND_CURSOR_LIBRARIES
|
||||
#
|
||||
# Copyright (c) 2013 Martin Gräßlin <mgraesslin@kde.org>
|
||||
# 2020 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||
# Copyright (c) 2013 Martin Gräßlin <mgraesslin@kde.org> 2020 Georges Basile
|
||||
# Stavracas Neto <georges.stavracas@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
IF (NOT WIN32)
|
||||
# Use pkg-config to get the directories and then use these values in the
|
||||
# find_path() and find_library() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKG_WAYLAND QUIET wayland-client wayland-server wayland-egl
|
||||
wayland-cursor)
|
||||
|
||||
# Use pkg-config to get the directories and then use these values
|
||||
# in the find_path() and find_library() calls
|
||||
find_package(PkgConfig)
|
||||
PKG_CHECK_MODULES(PKG_WAYLAND QUIET wayland-client wayland-server wayland-egl wayland-cursor)
|
||||
set(WAYLAND_DEFINITIONS ${PKG_WAYLAND_CFLAGS})
|
||||
|
||||
set(WAYLAND_DEFINITIONS ${PKG_WAYLAND_CFLAGS})
|
||||
find_path(
|
||||
WAYLAND_CLIENT_INCLUDE_DIRS
|
||||
NAMES wayland-client.h
|
||||
HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
find_library(
|
||||
WAYLAND_CLIENT_LIBRARIES
|
||||
NAMES wayland-client
|
||||
HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
if(WAYLAND_CLIENT_INCLUDE_DIRS AND WAYLAND_CLIENT_LIBRARIES)
|
||||
set(Wayland_Client_FOUND TRUE)
|
||||
else()
|
||||
set(Wayland_Client_FOUND FALSE)
|
||||
endif()
|
||||
mark_as_advanced(WAYLAND_CLIENT_INCLUDE_DIRS WAYLAND_CLIENT_LIBRARIES)
|
||||
|
||||
find_path(WAYLAND_CLIENT_INCLUDE_DIRS NAMES wayland-client.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
find_library(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
if(WAYLAND_CLIENT_INCLUDE_DIRS AND WAYLAND_CLIENT_LIBRARIES)
|
||||
set(Wayland_Client_FOUND TRUE)
|
||||
else()
|
||||
set(Wayland_Client_FOUND FALSE)
|
||||
find_path(
|
||||
WAYLAND_CURSOR_INCLUDE_DIRS
|
||||
NAMES wayland-cursor.h
|
||||
HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
find_library(
|
||||
WAYLAND_CURSOR_LIBRARIES
|
||||
NAMES wayland-cursor
|
||||
HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
if(WAYLAND_CURSOR_INCLUDE_DIRS AND WAYLAND_CURSOR_LIBRARIES)
|
||||
set(Wayland_Cursor_FOUND TRUE)
|
||||
else()
|
||||
set(Wayland_Cursor_FOUND FALSE)
|
||||
endif()
|
||||
mark_as_advanced(WAYLAND_CURSOR_INCLUDE_DIRS WAYLAND_CURSOR_LIBRARIES)
|
||||
|
||||
find_path(
|
||||
WAYLAND_EGL_INCLUDE_DIRS
|
||||
NAMES wayland-egl.h
|
||||
HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
find_library(
|
||||
WAYLAND_EGL_LIBRARIES
|
||||
NAMES wayland-egl
|
||||
HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
if(WAYLAND_EGL_INCLUDE_DIRS AND WAYLAND_EGL_LIBRARIES)
|
||||
set(Wayland_EGL_FOUND TRUE)
|
||||
else()
|
||||
set(Wayland_EGL_FOUND FALSE)
|
||||
endif()
|
||||
mark_as_advanced(WAYLAND_EGL_INCLUDE_DIRS WAYLAND_EGL_LIBRARIES)
|
||||
|
||||
find_path(
|
||||
WAYLAND_SERVER_INCLUDE_DIRS
|
||||
NAMES wayland-server.h
|
||||
HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
find_library(
|
||||
WAYLAND_SERVER_LIBRARIES
|
||||
NAMES wayland-server
|
||||
HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
if(WAYLAND_SERVER_INCLUDE_DIRS AND WAYLAND_SERVER_LIBRARIES)
|
||||
set(Wayland_Server_FOUND TRUE)
|
||||
else()
|
||||
set(Wayland_Server_FOUND FALSE)
|
||||
endif()
|
||||
mark_as_advanced(WAYLAND_SERVER_INCLUDE_DIRS WAYLAND_SERVER_LIBRARIES)
|
||||
|
||||
set(WAYLAND_INCLUDE_DIRS
|
||||
${WAYLAND_CLIENT_INCLUDE_DIRS} ${WAYLAND_SERVER_INCLUDE_DIRS}
|
||||
${WAYLAND_EGL_INCLUDE_DIRS} ${WAYLAND_CURSOR_INCLUDE_DIRS})
|
||||
set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES}
|
||||
${WAYLAND_EGL_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES})
|
||||
mark_as_advanced(WAYLAND_INCLUDE_DIRS WAYLAND_LIBRARIES)
|
||||
|
||||
list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIRS)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(
|
||||
Wayland
|
||||
REQUIRED_VARS WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIRS
|
||||
HANDLE_COMPONENTS)
|
||||
|
||||
foreach(component "Client" "Server" "EGL" "Cursor")
|
||||
if(NOT TARGET Wayland::${component})
|
||||
string(TOUPPER ${component} component_u)
|
||||
if(Wayland_${component}_FOUND)
|
||||
if(IS_ABSOLUTE "${WAYLAND_${component_u}_LIBRARIES}")
|
||||
add_library(Wayland::${component} UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
Wayland::${component}
|
||||
PROPERTIES IMPORTED_LOCATION "${WAYLAND_${component_u}_LIBRARIES}")
|
||||
else()
|
||||
add_library(Wayland::${component} INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
Wayland::${component}
|
||||
PROPERTIES IMPORTED_LIBNAME "${WAYLAND_${component_u}_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
Wayland::${component}
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${WAYLAND_${component_u}_INCLUDE_DIRS}")
|
||||
|
||||
set_target_properties(
|
||||
Wayland::${component} PROPERTIES INTERFACE_COMPILE_DEFINITIONS
|
||||
"${WAYLAND_DEFINITIONS}")
|
||||
endif()
|
||||
endif()
|
||||
mark_as_advanced(WAYLAND_CLIENT_INCLUDE_DIRS WAYLAND_CLIENT_LIBRARIES)
|
||||
|
||||
find_path(WAYLAND_CURSOR_INCLUDE_DIRS NAMES wayland-cursor.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
find_library(WAYLAND_CURSOR_LIBRARIES NAMES wayland-cursor HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
if(WAYLAND_CURSOR_INCLUDE_DIRS AND WAYLAND_CURSOR_LIBRARIES)
|
||||
set(Wayland_Cursor_FOUND TRUE)
|
||||
else()
|
||||
set(Wayland_Cursor_FOUND FALSE)
|
||||
endif()
|
||||
mark_as_advanced(WAYLAND_CURSOR_INCLUDE_DIRS WAYLAND_CURSOR_LIBRARIES)
|
||||
|
||||
find_path(WAYLAND_EGL_INCLUDE_DIRS NAMES wayland-egl.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
find_library(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
if(WAYLAND_EGL_INCLUDE_DIRS AND WAYLAND_EGL_LIBRARIES)
|
||||
set(Wayland_EGL_FOUND TRUE)
|
||||
else()
|
||||
set(Wayland_EGL_FOUND FALSE)
|
||||
endif()
|
||||
mark_as_advanced(WAYLAND_EGL_INCLUDE_DIRS WAYLAND_EGL_LIBRARIES)
|
||||
|
||||
find_path(WAYLAND_SERVER_INCLUDE_DIRS NAMES wayland-server.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
find_library(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
if(WAYLAND_SERVER_INCLUDE_DIRS AND WAYLAND_SERVER_LIBRARIES)
|
||||
set(Wayland_Server_FOUND TRUE)
|
||||
else()
|
||||
set(Wayland_Server_FOUND FALSE)
|
||||
endif()
|
||||
mark_as_advanced(WAYLAND_SERVER_INCLUDE_DIRS WAYLAND_SERVER_LIBRARIES)
|
||||
|
||||
set(WAYLAND_INCLUDE_DIRS ${WAYLAND_CLIENT_INCLUDE_DIRS} ${WAYLAND_SERVER_INCLUDE_DIRS} ${WAYLAND_EGL_INCLUDE_DIRS} ${WAYLAND_CURSOR_INCLUDE_DIRS})
|
||||
set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_EGL_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES})
|
||||
mark_as_advanced(WAYLAND_INCLUDE_DIRS WAYLAND_LIBRARIES)
|
||||
|
||||
list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIRS)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(Wayland REQUIRED_VARS WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIRS HANDLE_COMPONENTS)
|
||||
|
||||
ENDIF ()
|
||||
endforeach()
|
||||
|
|
|
@ -1,31 +1,45 @@
|
|||
# - Try to find libX11-xcb
|
||||
# Once done this will define
|
||||
# * Try to find libX11-xcb Once done this will define
|
||||
#
|
||||
# X11_XCB_FOUND - system has libX11-xcb
|
||||
# X11_XCB_LIBRARIES - Link these to use libX11-xcb
|
||||
# X11_XCB_INCLUDE_DIR - the libX11-xcb include dir
|
||||
# X11_XCB_FOUND - system has libX11-xcb X11_XCB_LIBRARIES - Link these to use
|
||||
# libX11-xcb X11_XCB_INCLUDE_DIR - the libX11-xcb include dir
|
||||
# X11_XCB_DEFINITIONS - compiler switches required for using libX11-xcb
|
||||
|
||||
# Copyright (c) 2011 Fredrik Höglund <fredrik@kde.org>
|
||||
# Copyright (c) 2008 Helio Chissini de Castro, <helio@kde.org>
|
||||
# Copyright (c) 2007 Matthias Kretz, <kretz@kde.org>
|
||||
# Copyright (c) 2011 Fredrik Höglund <fredrik@kde.org> Copyright (c) 2008 Helio
|
||||
# Chissini de Castro, <helio@kde.org> Copyright (c) 2007 Matthias Kretz,
|
||||
# <kretz@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
IF (NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
PKG_CHECK_MODULES(PKG_X11_XCB QUIET x11-xcb)
|
||||
if(NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values in the
|
||||
# FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKG_X11_XCB QUIET x11-xcb)
|
||||
|
||||
SET(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS})
|
||||
set(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS})
|
||||
|
||||
FIND_PATH(X11_XCB_INCLUDE_DIR NAMES X11/Xlib-xcb.h HINTS ${PKG_X11_XCB_INCLUDE_DIRS})
|
||||
FIND_LIBRARY(X11_XCB_LIBRARIES NAMES X11-xcb HINTS ${PKG_X11_XCB_LIBRARY_DIRS})
|
||||
find_path(
|
||||
X11_XCB_INCLUDE_DIR
|
||||
NAMES X11/Xlib-xcb.h
|
||||
HINTS ${PKG_X11_XCB_INCLUDE_DIRS})
|
||||
find_library(
|
||||
X11_XCB_LIBRARIES
|
||||
NAMES X11-xcb
|
||||
HINTS ${PKG_X11_XCB_LIBRARY_DIRS})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(X11_XCB DEFAULT_MSG X11_XCB_LIBRARIES X11_XCB_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(X11_XCB DEFAULT_MSG X11_XCB_LIBRARIES
|
||||
X11_XCB_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARIES)
|
||||
ENDIF (NOT WIN32)
|
||||
mark_as_advanced(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARIES)
|
||||
|
||||
if(X11_XCB_FOUND AND NOT TARGET X11::X11_xcb)
|
||||
add_library(X11::X11_xcb UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
X11::X11_xcb
|
||||
PROPERTIES IMPORTED_LOCATION "${X11_XCB_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${X11_XCB_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "XCB::XCB;X11::X11")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -2,241 +2,271 @@
|
|||
#
|
||||
# This will define:
|
||||
#
|
||||
# XCB_FOUND - True if xcb is available
|
||||
# XCB_LIBRARIES - Link these to use xcb
|
||||
# XCB_INCLUDE_DIRS - Include directory for xcb
|
||||
# XCB_DEFINITIONS - Compiler flags for using xcb
|
||||
# XCB_FOUND - True if xcb is available XCB_LIBRARIES - Link these to
|
||||
# use xcb XCB_INCLUDE_DIRS - Include directory for xcb XCB_DEFINITIONS -
|
||||
# Compiler flags for using xcb
|
||||
#
|
||||
# In addition the following more fine grained variables will be defined:
|
||||
#
|
||||
# XCB_XCB_FOUND XCB_XCB_INCLUDE_DIR XCB_XCB_LIBRARY
|
||||
# XCB_UTIL_FOUND XCB_UTIL_INCLUDE_DIR XCB_UTIL_LIBRARY
|
||||
# XCB_COMPOSITE_FOUND XCB_COMPOSITE_INCLUDE_DIR XCB_COMPOSITE_LIBRARY
|
||||
# XCB_DAMAGE_FOUND XCB_DAMAGE_INCLUDE_DIR XCB_DAMAGE_LIBRARY
|
||||
# XCB_XFIXES_FOUND XCB_XFIXES_INCLUDE_DIR XCB_XFIXES_LIBRARY
|
||||
# XCB_RENDER_FOUND XCB_RENDER_INCLUDE_DIR XCB_RENDER_LIBRARY
|
||||
# XCB_RANDR_FOUND XCB_RANDR_INCLUDE_DIR XCB_RANDR_LIBRARY
|
||||
# XCB_SHAPE_FOUND XCB_SHAPE_INCLUDE_DIR XCB_SHAPE_LIBRARY
|
||||
# XCB_DRI2_FOUND XCB_DRI2_INCLUDE_DIR XCB_DRI2_LIBRARY
|
||||
# XCB_GLX_FOUND XCB_GLX_INCLUDE_DIR XCB_GLX_LIBRARY
|
||||
# XCB_SHM_FOUND XCB_SHM_INCLUDE_DIR XCB_SHM_LIBRARY
|
||||
# XCB_XV_FOUND XCB_XV_INCLUDE_DIR XCB_XV_LIBRARY
|
||||
# XCB_XINPUT_FOUND XCB_XINPUT_INCLUDE_DIR XCB_XINPUT_LIBRARY
|
||||
# XCB_SYNC_FOUND XCB_SYNC_INCLUDE_DIR XCB_SYNC_LIBRARY
|
||||
# XCB_XTEST_FOUND XCB_XTEST_INCLUDE_DIR XCB_XTEST_LIBRARY
|
||||
# XCB_ICCCM_FOUND XCB_ICCCM_INCLUDE_DIR XCB_ICCCM_LIBRARY
|
||||
# XCB_EWMH_FOUND XCB_EWMH_INCLUDE_DIR XCB_EWMH_LIBRARY
|
||||
# XCB_IMAGE_FOUND XCB_IMAGE_INCLUDE_DIR XCB_IMAGE_LIBRARY
|
||||
# XCB_RENDERUTIL_FOUND XCB_RENDERUTIL_INCLUDE_DIR XCB_RENDERUTIL_LIBRARY
|
||||
# XCB_KEYSYMS_FOUND XCB_KEYSYMS_INCLUDE_DIR XCB_KEYSYMS_LIBRARY
|
||||
# XCB_XCB_FOUND XCB_XCB_INCLUDE_DIR XCB_XCB_LIBRARY XCB_UTIL_FOUND
|
||||
# XCB_UTIL_INCLUDE_DIR XCB_UTIL_LIBRARY XCB_COMPOSITE_FOUND
|
||||
# XCB_COMPOSITE_INCLUDE_DIR XCB_COMPOSITE_LIBRARY XCB_DAMAGE_FOUND
|
||||
# XCB_DAMAGE_INCLUDE_DIR XCB_DAMAGE_LIBRARY XCB_XFIXES_FOUND
|
||||
# XCB_XFIXES_INCLUDE_DIR XCB_XFIXES_LIBRARY XCB_RENDER_FOUND
|
||||
# XCB_RENDER_INCLUDE_DIR XCB_RENDER_LIBRARY XCB_RANDR_FOUND
|
||||
# XCB_RANDR_INCLUDE_DIR XCB_RANDR_LIBRARY XCB_SHAPE_FOUND
|
||||
# XCB_SHAPE_INCLUDE_DIR XCB_SHAPE_LIBRARY XCB_DRI2_FOUND
|
||||
# XCB_DRI2_INCLUDE_DIR XCB_DRI2_LIBRARY XCB_GLX_FOUND XCB_GLX_INCLUDE_DIR
|
||||
# XCB_GLX_LIBRARY XCB_SHM_FOUND XCB_SHM_INCLUDE_DIR XCB_SHM_LIBRARY
|
||||
# XCB_XV_FOUND XCB_XV_INCLUDE_DIR XCB_XV_LIBRARY XCB_XINPUT_FOUND
|
||||
# XCB_XINPUT_INCLUDE_DIR XCB_XINPUT_LIBRARY XCB_SYNC_FOUND
|
||||
# XCB_SYNC_INCLUDE_DIR XCB_SYNC_LIBRARY XCB_XTEST_FOUND
|
||||
# XCB_XTEST_INCLUDE_DIR XCB_XTEST_LIBRARY XCB_ICCCM_FOUND
|
||||
# XCB_ICCCM_INCLUDE_DIR XCB_ICCCM_LIBRARY XCB_EWMH_FOUND
|
||||
# XCB_EWMH_INCLUDE_DIR XCB_EWMH_LIBRARY XCB_IMAGE_FOUND
|
||||
# XCB_IMAGE_INCLUDE_DIR XCB_IMAGE_LIBRARY XCB_RENDERUTIL_FOUND
|
||||
# XCB_RENDERUTIL_INCLUDE_DIR XCB_RENDERUTIL_LIBRARY XCB_KEYSYMS_FOUND
|
||||
# XCB_KEYSYMS_INCLUDE_DIR XCB_KEYSYMS_LIBRARY
|
||||
#
|
||||
# Copyright (c) 2011 Fredrik Höglund <fredrik@kde.org>
|
||||
# Copyright (c) 2013 Martin Gräßlin <mgraesslin@kde.org>
|
||||
# Copyright (c) 2011 Fredrik Höglund <fredrik@kde.org> Copyright (c) 2013 Martin
|
||||
# Gräßlin <mgraesslin@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
set(knownComponents XCB
|
||||
COMPOSITE
|
||||
DAMAGE
|
||||
DRI2
|
||||
EWMH
|
||||
GLX
|
||||
ICCCM
|
||||
IMAGE
|
||||
KEYSYMS
|
||||
RANDR
|
||||
RENDER
|
||||
RENDERUTIL
|
||||
SHAPE
|
||||
SHM
|
||||
SYNC
|
||||
UTIL
|
||||
XFIXES
|
||||
XTEST
|
||||
XV
|
||||
XINPUT
|
||||
XINERAMA)
|
||||
set(knownComponents
|
||||
XCB
|
||||
COMPOSITE
|
||||
DAMAGE
|
||||
DRI2
|
||||
EWMH
|
||||
GLX
|
||||
ICCCM
|
||||
IMAGE
|
||||
KEYSYMS
|
||||
RANDR
|
||||
RENDER
|
||||
RENDERUTIL
|
||||
SHAPE
|
||||
SHM
|
||||
SYNC
|
||||
UTIL
|
||||
XFIXES
|
||||
XTEST
|
||||
XV
|
||||
XINPUT
|
||||
XINERAMA)
|
||||
|
||||
unset(unknownComponents)
|
||||
|
||||
set(pkgConfigModules)
|
||||
set(requiredComponents)
|
||||
|
||||
if (XCB_FIND_COMPONENTS)
|
||||
if(XCB_FIND_COMPONENTS)
|
||||
set(comps ${XCB_FIND_COMPONENTS})
|
||||
else()
|
||||
set(comps ${knownComponents})
|
||||
endif()
|
||||
|
||||
# iterate through the list of requested components, and check that we know them all.
|
||||
# If not, fail.
|
||||
# iterate through the list of requested components, and check that we know them
|
||||
# all. If not, fail.
|
||||
foreach(comp ${comps})
|
||||
list(FIND knownComponents ${comp} index )
|
||||
if("${index}" STREQUAL "-1")
|
||||
list(APPEND unknownComponents "${comp}")
|
||||
else()
|
||||
if("${comp}" STREQUAL "XCB")
|
||||
list(APPEND pkgConfigModules "xcb")
|
||||
elseif("${comp}" STREQUAL "COMPOSITE")
|
||||
list(APPEND pkgConfigModules "xcb-composite")
|
||||
elseif("${comp}" STREQUAL "DAMAGE")
|
||||
list(APPEND pkgConfigModules "xcb-damage")
|
||||
elseif("${comp}" STREQUAL "DRI2")
|
||||
list(APPEND pkgConfigModules "xcb-dri2")
|
||||
elseif("${comp}" STREQUAL "EWMH")
|
||||
list(APPEND pkgConfigModules "xcb-ewmh")
|
||||
elseif("${comp}" STREQUAL "GLX")
|
||||
list(APPEND pkgConfigModules "xcb-glx")
|
||||
elseif("${comp}" STREQUAL "ICCCM")
|
||||
list(APPEND pkgConfigModules "xcb-icccm")
|
||||
elseif("${comp}" STREQUAL "IMAGE")
|
||||
list(APPEND pkgConfigModules "xcb-image")
|
||||
elseif("${comp}" STREQUAL "KEYSYMS")
|
||||
list(APPEND pkgConfigModules "xcb-keysyms")
|
||||
elseif("${comp}" STREQUAL "RANDR")
|
||||
list(APPEND pkgConfigModules "xcb-randr")
|
||||
elseif("${comp}" STREQUAL "RENDER")
|
||||
list(APPEND pkgConfigModules "xcb-render")
|
||||
elseif("${comp}" STREQUAL "RENDERUTIL")
|
||||
list(APPEND pkgConfigModules "xcb-renderutil")
|
||||
elseif("${comp}" STREQUAL "SHAPE")
|
||||
list(APPEND pkgConfigModules "xcb-shape")
|
||||
elseif("${comp}" STREQUAL "SHM")
|
||||
list(APPEND pkgConfigModules "xcb-shm")
|
||||
elseif("${comp}" STREQUAL "SYNC")
|
||||
list(APPEND pkgConfigModules "xcb-sync")
|
||||
elseif("${comp}" STREQUAL "UTIL")
|
||||
list(APPEND pkgConfigModules "xcb-util")
|
||||
elseif("${comp}" STREQUAL "XFIXES")
|
||||
list(APPEND pkgConfigModules "xcb-xfixes")
|
||||
elseif("${comp}" STREQUAL "XTEST")
|
||||
list(APPEND pkgConfigModules "xcb-xtest")
|
||||
elseif("${comp}" STREQUAL "XV")
|
||||
list(APPEND pkgConfigModules "xcb-xv")
|
||||
elseif("${comp}" STREQUAL "XINPUT")
|
||||
list(APPEND pkgConfigModules "xcb-xinput")
|
||||
elseif("${comp}" STREQUAL "XINERAMA")
|
||||
list(APPEND pkgConfigModules "xcb-xinerama")
|
||||
endif()
|
||||
list(FIND knownComponents ${comp} index)
|
||||
if("${index}" STREQUAL "-1")
|
||||
list(APPEND unknownComponents "${comp}")
|
||||
else()
|
||||
if("${comp}" STREQUAL "XCB")
|
||||
list(APPEND pkgConfigModules "xcb")
|
||||
elseif("${comp}" STREQUAL "COMPOSITE")
|
||||
list(APPEND pkgConfigModules "xcb-composite")
|
||||
elseif("${comp}" STREQUAL "DAMAGE")
|
||||
list(APPEND pkgConfigModules "xcb-damage")
|
||||
elseif("${comp}" STREQUAL "DRI2")
|
||||
list(APPEND pkgConfigModules "xcb-dri2")
|
||||
elseif("${comp}" STREQUAL "EWMH")
|
||||
list(APPEND pkgConfigModules "xcb-ewmh")
|
||||
elseif("${comp}" STREQUAL "GLX")
|
||||
list(APPEND pkgConfigModules "xcb-glx")
|
||||
elseif("${comp}" STREQUAL "ICCCM")
|
||||
list(APPEND pkgConfigModules "xcb-icccm")
|
||||
elseif("${comp}" STREQUAL "IMAGE")
|
||||
list(APPEND pkgConfigModules "xcb-image")
|
||||
elseif("${comp}" STREQUAL "KEYSYMS")
|
||||
list(APPEND pkgConfigModules "xcb-keysyms")
|
||||
elseif("${comp}" STREQUAL "RANDR")
|
||||
list(APPEND pkgConfigModules "xcb-randr")
|
||||
elseif("${comp}" STREQUAL "RENDER")
|
||||
list(APPEND pkgConfigModules "xcb-render")
|
||||
elseif("${comp}" STREQUAL "RENDERUTIL")
|
||||
list(APPEND pkgConfigModules "xcb-renderutil")
|
||||
elseif("${comp}" STREQUAL "SHAPE")
|
||||
list(APPEND pkgConfigModules "xcb-shape")
|
||||
elseif("${comp}" STREQUAL "SHM")
|
||||
list(APPEND pkgConfigModules "xcb-shm")
|
||||
elseif("${comp}" STREQUAL "SYNC")
|
||||
list(APPEND pkgConfigModules "xcb-sync")
|
||||
elseif("${comp}" STREQUAL "UTIL")
|
||||
list(APPEND pkgConfigModules "xcb-util")
|
||||
elseif("${comp}" STREQUAL "XFIXES")
|
||||
list(APPEND pkgConfigModules "xcb-xfixes")
|
||||
elseif("${comp}" STREQUAL "XTEST")
|
||||
list(APPEND pkgConfigModules "xcb-xtest")
|
||||
elseif("${comp}" STREQUAL "XV")
|
||||
list(APPEND pkgConfigModules "xcb-xv")
|
||||
elseif("${comp}" STREQUAL "XINPUT")
|
||||
list(APPEND pkgConfigModules "xcb-xinput")
|
||||
elseif("${comp}" STREQUAL "XINERAMA")
|
||||
list(APPEND pkgConfigModules "xcb-xinerama")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
if(DEFINED unknownComponents)
|
||||
set(msgType STATUS)
|
||||
if(XCB_FIND_REQUIRED)
|
||||
set(msgType FATAL_ERROR)
|
||||
endif()
|
||||
if(NOT XCB_FIND_QUIETLY)
|
||||
message(${msgType} "XCB: requested unknown components ${unknownComponents}")
|
||||
endif()
|
||||
return()
|
||||
set(msgType STATUS)
|
||||
if(XCB_FIND_REQUIRED)
|
||||
set(msgType FATAL_ERROR)
|
||||
endif()
|
||||
if(NOT XCB_FIND_QUIETLY)
|
||||
message(${msgType} "XCB: requested unknown components ${unknownComponents}")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
|
||||
macro(_XCB_HANDLE_COMPONENT _comp)
|
||||
set(_header )
|
||||
set(_lib )
|
||||
if("${_comp}" STREQUAL "XCB")
|
||||
set(_header "xcb/xcb.h")
|
||||
set(_lib "xcb")
|
||||
elseif("${_comp}" STREQUAL "COMPOSITE")
|
||||
set(_header "xcb/composite.h")
|
||||
set(_lib "xcb-composite")
|
||||
elseif("${_comp}" STREQUAL "DAMAGE")
|
||||
set(_header "xcb/damage.h")
|
||||
set(_lib "xcb-damage")
|
||||
elseif("${_comp}" STREQUAL "DRI2")
|
||||
set(_header "xcb/dri2.h")
|
||||
set(_lib "xcb-dri2")
|
||||
elseif("${_comp}" STREQUAL "EWMH")
|
||||
set(_header "xcb/xcb_ewmh.h")
|
||||
set(_lib "xcb-ewmh")
|
||||
elseif("${_comp}" STREQUAL "GLX")
|
||||
set(_header "xcb/glx.h")
|
||||
set(_lib "xcb-glx")
|
||||
elseif("${_comp}" STREQUAL "ICCCM")
|
||||
set(_header "xcb/xcb_icccm.h")
|
||||
set(_lib "xcb-icccm")
|
||||
elseif("${_comp}" STREQUAL "IMAGE")
|
||||
set(_header "xcb/xcb_image.h")
|
||||
set(_lib "xcb-image")
|
||||
elseif("${_comp}" STREQUAL "KEYSYMS")
|
||||
set(_header "xcb/xcb_keysyms.h")
|
||||
set(_lib "xcb-keysyms")
|
||||
elseif("${_comp}" STREQUAL "RANDR")
|
||||
set(_header "xcb/randr.h")
|
||||
set(_lib "xcb-randr")
|
||||
elseif("${_comp}" STREQUAL "RENDER")
|
||||
set(_header "xcb/render.h")
|
||||
set(_lib "xcb-render")
|
||||
elseif("${_comp}" STREQUAL "RENDERUTIL")
|
||||
set(_header "xcb/xcb_renderutil.h")
|
||||
set(_lib "xcb-render-util")
|
||||
elseif("${_comp}" STREQUAL "SHAPE")
|
||||
set(_header "xcb/shape.h")
|
||||
set(_lib "xcb-shape")
|
||||
elseif("${_comp}" STREQUAL "SHM")
|
||||
set(_header "xcb/shm.h")
|
||||
set(_lib "xcb-shm")
|
||||
elseif("${_comp}" STREQUAL "SYNC")
|
||||
set(_header "xcb/sync.h")
|
||||
set(_lib "xcb-sync")
|
||||
elseif("${_comp}" STREQUAL "UTIL")
|
||||
set(_header "xcb/xcb_util.h")
|
||||
set(_lib "xcb-util")
|
||||
elseif("${_comp}" STREQUAL "XFIXES")
|
||||
set(_header "xcb/xfixes.h")
|
||||
set(_lib "xcb-xfixes")
|
||||
elseif("${_comp}" STREQUAL "XTEST")
|
||||
set(_header "xcb/xtest.h")
|
||||
set(_lib "xcb-xtest")
|
||||
elseif("${_comp}" STREQUAL "XV")
|
||||
set(_header "xcb/xv.h")
|
||||
set(_lib "xcb-xv")
|
||||
elseif("${_comp}" STREQUAL "XINPUT")
|
||||
set(_header "xcb/xinput.h")
|
||||
set(_lib "xcb-xinput")
|
||||
elseif("${_comp}" STREQUAL "XINERAMA")
|
||||
set(_header "xcb/xinerama.h")
|
||||
set(_lib "xcb-xinerama")
|
||||
endif()
|
||||
set(_header)
|
||||
set(_lib)
|
||||
if("${_comp}" STREQUAL "XCB")
|
||||
set(_header "xcb/xcb.h")
|
||||
set(_lib "xcb")
|
||||
elseif("${_comp}" STREQUAL "COMPOSITE")
|
||||
set(_header "xcb/composite.h")
|
||||
set(_lib "xcb-composite")
|
||||
elseif("${_comp}" STREQUAL "DAMAGE")
|
||||
set(_header "xcb/damage.h")
|
||||
set(_lib "xcb-damage")
|
||||
elseif("${_comp}" STREQUAL "DRI2")
|
||||
set(_header "xcb/dri2.h")
|
||||
set(_lib "xcb-dri2")
|
||||
elseif("${_comp}" STREQUAL "EWMH")
|
||||
set(_header "xcb/xcb_ewmh.h")
|
||||
set(_lib "xcb-ewmh")
|
||||
elseif("${_comp}" STREQUAL "GLX")
|
||||
set(_header "xcb/glx.h")
|
||||
set(_lib "xcb-glx")
|
||||
elseif("${_comp}" STREQUAL "ICCCM")
|
||||
set(_header "xcb/xcb_icccm.h")
|
||||
set(_lib "xcb-icccm")
|
||||
elseif("${_comp}" STREQUAL "IMAGE")
|
||||
set(_header "xcb/xcb_image.h")
|
||||
set(_lib "xcb-image")
|
||||
elseif("${_comp}" STREQUAL "KEYSYMS")
|
||||
set(_header "xcb/xcb_keysyms.h")
|
||||
set(_lib "xcb-keysyms")
|
||||
elseif("${_comp}" STREQUAL "RANDR")
|
||||
set(_header "xcb/randr.h")
|
||||
set(_lib "xcb-randr")
|
||||
elseif("${_comp}" STREQUAL "RENDER")
|
||||
set(_header "xcb/render.h")
|
||||
set(_lib "xcb-render")
|
||||
elseif("${_comp}" STREQUAL "RENDERUTIL")
|
||||
set(_header "xcb/xcb_renderutil.h")
|
||||
set(_lib "xcb-render-util")
|
||||
elseif("${_comp}" STREQUAL "SHAPE")
|
||||
set(_header "xcb/shape.h")
|
||||
set(_lib "xcb-shape")
|
||||
elseif("${_comp}" STREQUAL "SHM")
|
||||
set(_header "xcb/shm.h")
|
||||
set(_lib "xcb-shm")
|
||||
elseif("${_comp}" STREQUAL "SYNC")
|
||||
set(_header "xcb/sync.h")
|
||||
set(_lib "xcb-sync")
|
||||
elseif("${_comp}" STREQUAL "UTIL")
|
||||
set(_header "xcb/xcb_util.h")
|
||||
set(_lib "xcb-util")
|
||||
elseif("${_comp}" STREQUAL "XFIXES")
|
||||
set(_header "xcb/xfixes.h")
|
||||
set(_lib "xcb-xfixes")
|
||||
elseif("${_comp}" STREQUAL "XTEST")
|
||||
set(_header "xcb/xtest.h")
|
||||
set(_lib "xcb-xtest")
|
||||
elseif("${_comp}" STREQUAL "XV")
|
||||
set(_header "xcb/xv.h")
|
||||
set(_lib "xcb-xv")
|
||||
elseif("${_comp}" STREQUAL "XINPUT")
|
||||
set(_header "xcb/xinput.h")
|
||||
set(_lib "xcb-xinput")
|
||||
elseif("${_comp}" STREQUAL "XINERAMA")
|
||||
set(_header "xcb/xinerama.h")
|
||||
set(_lib "xcb-xinerama")
|
||||
endif()
|
||||
|
||||
find_path(XCB_${_comp}_INCLUDE_DIR NAMES ${_header} HINTS ${PKG_XCB_INCLUDE_DIRS})
|
||||
find_library(XCB_${_comp}_LIBRARY NAMES ${_lib} HINTS ${PKG_XCB_LIBRARY_DIRS})
|
||||
mark_as_advanced(XCB_${_comp}_LIBRARY XCB_${_comp}_INCLUDE_DIR)
|
||||
find_path(
|
||||
XCB_${_comp}_INCLUDE_DIR
|
||||
NAMES ${_header}
|
||||
HINTS ${PKG_XCB_INCLUDE_DIRS})
|
||||
find_library(
|
||||
XCB_${_comp}_LIBRARY
|
||||
NAMES ${_lib}
|
||||
HINTS ${PKG_XCB_LIBRARY_DIRS})
|
||||
mark_as_advanced(XCB_${_comp}_LIBRARY XCB_${_comp}_INCLUDE_DIR)
|
||||
|
||||
if(XCB_${_comp}_INCLUDE_DIR AND XCB_${_comp}_LIBRARY)
|
||||
set(XCB_${_comp}_FOUND TRUE)
|
||||
list(APPEND XCB_INCLUDE_DIRS ${XCB_${_comp}_INCLUDE_DIR})
|
||||
list(APPEND XCB_LIBRARIES ${XCB_${_comp}_LIBRARY})
|
||||
if (NOT XCB_FIND_QUIETLY)
|
||||
message(STATUS "XCB[${_comp}]: Found component ${_comp}")
|
||||
endif()
|
||||
if(XCB_${_comp}_INCLUDE_DIR AND XCB_${_comp}_LIBRARY)
|
||||
set(XCB_${_comp}_FOUND TRUE)
|
||||
list(APPEND XCB_INCLUDE_DIRS ${XCB_${_comp}_INCLUDE_DIR})
|
||||
list(APPEND XCB_LIBRARIES ${XCB_${_comp}_LIBRARY})
|
||||
if(NOT XCB_FIND_QUIETLY)
|
||||
message(STATUS "XCB[${_comp}]: Found component ${_comp}")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
IF (NOT WIN32)
|
||||
# Use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKG_XCB QUIET ${pkgConfigModules})
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
# Use pkg-config to get the directories and then use these values in the
|
||||
# FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKG_XCB QUIET ${pkgConfigModules})
|
||||
|
||||
set(XCB_DEFINITIONS ${PKG_XCB_CFLAGS})
|
||||
set(XCB_DEFINITIONS ${PKG_XCB_CFLAGS})
|
||||
|
||||
foreach(comp ${comps})
|
||||
_xcb_handle_component(${comp})
|
||||
endforeach()
|
||||
foreach(comp ${comps})
|
||||
_xcb_handle_component(${comp})
|
||||
endforeach()
|
||||
|
||||
if(XCB_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS)
|
||||
if(XCB_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
XCB
|
||||
REQUIRED_VARS XCB_LIBRARIES XCB_INCLUDE_DIRS
|
||||
HANDLE_COMPONENTS)
|
||||
|
||||
# compatibility for old variable naming
|
||||
set(XCB_INCLUDE_DIR ${XCB_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if(XCB_FOUND AND NOT TARGET XCB::XCB)
|
||||
foreach(component ${comps})
|
||||
if(NOT TARGET XCB::${component})
|
||||
string(TOUPPER ${component} component_u)
|
||||
if(XCB_${component_u}_FOUND)
|
||||
if(IS_ABSOLUTE "${XCB_${component_u}_LIBRARY}")
|
||||
add_library(XCB::${component} UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
XCB::${component} PROPERTIES IMPORTED_LOCATION
|
||||
"${XCB_${component_u}_LIBRARY}")
|
||||
else()
|
||||
add_library(XCB::${component} INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
XCB::${component} PROPERTIES IMPORTED_LIBNAME
|
||||
"${XCB_${component_u}_LIBRARY}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
XCB::${component} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${XCB_${component_u}_INCLUDE_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(XCB
|
||||
REQUIRED_VARS XCB_LIBRARIES XCB_INCLUDE_DIRS
|
||||
HANDLE_COMPONENTS)
|
||||
|
||||
# compatibility for old variable naming
|
||||
set(XCB_INCLUDE_DIR ${XCB_INCLUDE_DIRS})
|
||||
ENDIF (NOT WIN32)
|
||||
endforeach()
|
||||
endif()
|
||||
|
|
|
@ -29,9 +29,20 @@ if(XKBCOMMON_FOUND)
|
|||
set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIB})
|
||||
|
||||
if(NOT TARGET Xkbcommon::Xkbcommon)
|
||||
add_library(Xkbcommon::Xkbcommon INTERFACE IMPORTED)
|
||||
if(IS_ABSOLUTE "${XKBCOMMON_LIBRARIES}")
|
||||
add_library(Xkbcommon::Xkbcommon UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
Xkbcommon::Xkbcommon PROPERTIES IMPORTED_LOCATION
|
||||
"${XKBCOMMON_LIBRARIES}")
|
||||
else()
|
||||
add_library(Xkbcommon::Xkbcommon INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
Xkbcommon::Xkbcommon PROPERTIES IMPORTED_LIBNAME
|
||||
"${XKBCOMMON_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
Xkbcommon::Xkbcommon PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${XKBCOMMON_INCLUDE_DIRS}")
|
||||
"${XKBCOMMON_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# ZLIB_FOUND
|
||||
# ZLIB_INCLUDE_DIRS
|
||||
# ZLIB_LIBRARIES
|
||||
#
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_ZLIB QUIET zlib)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(ZLIB_INCLUDE_DIR
|
||||
NAMES zlib.h
|
||||
HINTS
|
||||
ENV zlibPath${_lib_suffix}
|
||||
ENV zlibPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${zlibPath${_lib_suffix}}
|
||||
${zlibPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_ZLIB_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
|
||||
find_library(ZLIB_LIB
|
||||
NAMES ${_ZLIB_LIBRARIES} z zlib zdll zlib1 zlibd zlibd1 libzlib libz
|
||||
HINTS
|
||||
ENV zlibPath${_lib_suffix}
|
||||
ENV zlibPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${zlibPath${_lib_suffix}}
|
||||
${zlibPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath}
|
||||
${_ZLIB_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(ZLIB DEFAULT_MSG ZLIB_LIB ZLIB_INCLUDE_DIR)
|
||||
mark_as_advanced(ZLIB_INCLUDE_DIR ZLIB_LIB)
|
||||
|
||||
if(ZLIB_FOUND)
|
||||
set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
|
||||
set(ZLIB_LIBRARIES ${ZLIB_LIB})
|
||||
endif()
|
|
@ -1,81 +1,78 @@
|
|||
macro(add_idl_files_base generated_files with_tlb)
|
||||
foreach(filename ${ARGN})
|
||||
get_filename_component(file_we ${filename} NAME_WE)
|
||||
get_filename_component(file_path ${filename} PATH)
|
||||
foreach(filename ${ARGN})
|
||||
get_filename_component(file_we ${filename} NAME_WE)
|
||||
get_filename_component(file_path ${filename} PATH)
|
||||
|
||||
set(file_c ${file_we}_i.c)
|
||||
set(file_h ${file_we}.h)
|
||||
set(bin_file_h ${CMAKE_CURRENT_BINARY_DIR}/${file_h})
|
||||
set(bin_file_c ${CMAKE_CURRENT_BINARY_DIR}/${file_c})
|
||||
set(file_c ${file_we}_i.c)
|
||||
set(file_h ${file_we}.h)
|
||||
set(bin_file_h ${CMAKE_CURRENT_BINARY_DIR}/${file_h})
|
||||
set(bin_file_c ${CMAKE_CURRENT_BINARY_DIR}/${file_c})
|
||||
|
||||
if(MSVC)
|
||||
if(${with_tlb})
|
||||
set(file_tlb ${file_we}.tlb)
|
||||
set(bin_file_tlb ${CMAKE_CURRENT_BINARY_DIR}/${file_tlb})
|
||||
set(tlb_opt "")
|
||||
else()
|
||||
set(tlb_opt "/notlb")
|
||||
endif()
|
||||
if(MSVC)
|
||||
if(${with_tlb})
|
||||
set(file_tlb ${file_we}.tlb)
|
||||
set(bin_file_tlb ${CMAKE_CURRENT_BINARY_DIR}/${file_tlb})
|
||||
set(tlb_opt "")
|
||||
else()
|
||||
set(tlb_opt "/notlb")
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${bin_file_h} ${bin_file_c}
|
||||
DEPENDS ${filename}
|
||||
COMMAND midl /h ${file_h} /iid ${file_c} ${tlb_opt} ${CMAKE_CURRENT_SOURCE_DIR}/${filename}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
else()
|
||||
execute_process(COMMAND echo
|
||||
COMMAND ${CMAKE_C_COMPILER} -v -x c++ -E -
|
||||
ERROR_VARIABLE cpp_inc_output
|
||||
OUTPUT_QUIET
|
||||
ERROR_STRIP_TRAILING_WHITESPACE)
|
||||
add_custom_command(
|
||||
OUTPUT ${bin_file_h} ${bin_file_c}
|
||||
DEPENDS ${filename}
|
||||
COMMAND
|
||||
midl /h ${file_h} /iid ${file_c} ${tlb_opt}
|
||||
$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,/win64,/win32>
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${filename}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND echo
|
||||
COMMAND ${CMAKE_C_COMPILER} -v -x c++ -E -
|
||||
ERROR_VARIABLE cpp_inc_output
|
||||
OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
string(REPLACE ";" " " include_dirs ${cpp_inc_output})
|
||||
string(REPLACE "\n" ";" include_dirs ${cpp_inc_output})
|
||||
string(REPLACE ";" " " include_dirs ${cpp_inc_output})
|
||||
string(REPLACE "\n" ";" include_dirs ${cpp_inc_output})
|
||||
|
||||
set(include_params)
|
||||
foreach(include_dir ${include_dirs})
|
||||
string(SUBSTRING ${include_dir} 0 1 first_char)
|
||||
if(${first_char} STREQUAL " ")
|
||||
string(LENGTH "${include_dir}" include_dir_len)
|
||||
math(EXPR include_dir_len "${include_dir_len} - 1")
|
||||
string(SUBSTRING ${include_dir} 1 ${include_dir_len} include_dir)
|
||||
set(include_params "-I\"${include_dir}\" ${include_params}")
|
||||
endif()
|
||||
endforeach()
|
||||
set(include_params)
|
||||
foreach(include_dir ${include_dirs})
|
||||
string(SUBSTRING ${include_dir} 0 1 first_char)
|
||||
if(${first_char} STREQUAL " ")
|
||||
string(LENGTH "${include_dir}" include_dir_len)
|
||||
math(EXPR include_dir_len "${include_dir_len} - 1")
|
||||
string(SUBSTRING ${include_dir} 1 ${include_dir_len} include_dir)
|
||||
set(include_params "-I\"${include_dir}\" ${include_params}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(WIN32)
|
||||
separate_arguments(include_params WINDOWS_COMMAND ${include_params})
|
||||
endif()
|
||||
if(WIN32)
|
||||
separate_arguments(include_params WINDOWS_COMMAND ${include_params})
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${file_h}
|
||||
DEPENDS ${filename}
|
||||
COMMAND ${CMAKE_WIDL} ${include_params} -h -o ${file_h} ${CMAKE_CURRENT_SOURCE_DIR}/${filename}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_custom_command(
|
||||
OUTPUT ${file_h}
|
||||
DEPENDS ${filename}
|
||||
COMMAND ${CMAKE_WIDL} ${include_params} -h -o ${file_h}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${filename}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
file(WRITE ${bin_file_c} "#include <initguid.h>\n#include <${file_h}>\n")
|
||||
endif()
|
||||
file(WRITE ${bin_file_c} "#include <initguid.h>\n#include <${file_h}>\n")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(
|
||||
${bin_file_h}
|
||||
${bin_file_c}
|
||||
PROPERTIES
|
||||
GENERATED TRUE)
|
||||
set_source_files_properties(${bin_file_h} ${bin_file_c} PROPERTIES GENERATED
|
||||
TRUE)
|
||||
|
||||
set(${generated_files} ${${generated_file}}
|
||||
${bin_file_h}
|
||||
${bin_file_c})
|
||||
set(${generated_files} ${${generated_file}} ${bin_file_h} ${bin_file_c})
|
||||
|
||||
set_source_files_properties(${filename}
|
||||
PROPERTIES
|
||||
HEADER_FILE_ONLY TRUE)
|
||||
endforeach(filename ${ARGN})
|
||||
set_source_files_properties(${filename} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
endforeach(filename ${ARGN})
|
||||
endmacro(add_idl_files_base)
|
||||
|
||||
macro(add_idl_files generated_files)
|
||||
add_idl_files_base(${generated_files} FALSE ${ARGN})
|
||||
add_idl_files_base(${generated_files} FALSE ${ARGN})
|
||||
endmacro(add_idl_files)
|
||||
|
||||
macro(add_idl_files_with_tlb generated_files)
|
||||
add_idl_files_base(${generated_files} TRUE ${ARGN})
|
||||
add_idl_files_base(${generated_files} TRUE ${ARGN})
|
||||
endmacro(add_idl_files_with_tlb)
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
|
||||
if(APPLE AND NOT CPACK_GENERATOR)
|
||||
set(CPACK_GENERATOR "Bundle")
|
||||
elseif(WIN32 AND NOT CPACK_GENERATOR)
|
||||
set(CPACK_GENERATOR "WIX" "ZIP")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_NAME "OBS")
|
||||
set(CPACK_PACKAGE_VENDOR "obsproject.com")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OBS - Live video and audio streaming and recording software")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/UI/data/license/gplv2.txt")
|
||||
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "0")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "0")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "1")
|
||||
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
||||
if(NOT DEFINED OBS_VERSION_OVERRIDE)
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
execute_process(COMMAND git describe --always --tags --dirty=-modified
|
||||
OUTPUT_VARIABLE OBS_VERSION
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
else()
|
||||
set(OBS_VERSION "${CPACK_PACKAGE_VERSION}")
|
||||
endif()
|
||||
else()
|
||||
set(OBS_VERSION "${OBS_VERSION_OVERRIDE}")
|
||||
endif()
|
||||
|
||||
if("${OBS_VERSION}" STREQUAL "")
|
||||
message(FATAL_ERROR "Failed to configure OBS_VERSION. Either set OBS_VERSION_OVERRIDE or ensure `git describe` succeeds.")
|
||||
endif()
|
||||
MESSAGE(STATUS "OBS_VERSION: ${OBS_VERSION}")
|
||||
|
||||
if(INSTALLER_RUN)
|
||||
set(CPACK_PACKAGE_EXECUTABLES
|
||||
"obs32" "OBS Studio (32bit)"
|
||||
"obs64" "OBS Studio (64bit)")
|
||||
set(CPACK_CREATE_DESKTOP_LINKS
|
||||
"obs32"
|
||||
"obs64")
|
||||
else()
|
||||
if(WIN32)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_output_suffix "64")
|
||||
else()
|
||||
set(_output_suffix "32")
|
||||
endif()
|
||||
else()
|
||||
set(_output_suffix "")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_EXECUTABLES "obs${_output_suffix}" "OBS Studio")
|
||||
set(CPACK_CREATE_DESKTOP_LINKS "obs${_output_suffix}")
|
||||
endif()
|
||||
|
||||
set(CPACK_BUNDLE_NAME "OBS")
|
||||
set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/cmake/osxbundle/Info.plist")
|
||||
set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/cmake/osxbundle/obs.icns")
|
||||
set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_SOURCE_DIR}/cmake/osxbundle/obslaunch.sh")
|
||||
|
||||
set(CPACK_WIX_TEMPLATE "${CMAKE_SOURCE_DIR}/cmake/Modules/WIX.template.in")
|
||||
|
||||
if(INSTALLER_RUN)
|
||||
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OBSStudio")
|
||||
set(CPACK_WIX_UPGRADE_GUID "1f59ff79-2a3c-43c1-b2b2-033a5e6342eb")
|
||||
set(CPACK_WIX_PRODUCT_GUID "0c7bec2a-4f07-41b2-9dff-d64b09c9c384")
|
||||
set(CPACK_PACKAGE_FILE_NAME "obs-studio-${OBS_VERSION}")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
if(WIN32)
|
||||
set(CPACK_PACKAGE_NAME "OBS Studio (64bit)")
|
||||
endif()
|
||||
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OBSStudio64")
|
||||
set(CPACK_WIX_UPGRADE_GUID "44c72510-2e8e-489c-8bc0-2011a9631b0b")
|
||||
set(CPACK_WIX_PRODUCT_GUID "ca5bf4fe-7b38-4003-9455-de249d03caac")
|
||||
set(CPACK_PACKAGE_FILE_NAME "obs-studio-x64-${OBS_VERSION}")
|
||||
else()
|
||||
if(WIN32)
|
||||
set(CPACK_PACKAGE_NAME "OBS Studio (32bit)")
|
||||
endif()
|
||||
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OBSStudio32")
|
||||
set(CPACK_WIX_UPGRADE_GUID "a26acea4-6190-4470-9fb9-f6d32f3ba030")
|
||||
set(CPACK_WIX_PRODUCT_GUID "8e24982d-b0ab-4f66-9c90-f726f3b64682")
|
||||
set(CPACK_PACKAGE_FILE_NAME "obs-studio-x86-${OBS_VERSION}")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
|
||||
|
||||
if(UNIX_STRUCTURE)
|
||||
set(CPACK_SET_DESTDIR TRUE)
|
||||
endif()
|
||||
|
||||
include(CPack)
|
|
@ -0,0 +1,180 @@
|
|||
# Enable modern cmake policies
|
||||
if(POLICY CMP0011)
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0072)
|
||||
cmake_policy(SET CMP0072 NEW)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0095)
|
||||
cmake_policy(SET CMP0095 NEW)
|
||||
endif()
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND LINUX_PORTABLE)
|
||||
set(CMAKE_INSTALL_PREFIX
|
||||
"${CMAKE_BINARY_DIR}/install"
|
||||
CACHE STRING "Directory to install OBS after building" FORCE)
|
||||
endif()
|
||||
|
||||
macro(setup_obs_project)
|
||||
#[[
|
||||
POSIX directory setup (portable)
|
||||
CMAKE_BINARY_DIR
|
||||
└ rundir
|
||||
└ CONFIG
|
||||
└ bin
|
||||
└ ARCH
|
||||
└ data
|
||||
└ libobs
|
||||
└ obs-plugins
|
||||
└ PLUGIN
|
||||
└ obs-scripting
|
||||
└ ARCH
|
||||
└ obs-studio
|
||||
└ obs-plugins
|
||||
└ ARCH
|
||||
|
||||
POSIX directory setup (non-portable)
|
||||
/usr/local/
|
||||
└ bin
|
||||
└ include
|
||||
└ obs
|
||||
└ libs
|
||||
└ cmake
|
||||
└ obs-plugins
|
||||
└ obs-scripting
|
||||
└ share
|
||||
└ obs
|
||||
└ libobs
|
||||
└ obs-plugins
|
||||
└ obs-studio
|
||||
]]
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_ARCH_SUFFIX 64)
|
||||
else()
|
||||
set(_ARCH_SUFFIX 32)
|
||||
endif()
|
||||
|
||||
if(NOT OBS_MULTIARCH_SUFFIX AND DEFINED ENV{OBS_MULTIARCH_SUFFIX})
|
||||
set(OBS_MULTIARCH_SUFFIX "$ENV{OBS_MULTIARCH_SUFFIX}")
|
||||
endif()
|
||||
|
||||
set(OBS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/rundir")
|
||||
|
||||
if(NOT LINUX_PORTABLE)
|
||||
set(OBS_EXECUTABLE_DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
set(OBS_INCLUDE_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/obs")
|
||||
set(OBS_LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
set(OBS_PLUGIN_DESTINATION "${OBS_LIBRARY_DESTINATION}/obs-plugins")
|
||||
set(OBS_SCRIPT_PLUGIN_DESTINATION
|
||||
"${OBS_LIBRARY_DESTINATION}/obs-scripting")
|
||||
set(OBS_DATA_DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/obs")
|
||||
set(OBS_CMAKE_DESTINATION "${OBS_LIBRARY_DESTINATION}/cmake")
|
||||
|
||||
set(OBS_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
|
||||
set(OBS_DATA_PATH "${OBS_DATA_DESTINATION}")
|
||||
|
||||
set(OBS_SCRIPT_PLUGIN_PATH
|
||||
"${CMAKE_INSTALL_PREFIX}/${OBS_SCRIPT_PLUGIN_DESTINATION}")
|
||||
set(CMAKE_INSTALL_RPATH
|
||||
"${CMAKE_INSTALL_PREFIX}/${OBS_LIBRARY_DESTINATION}")
|
||||
else()
|
||||
set(OBS_EXECUTABLE_DESTINATION "bin/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_INCLUDE_DESTINATION "include")
|
||||
set(OBS_LIBRARY_DESTINATION "bin/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_PLUGIN_DESTINATION "obs-plugins/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_SCRIPT_PLUGIN_DESTINATION "data/obs-scripting/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_DATA_DESTINATION "data")
|
||||
set(OBS_CMAKE_DESTINATION "cmake")
|
||||
|
||||
set(OBS_INSTALL_PREFIX "")
|
||||
set(OBS_DATA_PATH "../../${OBS_DATA_DESTINATION}")
|
||||
|
||||
set(OBS_SCRIPT_PLUGIN_PATH "../../${OBS_SCRIPT_PLUGIN_DESTINATION}")
|
||||
set(CMAKE_INSTALL_RPATH
|
||||
"$ORIGIN/" "${CMAKE_INSTALL_PREFIX}/${OBS_LIBRARY_DESTINATION}")
|
||||
endif()
|
||||
|
||||
if(BUILD_FOR_PPA)
|
||||
set_option(ENABLE_LIBFDK ON)
|
||||
set_option(ENABLE_JACK ON)
|
||||
set_option(ENABLE_RTMPS ON)
|
||||
endif()
|
||||
|
||||
if(BUILD_FOR_DISTRIBUTION OR DEFINED ENV{CI})
|
||||
set_option(ENABLE_RTMPS ON)
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_NAME "obs-studio")
|
||||
set(CPACK_PACKAGE_VENDOR "${OBS_WEBSITE}")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${OBS_COMPANY_NAME}")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${OBS_COMMENTS}")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE
|
||||
"${CMAKE_SOURCE_DIR}/UI/data/license/gplv2.txt")
|
||||
set(CPACK_PACKAGE_VERSION "${OBS_VERSION_CANONICAL}-${OBS_BUILD_NUMBER}")
|
||||
set(CPACK_STRIP_FILES "bin/obs" "bin/obs-ffmpeg-mux")
|
||||
set(CPACK_SOURCE_STRIP_FILES "")
|
||||
set(CPACK_PACKAGE_EXECUTABLES "obs")
|
||||
|
||||
if(OS_LINUX AND NOT LINUX_PORTABLE)
|
||||
set(CPACK_GENERATOR "DEB")
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_SET_DESTDIR ON)
|
||||
elseif(OS_FREEBSD)
|
||||
option(ENABLE_CPACK_GENERATOR
|
||||
"Enable FreeBSD CPack generator (experimental)" OFF)
|
||||
|
||||
if(ENABLE_CPACK_GENERATOR)
|
||||
set(CPACK_GENERATOR "FreeBSD")
|
||||
endif()
|
||||
|
||||
set(CPACK_FREEBSD_PACKAGE_DEPS
|
||||
"audio/fdk-aac"
|
||||
"audio/jack"
|
||||
"audio/pulseaudio"
|
||||
"audio/sndio"
|
||||
"audio/speexdsp"
|
||||
"devel/cmake"
|
||||
"devel/dbus"
|
||||
"devel/jansson"
|
||||
"devel/libsysinfo"
|
||||
"devel/libudev-devd"
|
||||
"devel/ninja"
|
||||
"devel/pkgconf"
|
||||
"devel/qt5-buildtools"
|
||||
"devel/qt5-core"
|
||||
"devel/qt5-qmake"
|
||||
"devel/swig"
|
||||
"ftp/curl"
|
||||
"graphics/mesa-libs"
|
||||
"graphics/qt5-imageformats"
|
||||
"graphics/qt5-svg"
|
||||
"lang/lua52"
|
||||
"lang/luajit"
|
||||
"lang/python37"
|
||||
"multimedia/ffmpeg"
|
||||
"multimedia/libv4l"
|
||||
"multimedia/libx264"
|
||||
"multimedia/v4l_compat"
|
||||
"multimedia/vlc"
|
||||
"print/freetype2"
|
||||
"security/mbedtls"
|
||||
"textproc/qt5-xml"
|
||||
"x11/xorgproto"
|
||||
"x11/libICE"
|
||||
"x11/libSM"
|
||||
"x11/libX11"
|
||||
"x11/libxcb"
|
||||
"x11/libXcomposite"
|
||||
"x11/libXext"
|
||||
"x11/libXfixes"
|
||||
"x11/libXinerama"
|
||||
"x11/libXrandr"
|
||||
"x11-fonts/fontconfig"
|
||||
"x11-toolkits/qt5-gui"
|
||||
"x11-toolkits/qt5-widgets")
|
||||
endif()
|
||||
include(CPack)
|
||||
endmacro()
|
|
@ -0,0 +1,166 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
# Enable modern cmake policies
|
||||
if(POLICY CMP0009)
|
||||
cmake_policy(SET CMP0009 NEW)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0011)
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
endif()
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX
|
||||
"${CMAKE_BINARY_DIR}/rundir"
|
||||
CACHE STRING "Directory to install OBS after building" FORCE)
|
||||
endif()
|
||||
|
||||
# Enable building Windows modules with file descriptors
|
||||
# https://github.com/obsproject/obs-studio/commit/51be039cf82fc347587d16b48f74e65e86bee301
|
||||
set(MODULE_DESCRIPTION "OBS Studio")
|
||||
|
||||
macro(setup_obs_project)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_ARCH_SUFFIX 64)
|
||||
else()
|
||||
set(_ARCH_SUFFIX 32)
|
||||
endif()
|
||||
|
||||
set(OBS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/rundir")
|
||||
|
||||
set(OBS_EXECUTABLE_DESTINATION "bin/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_EXECUTABLE32_DESTINATION "bin/32bit")
|
||||
set(OBS_EXECUTABLE64_DESTINATION "bin/64bit")
|
||||
set(OBS_LIBRARY_DESTINATION "bin/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_LIBRARY32_DESTINATION "bin/32bit")
|
||||
set(OBS_LIBRARY64_DESTINATION "bin/64bit")
|
||||
|
||||
set(OBS_EXECUTABLE_EXPORT_DESTINATION "bin")
|
||||
set(OBS_LIBRARY_EXPORT_DESTINATION "bin")
|
||||
|
||||
set(OBS_PLUGIN_DESTINATION "obs-plugins/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_PLUGIN32_DESTINATION "obs-plugins/32bit")
|
||||
set(OBS_PLUGIN64_DESTINATION "obs-plugins/64bit")
|
||||
|
||||
set(OBS_INCLUDE_DESTINATION "include")
|
||||
set(OBS_CMAKE_DESTINATION "cmake")
|
||||
set(OBS_DATA_DESTINATION "data")
|
||||
set(OBS_DATA_PATH "../../${OBS_DATA_DESTINATION}")
|
||||
set(OBS_INSTALL_PREFIX "")
|
||||
|
||||
set(OBS_SCRIPT_PLUGIN_DESTINATION
|
||||
"${OBS_DATA_DESTINATION}/obs-scripting/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_SCRIPT_PLUGIN_PATH "../../${OBS_SCRIPT_PLUGIN_DESTINATION}")
|
||||
|
||||
string(REPLACE "-" ";" UI_VERSION_SPLIT ${OBS_VERSION})
|
||||
list(GET UI_VERSION_SPLIT 0 UI_VERSION)
|
||||
string(REPLACE "." ";" UI_VERSION_SEMANTIC ${UI_VERSION})
|
||||
list(GET UI_VERSION_SEMANTIC 0 UI_VERSION_MAJOR)
|
||||
list(GET UI_VERSION_SEMANTIC 1 UI_VERSION_MINOR)
|
||||
list(GET UI_VERSION_SEMANTIC 2 UI_VERSION_PATCH)
|
||||
|
||||
if(INSTALLER_RUN
|
||||
AND NOT DEFINED ENV{OBS_InstallerTempDir}
|
||||
AND NOT DEFINED ENV{obsInstallerTempDir})
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Environment variable obsInstallerTempDir is needed for multiarch installer generation"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{OBS_DepsPath${_ARCH_SUFFIX}})
|
||||
set(DepsPath${_ARCH_SUFFIX} "$ENV{OBS_DepsPath${_ARCH_SUFFIX}}")
|
||||
elseif(DEFINED ENV{OBS_DepsPath})
|
||||
set(DepsPath "$ENV{DepsPath}")
|
||||
elseif(DEFINED ENV{DepsPath${_ARCH_SUFFIX}})
|
||||
set(DepsPath${_ARCH_SUFFIX} "$ENV{DepsPath${_ARCH_SUFFIX}}")
|
||||
elseif(DEFINED ENV{DepsPath})
|
||||
set(DepsPath "$ENV{DepsPath}")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{OBS_QTDIR${_ARCH_SUFFIX}})
|
||||
set(QTDIR${_ARCH_SUFFIX} "$ENV{OBS_QTDIR${_ARCH_SUFFIX}}")
|
||||
elseif(DEFINED ENV{OBS_QTDIR})
|
||||
set(QTDIR "$ENV{OBS_QTDIR}")
|
||||
elseif(DEFINED ENV{QTDIR${_ARCH_SUFFIX}})
|
||||
set(QTDIR${_ARCH_SUFFIX} "$ENV{QTDIR${_ARCH_SUFFIX}}")
|
||||
elseif(DEFINED ENV{QTDIR})
|
||||
set(QTDIR "$ENV{QTDIR}")
|
||||
endif()
|
||||
|
||||
if(DEFINED DepsPath${_ARCH_SUFFIX})
|
||||
list(APPEND CMAKE_PREFIX_PATH "${DepsPath${_ARCH_SUFFIX}}"
|
||||
"${DepsPath${_ARCH_SUFFIX}}/bin")
|
||||
elseif(DEFINED DepsPath)
|
||||
list(APPEND CMAKE_PREFIX_PATH "${DepsPath}" "${DepsPath}/bin")
|
||||
elseif(NOT DEFINED CMAKE_PREFIX_PATH)
|
||||
message(
|
||||
WARNING
|
||||
"No CMAKE_PREFIX_PATH set: OBS requires pre-built dependencies for building on Windows."
|
||||
"Please download the appropriate obs-deps package for your architecture and set CMAKE_PREFIX_PATH "
|
||||
"to the base directory and 'bin' directory inside it:\n"
|
||||
"CMAKE_PREFIX_PATH=\"<PATH_TO_OBS_DEPS>\"\n"
|
||||
"Download pre-built OBS dependencies at https://github.com/obsproject/obs-deps/releases\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(DEFINED QTDIR${_ARCH_SUFFIX})
|
||||
list(APPEND CMAKE_PREFIX_PATH "${QTDIR${_ARCH_SUFFIX}}")
|
||||
elseif(DEFINED QTDIR)
|
||||
list(APPEND CMAKE_PREFIX_PATH "${QTDIR}")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{VLCPath})
|
||||
set(VLCPath "$ENV{VLCPath}")
|
||||
elseif(DEFINED ENV{OBS_VLCPath})
|
||||
set(VLCPath "$ENV{OBS_VLCPath}")
|
||||
endif()
|
||||
|
||||
if(DEFINED VLCPath)
|
||||
set(VLC_PATH "${VLCPath}")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{CEF_ROOT_DIR})
|
||||
set(CEF_ROOT_DIR "$ENV{CEF_ROOT_DIR}")
|
||||
elseif(DEFINED ENV{OBS_CEF_ROOT_DIR})
|
||||
set(CEF_ROOT_DIR "$ENV{OBS_CEF_ROOT_DIR}")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{OBS_InstallerTempDir})
|
||||
file(TO_CMAKE_PATH "$ENV{OBS_InstallerTempDir}" _INSTALLER_TEMP_DIR)
|
||||
elseif(DEFINED ENV{obsInstallerTempDir})
|
||||
file(TO_CMAKE_PATH "$ENV{obsInstallerTempDir}" _INSTALLER_TEMP_DIR)
|
||||
endif()
|
||||
|
||||
set(ENV{OBS_InstallerTempDir} "${_INSTALLER_TEMP_DIR}")
|
||||
unset(_INSTALLER_TEMP_DIR)
|
||||
|
||||
if(DEFINED ENV{OBS_AdditionalInstallFiles})
|
||||
file(TO_CMAKE_PATH "$ENV{OBS_AdditionalInstallFiles}" _ADDITIONAL_FILES)
|
||||
elseif(DEFINED ENV{obsAdditionalInstallFiles})
|
||||
file(TO_CMAKE_PATH "$ENV{obsAdditionalInstallFiles}" _ADDITIONAL_FILES)
|
||||
else()
|
||||
set(_ADDITIONAL_FILES "${CMAKE_SOURCE_DIR}/additional_install_files")
|
||||
endif()
|
||||
|
||||
set(ENV{OBS_AdditionalInstallFiles} "${_ADDITIONAL_FILES}")
|
||||
unset(_ADDITIONAL_FILES)
|
||||
|
||||
list(APPEND CMAKE_INCLUDE_PATH
|
||||
"$ENV{OBS_AdditionalInstallFiles}/include${_ARCH_SUFFIX}"
|
||||
"$ENV{OBS_AdditionalInstallFiles}/include")
|
||||
|
||||
list(
|
||||
APPEND
|
||||
CMAKE_LIBRARY_PATH
|
||||
"$ENV{OBS_AdditionalInstallFiles}/lib${_ARCH_SUFFIX}"
|
||||
"$ENV{OBS_AdditionalInstallFiles}/lib"
|
||||
"$ENV{OBS_AdditionalInstallFiles}/libs${_ARCH_SUFFIX}"
|
||||
"$ENV{OBS_AdditionalInstallFiles}/libs"
|
||||
"$ENV{OBS_AdditionalInstallFiles}/bin${_ARCH_SUFFIX}"
|
||||
"$ENV{OBS_AdditionalInstallFiles}/bin")
|
||||
|
||||
if(BUILD_FOR_DISTRIBUTION OR DEFINED ENV{CI})
|
||||
set_option(ENABLE_RTMPS ON)
|
||||
endif()
|
||||
endmacro()
|
|
@ -0,0 +1,169 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
# Enable modern cmake policies
|
||||
if(POLICY CMP0009)
|
||||
cmake_policy(SET CMP0009 NEW)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0011)
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0025)
|
||||
cmake_policy(SET CMP0025 NEW)
|
||||
endif()
|
||||
|
||||
# Build options
|
||||
set(CMAKE_OSX_ARCHITECTURES
|
||||
"x86_64"
|
||||
CACHE STRING "OBS build architecture for macOS - x86_64 required at least")
|
||||
set_property(CACHE CMAKE_OSX_ARCHITECTURES PROPERTY STRINGS x86_64 arm64
|
||||
"x86_64;arm64")
|
||||
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET
|
||||
"10.13"
|
||||
CACHE STRING "OBS deployment target for macOS - 10.13+ required")
|
||||
set_property(CACHE CMAKE_OSX_DEPLOYMENT_TARGET PROPERTY STRINGS 10.13 10.14
|
||||
10.15 11 12)
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX
|
||||
"${CMAKE_BINARY_DIR}/rundir"
|
||||
CACHE STRING "Directory to install OBS after building" FORCE)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_PREFIX_PATH)
|
||||
message(
|
||||
WARNING
|
||||
"No CMAKE_PREFIX_PATH set: OBS supplies pre-built dependencies for building on macOS.\n"
|
||||
"While OBS can be built using packages installed via Homebrew, pre-built dependencies "
|
||||
"contain beneficial patches and fixes for use within OBS and is the suggested source "
|
||||
"of these dependencies.\n"
|
||||
"You can download the appropriate obs-deps package for your "
|
||||
"architecture and set CMAKE_PREFIX_PATH to this directory:\n"
|
||||
"CMAKE_PREFIX_PATH=\"<PATH_TO_OBS_DEPS>\"\n"
|
||||
"Download pre-built OBS dependencies at https://github.com/obsproject/obs-deps/releases\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
macro(setup_obs_project)
|
||||
# Set code signing options
|
||||
set(OBS_BUNDLE_CODESIGN_IDENTITY
|
||||
"-"
|
||||
CACHE STRING "OBS code signing identity for macOS")
|
||||
set(OBS_CODESIGN_ENTITLEMENTS
|
||||
"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/entitlements.plist"
|
||||
CACHE INTERNAL "Path to codesign entitlements plist")
|
||||
set(OBS_CODESIGN_LINKER
|
||||
ON
|
||||
CACHE BOOL "Enable linker code-signing on macOS (macOS 11+ required)")
|
||||
|
||||
# Xcode configuration
|
||||
if(XCODE)
|
||||
# Tell Xcode to pretend the linker signed binaries so that editing with
|
||||
# install_name_tool preserves ad-hoc signatures. This option is supported by
|
||||
# codesign on macOS 11 or higher. See CMake Issue 21854:
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/21854
|
||||
|
||||
set(CMAKE_XCODE_GENERATE_SCHEME ON)
|
||||
if(OBS_CODESIGN_LINKER)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "-o linker-signed")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Set default options for bundling on macOS
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
set(CMAKE_SKIP_BUILD_RPATH OFF)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
|
||||
set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks/")
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH OFF)
|
||||
|
||||
# Set bundle parameters for cmake's automatic plist generation
|
||||
set(MACOSX_BUNDLE_EXECUTABLE_NAME "OBS")
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME "${OBS_PRODUCT_NAME}")
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION "${OBS_BUILD_NUMBER}")
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "${OBS_LEGAL_COPYRIGHT}")
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.obsproject.obs-studio")
|
||||
set(MACOSX_BUNDLE_ICON_FILE "AppIcon")
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${OBS_VERSION_CANONICAL}")
|
||||
string(TIMESTAMP CURRENT_YEAR "%Y")
|
||||
|
||||
# Set paths for distribution bundling
|
||||
set(OBS_BUNDLE_NAME "OBS")
|
||||
set(OBS_EXECUTABLE_DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
set(OBS_INCLUDE_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/obs")
|
||||
set(OBS_LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
set(OBS_CMAKE_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake")
|
||||
|
||||
if(BUILD_FOR_DISTRIBUTION)
|
||||
set_option(CMAKE_BUILD_TYPE "Release")
|
||||
set(CPACK_PACKAGE_VERSION "${OBS_VERSION_CANONICAL}")
|
||||
else()
|
||||
set(CPACK_PACKAGE_VERSION "${OBS_VERSION_CANONICAL}-${OBS_BUILD_NUMBER}")
|
||||
endif()
|
||||
|
||||
if(BUILD_FOR_DISTRIBUTION OR DEFINED ENV{CI})
|
||||
set_option(CMAKE_PREFIX_PATH "/tmp/obsdeps")
|
||||
set_option(ENABLE_SPARKLE_UPDATER ON)
|
||||
set_option(ENABLE_RTMPS ON)
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_NAME "OBS")
|
||||
set(CPACK_PACKAGE_VENDOR "${OBS_WEBSITE}")
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${OBS_COMMENTS}")
|
||||
|
||||
if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
|
||||
set(CPACK_ARCH_SUFFIX "Intel")
|
||||
elseif(CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
|
||||
set(CPACK_ARCH_SUFFIX "Apple")
|
||||
else()
|
||||
set(CPACK_ARCH_SUFFIX "Universal")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_FILE_NAME
|
||||
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-macOS-${CPACK_ARCH_SUFFIX}"
|
||||
)
|
||||
|
||||
set(CPACK_COMPONENTS_ALL obs_app obs_frameworks obs_plugins
|
||||
obs_scripting_plugins obs_resources)
|
||||
set(CPACK_COMPONENT_OBS_APP_DISPLAY_NAME "OBS Studio")
|
||||
set(CPACK_COMPONENT_OBS_FRAMEWORKS_DISPLAY_NAME "OBS Frameworks")
|
||||
set(CPACK_COMPONENT_OBS_PLUGINS_DISPLAY_NAME "OBS Plugins")
|
||||
set(CPACK_COMPONENT_OBS_SCRIPTING_PLUGINS_DISPLAY_NAME
|
||||
"OBS Scripting Plugins")
|
||||
set(CPACK_COMPONENT_OBS_RESOURCES_DISPLAY_NAME "OBS Resources")
|
||||
|
||||
set(CPACK_DMG_BACKGROUND_IMAGE
|
||||
"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/background.tiff")
|
||||
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/AppIcon.icns")
|
||||
get_filename_component(CPACK_DMG_BACKGROUND_FILENAME
|
||||
${CPACK_DMG_BACKGROUND_IMAGE} NAME)
|
||||
set(CPACK_DMG_FORMAT "UDZO")
|
||||
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_BINARY_DIR}/package.applescript")
|
||||
|
||||
set(_DMG_WINDOW_X "100")
|
||||
set(_DMG_WINDOW_Y "100")
|
||||
set(_DMG_WINDOW_WIDTH "540")
|
||||
set(_DMG_WINDOW_HEIGHT "380")
|
||||
set(_DMG_ICON_SIZE "96")
|
||||
set(_DMG_TEXT_SIZE "16")
|
||||
set(_DMG_OBS_X "124")
|
||||
set(_DMG_OBS_Y "180")
|
||||
set(_DMG_APP_LINK_X "416")
|
||||
set(_DMG_APP_LINK_Y "180")
|
||||
|
||||
configure_file("${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/package.applescript.in"
|
||||
"${CMAKE_BINARY_DIR}/package.applescript" @ONLY)
|
||||
|
||||
include(CPack)
|
||||
|
||||
if(ENABLE_UI)
|
||||
install(
|
||||
CODE "
|
||||
set(_BUNDLENAME \"$<TARGET_FILE_BASE_NAME:obs>.app\")
|
||||
if(EXISTS \"\${CMAKE_INSTALL_PREFIX}/\${_BUNDLENAME}\")
|
||||
file(REMOVE_RECURSE \"\${CMAKE_INSTALL_PREFIX}/\${_BUNDLENAME}\")
|
||||
endif()")
|
||||
endif()
|
||||
endmacro()
|
|
@ -1,587 +1,445 @@
|
|||
set(OBS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/rundir")
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
# Set OS-specific constants in non-deprecated way
|
||||
include(GNUInstallDirs)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
include(ObsDefaults_macOS)
|
||||
set(OS_MACOS ON)
|
||||
set(OS_POSIX ON)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
|
||||
include(ObsDefaults_Linux)
|
||||
set(OS_POSIX ON)
|
||||
string(TOUPPER "${CMAKE_SYSTEM_NAME}" _SYSTEM_NAME_U)
|
||||
set(OS_${_SYSTEM_NAME_U} ON)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
include(ObsDefaults_Windows)
|
||||
set(OS_WINDOWS ON)
|
||||
set(OS_POSIX OFF)
|
||||
endif()
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
set(_struct_def FALSE)
|
||||
else()
|
||||
set(_struct_def TRUE)
|
||||
endif()
|
||||
# Create global property to hold list of activated modules
|
||||
set_property(GLOBAL PROPERTY OBS_MODULE_LIST "")
|
||||
|
||||
option(INSTALLER_RUN "Build a multiarch installer, needs to run indenepdently after both archs have compiled" FALSE)
|
||||
option(UNIX_STRUCTURE "Build with standard unix filesystem structure" ${_struct_def})
|
||||
if(APPLE)
|
||||
option(BUILD_REDISTRIBUTABLE "Fix rpath of external libraries" FALSE)
|
||||
endif()
|
||||
# ##############################################################################
|
||||
# GLOBAL HELPER FUNCTIONS #
|
||||
# ##############################################################################
|
||||
|
||||
if(INSTALLER_RUN AND NOT DEFINED ENV{obsInstallerTempDir})
|
||||
message(FATAL_ERROR "Environment variable obsInstallerTempDir is needed for multiarch installer generation")
|
||||
endif()
|
||||
# Helper function to set up runtime or library targets
|
||||
function(setup_binary_target target)
|
||||
# Set up installation paths for program install
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME DESTINATION ${OBS_EXECUTABLE_DESTINATION}
|
||||
COMPONENT ${target}_Runtime
|
||||
LIBRARY DESTINATION ${OBS_LIBRARY_DESTINATION}
|
||||
COMPONENT ${target}_Runtime
|
||||
NAMELINK_COMPONENT ${target}_Development
|
||||
ARCHIVE DESTINATION ${OBS_LIBRARY_DESTINATION}
|
||||
COMPONENT ${target}_Development
|
||||
PUBLIC_HEADER DESTINATION ${OBS_INCLUDE_DESTINATION})
|
||||
|
||||
if(DEFINED ENV{obsInstallerTempDir})
|
||||
file(TO_CMAKE_PATH "$ENV{obsInstallerTempDir}" ENV{obsInstallerTempDir})
|
||||
endif()
|
||||
# Set up installation paths for development rundir
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME DESTINATION ${OBS_EXECUTABLE_DESTINATION} COMPONENT obs_rundir
|
||||
LIBRARY DESTINATION ${OBS_LIBRARY_DESTINATION} COMPONENT obs_rundir
|
||||
PUBLIC_HEADER DESTINATION ${OBS_INCLUDE_DESTINATION} EXCLUDE_FROM_ALL)
|
||||
|
||||
if(DEFINED ENV{obsAdditionalInstallFiles})
|
||||
file(TO_CMAKE_PATH "$ENV{obsAdditionalInstallFiles}" ENV{obsAdditionalInstallFiles})
|
||||
else()
|
||||
set(ENV{obsAdditionalInstallFiles} "${CMAKE_SOURCE_DIR}/additional_install_files")
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_INCLUDE_PATH
|
||||
"$ENV{obsAdditionalInstallFiles}/include${_lib_suffix}"
|
||||
"$ENV{obsAdditionalInstallFiles}/include")
|
||||
|
||||
list(APPEND CMAKE_LIBRARY_PATH
|
||||
"$ENV{obsAdditionalInstallFiles}/lib${_lib_suffix}"
|
||||
"$ENV{obsAdditionalInstallFiles}/lib"
|
||||
"$ENV{obsAdditionalInstallFiles}/libs${_lib_suffix}"
|
||||
"$ENV{obsAdditionalInstallFiles}/libs"
|
||||
"$ENV{obsAdditionalInstallFiles}/bin${_lib_suffix}"
|
||||
"$ENV{obsAdditionalInstallFiles}/bin")
|
||||
|
||||
if(NOT UNIX_STRUCTURE)
|
||||
set(OBS_DATA_DESTINATION "data")
|
||||
if(APPLE)
|
||||
set(OBS_EXECUTABLE_DESTINATION "bin")
|
||||
set(OBS_EXECUTABLE32_DESTINATION "bin")
|
||||
set(OBS_EXECUTABLE64_DESTINATION "bin")
|
||||
set(OBS_LIBRARY_DESTINATION "bin")
|
||||
set(OBS_LIBRARY32_DESTINATION "bin")
|
||||
set(OBS_LIBRARY64_DESTINATION "bin")
|
||||
set(OBS_PLUGIN_DESTINATION "obs-plugins")
|
||||
set(OBS_PLUGIN32_DESTINATION "obs-plugins")
|
||||
set(OBS_PLUGIN64_DESTINATION "obs-plugins")
|
||||
|
||||
set(OBS_DATA_PATH "../${OBS_DATA_DESTINATION}")
|
||||
set(OBS_INSTALL_PREFIX "")
|
||||
set(OBS_RELATIVE_PREFIX "../")
|
||||
|
||||
set(OBS_SCRIPT_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-scripting")
|
||||
else()
|
||||
set(OBS_EXECUTABLE_DESTINATION "bin/${_lib_suffix}bit")
|
||||
set(OBS_EXECUTABLE32_DESTINATION "bin/32bit")
|
||||
set(OBS_EXECUTABLE64_DESTINATION "bin/64bit")
|
||||
set(OBS_LIBRARY_DESTINATION "bin/${_lib_suffix}bit")
|
||||
set(OBS_LIBRARY32_DESTINATION "bin/32bit")
|
||||
set(OBS_LIBRARY64_DESTINATION "bin/64bit")
|
||||
set(OBS_PLUGIN_DESTINATION "obs-plugins/${_lib_suffix}bit")
|
||||
set(OBS_PLUGIN32_DESTINATION "obs-plugins/32bit")
|
||||
set(OBS_PLUGIN64_DESTINATION "obs-plugins/64bit")
|
||||
|
||||
set(OBS_DATA_PATH "../../${OBS_DATA_DESTINATION}")
|
||||
set(OBS_INSTALL_PREFIX "")
|
||||
set(OBS_RELATIVE_PREFIX "../../")
|
||||
|
||||
set(OBS_SCRIPT_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-scripting/${_lib_suffix}bit")
|
||||
endif()
|
||||
set(OBS_CMAKE_DESTINATION "cmake")
|
||||
set(OBS_INCLUDE_DESTINATION "include")
|
||||
set(OBS_UNIX_STRUCTURE "0")
|
||||
|
||||
set(OBS_SCRIPT_PLUGIN_PATH "${OBS_RELATIVE_PREFIX}${OBS_SCRIPT_PLUGIN_DESTINATION}")
|
||||
else()
|
||||
if(NOT OBS_MULTIARCH_SUFFIX AND DEFINED ENV{OBS_MULTIARCH_SUFFIX})
|
||||
set(OBS_MULTIARCH_SUFFIX "$ENV{OBS_MULTIARCH_SUFFIX}")
|
||||
endif()
|
||||
|
||||
set(OBS_EXECUTABLE_DESTINATION "bin")
|
||||
set(OBS_EXECUTABLE32_DESTINATION "bin32")
|
||||
set(OBS_EXECUTABLE64_DESTINATION "bin64")
|
||||
set(OBS_LIBRARY_DESTINATION "lib${OBS_MULTIARCH_SUFFIX}")
|
||||
set(OBS_LIBRARY32_DESTINATION "lib32")
|
||||
set(OBS_LIBRARY64_DESTINATION "lib64")
|
||||
set(OBS_PLUGIN_DESTINATION "${OBS_LIBRARY_DESTINATION}/obs-plugins")
|
||||
set(OBS_PLUGIN32_DESTINATION "${OBS_LIBRARY32_DESTINATION}/obs-plugins")
|
||||
set(OBS_PLUGIN64_DESTINATION "${OBS_LIBRARY64_DESTINATION}/obs-plugins")
|
||||
set(OBS_DATA_DESTINATION "share/obs")
|
||||
set(OBS_CMAKE_DESTINATION "${OBS_LIBRARY_DESTINATION}/cmake")
|
||||
set(OBS_INCLUDE_DESTINATION "include/obs")
|
||||
|
||||
set(OBS_DATA_PATH "${OBS_DATA_DESTINATION}")
|
||||
set(OBS_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
|
||||
set(OBS_RELATIVE_PREFIX "../")
|
||||
set(OBS_UNIX_STRUCTURE "1")
|
||||
|
||||
set(OBS_SCRIPT_PLUGIN_DESTINATION "${OBS_LIBRARY_DESTINATION}/obs-scripting")
|
||||
set(OBS_SCRIPT_PLUGIN_PATH "${OBS_INSTALL_PREFIX}${OBS_SCRIPT_PLUGIN_DESTINATION}")
|
||||
endif()
|
||||
|
||||
function(obs_generate_multiarch_installer)
|
||||
install(DIRECTORY "$ENV{obsInstallerTempDir}/"
|
||||
DESTINATION "."
|
||||
USE_SOURCE_PERMISSIONS)
|
||||
endfunction()
|
||||
|
||||
function(obs_helper_copy_dir target target_configs source dest)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
"-DCONFIG=$<CONFIGURATION>"
|
||||
"-DTARGET_CONFIGS=${target_configs}"
|
||||
"-DINPUT=${source}"
|
||||
"-DOUTPUT=${dest}"
|
||||
-P "${CMAKE_SOURCE_DIR}/cmake/copy_helper.cmake"
|
||||
VERBATIM)
|
||||
# Helper function to set up OBS plugin targets
|
||||
function(setup_plugin_target target)
|
||||
set_target_properties(${target} PROPERTIES PREFIX "")
|
||||
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME DESTINATION ${OBS_PLUGIN_DESTINATION} COMPONENT ${target}_Runtime
|
||||
LIBRARY DESTINATION ${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT ${target}_Runtime
|
||||
NAMELINK_COMPONENT ${target}_Development)
|
||||
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME DESTINATION ${OBS_PLUGIN_DESTINATION} COMPONENT obs_rundir
|
||||
LIBRARY DESTINATION ${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
setup_target_resources("${target}" "obs-plugins/${target}")
|
||||
set_property(GLOBAL APPEND PROPERTY OBS_MODULE_LIST "${target}")
|
||||
message(STATUS "OBS: ENABLED ${target}")
|
||||
endfunction()
|
||||
|
||||
function(obs_install_additional maintarget)
|
||||
set(addfdir "${CMAKE_SOURCE_DIR}/additional_install_files")
|
||||
if(DEFINED ENV{obsAdditionalInstallFiles})
|
||||
set(addfdir "$ENV{obsAdditionalInstallFiles}")
|
||||
endif()
|
||||
# Helper function to set up OBS scripting plugin targets
|
||||
function(setup_script_plugin_target target)
|
||||
set_target_properties(${target} PROPERTIES PREFIX "")
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
install(
|
||||
TARGETS ${target}
|
||||
LIBRARY DESTINATION ${OBS_SCRIPT_PLUGIN_DESTINATION}
|
||||
COMPONENT ${target}_Runtime
|
||||
NAMELINK_COMPONENT ${target}_Development)
|
||||
|
||||
install(DIRECTORY "${addfdir}/misc/"
|
||||
DESTINATION "."
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/data/"
|
||||
DESTINATION "${OBS_DATA_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(
|
||||
TARGETS ${target}
|
||||
LIBRARY DESTINATION ${OBS_SCRIPT_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(INSTALLER_RUN)
|
||||
install(DIRECTORY "${addfdir}/libs32/"
|
||||
DESTINATION "${OBS_LIBRARY32_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/exec32/"
|
||||
DESTINATION "${OBS_EXECUTABLE32_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/libs64/"
|
||||
DESTINATION "${OBS_LIBRARY64_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/exec64/"
|
||||
DESTINATION "${OBS_EXECUTABLE64_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
if(${target} STREQUAL "obspython")
|
||||
install(
|
||||
FILES "$<TARGET_FILE_DIR:${target}>/$<TARGET_FILE_BASE_NAME:${target}>.py"
|
||||
DESTINATION ${OBS_SCRIPT_PLUGIN_DESTINATION}
|
||||
COMPONENT ${target}_Runtime)
|
||||
|
||||
install(DIRECTORY "${addfdir}/libs32d/"
|
||||
DESTINATION "${OBS_LIBRARY32_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Debug
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/exec32d/"
|
||||
DESTINATION "${OBS_EXECUTABLE32_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Debug
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/libs64d/"
|
||||
DESTINATION "${OBS_LIBRARY64_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Debug
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/exec64d/"
|
||||
DESTINATION "${OBS_EXECUTABLE64_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Debug
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
|
||||
install(DIRECTORY "${addfdir}/libs32r/"
|
||||
DESTINATION "${OBS_LIBRARY32_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Release RelWithDebInfo MinSizeRel
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/exec32r/"
|
||||
DESTINATION "${OBS_EXECUTABLE32_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Release RelWithDebInfo MinSizeRel
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/libs64r/"
|
||||
DESTINATION "${OBS_LIBRARY64_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Release RelWithDebInfo MinSizeRel
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/exec64r/"
|
||||
DESTINATION "${OBS_EXECUTABLE64_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Release RelWithDebInfo MinSizeRel
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
else()
|
||||
install(DIRECTORY "${addfdir}/libs${_lib_suffix}/"
|
||||
DESTINATION "${OBS_LIBRARY_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/exec${_lib_suffix}/"
|
||||
DESTINATION "${OBS_EXECUTABLE_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
|
||||
install(DIRECTORY "${addfdir}/libs${_lib_suffix}d/"
|
||||
DESTINATION "${OBS_LIBRARY_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Debug
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/exec${_lib_suffix}d/"
|
||||
DESTINATION "${OBS_EXECUTABLE_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Debug
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
|
||||
install(DIRECTORY "${addfdir}/libs${_lib_suffix}r/"
|
||||
DESTINATION "${OBS_LIBRARY_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Release RelWithDebInfo MinSizeRel
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
install(DIRECTORY "${addfdir}/exec${_lib_suffix}r/"
|
||||
DESTINATION "${OBS_EXECUTABLE_DESTINATION}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
CONFIGURATIONS Release RelWithDebInfo MinSizeRel
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
endif()
|
||||
|
||||
obs_helper_copy_dir(${maintarget} ALL
|
||||
"${addfdir}/misc/"
|
||||
"${CMAKE_BINARY_DIR}/rundir/$<CONFIGURATION>/")
|
||||
obs_helper_copy_dir(${maintarget} ALL
|
||||
"${addfdir}/data/"
|
||||
"${CMAKE_BINARY_DIR}/rundir/$<CONFIGURATION>/${OBS_DATA_DESTINATION}/")
|
||||
obs_helper_copy_dir(${maintarget} ALL
|
||||
"${addfdir}/libs${_lib_suffix}/"
|
||||
"${CMAKE_BINARY_DIR}/rundir/$<CONFIGURATION>/${OBS_LIBRARY_DESTINATION}/")
|
||||
obs_helper_copy_dir(${maintarget} ALL
|
||||
"${addfdir}/exec${_lib_suffix}/"
|
||||
"${CMAKE_BINARY_DIR}/rundir/$<CONFIGURATION>/${OBS_EXECUTABLE_DESTINATION}/")
|
||||
|
||||
obs_helper_copy_dir(${maintarget} "Release;MinSizeRel;RelWithDebInfo"
|
||||
"${addfdir}/exec${_lib_suffix}r/"
|
||||
"${CMAKE_BINARY_DIR}/rundir/$<CONFIGURATION>/${OBS_EXECUTABLE_DESTINATION}/")
|
||||
obs_helper_copy_dir(${maintarget} "Debug"
|
||||
"${addfdir}/exec${_lib_suffix}d/"
|
||||
"${CMAKE_BINARY_DIR}/rundir/$<CONFIGURATION>/${OBS_EXECUTABLE_DESTINATION}/")
|
||||
obs_helper_copy_dir(${maintarget} "Release;MinSizeRel;RelWithDebInfo"
|
||||
"${addfdir}/libs${_lib_suffix}r/"
|
||||
"${CMAKE_BINARY_DIR}/rundir/$<CONFIGURATION>/${OBS_LIBRARY_DESTINATION}/")
|
||||
obs_helper_copy_dir(${maintarget} "Debug"
|
||||
"${addfdir}/libs${_lib_suffix}d/"
|
||||
"${CMAKE_BINARY_DIR}/rundir/$<CONFIGURATION>/${OBS_LIBRARY_DESTINATION}/")
|
||||
install(
|
||||
FILES "$<TARGET_FILE_DIR:${target}>/$<TARGET_FILE_BASE_NAME:${target}>.py"
|
||||
DESTINATION ${OBS_SCRIPT_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
set_property(GLOBAL APPEND PROPERTY OBS_SCRIPTING_MODULE_LIST "${target}")
|
||||
message(STATUS "OBS: ENABLED ${target}")
|
||||
endfunction()
|
||||
|
||||
function(export_obs_core target exportname)
|
||||
install(TARGETS ${target}
|
||||
EXPORT "${exportname}Target"
|
||||
LIBRARY DESTINATION "${OBS_LIBRARY_DESTINATION}"
|
||||
ARCHIVE DESTINATION "${OBS_LIBRARY_DESTINATION}"
|
||||
RUNTIME DESTINATION "${OBS_EXECUTABLE_DESTINATION}")
|
||||
# Helper function to set up target resources (e.g. L10N files)
|
||||
function(setup_target_resources target destination)
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
|
||||
install(
|
||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/
|
||||
DESTINATION ${OBS_DATA_DESTINATION}/${destination}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT ${target}_Runtime)
|
||||
|
||||
export(TARGETS ${target} FILE "${CMAKE_CURRENT_BINARY_DIR}/${exportname}Target.cmake")
|
||||
export(PACKAGE "${exportname}")
|
||||
|
||||
set(CONF_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(CONF_PLUGIN_DEST "${CMAKE_BINARY_DIR}/rundir/${CMAKE_BUILD_TYPE}/obs-plugins/${_lib_suffix}bit")
|
||||
set(CONF_PLUGIN_DEST32 "${CMAKE_BINARY_DIR}/rundir/${CMAKE_BUILD_TYPE}/obs-plugins/32bit")
|
||||
set(CONF_PLUGIN_DEST64 "${CMAKE_BINARY_DIR}/rundir/${CMAKE_BUILD_TYPE}/obs-plugins/64bit")
|
||||
set(CONF_PLUGIN_DATA_DEST "${CMAKE_BINARY_DIR}/rundir/${CMAKE_BUILD_TYPE}/data/obs-plugins")
|
||||
configure_file("${exportname}Config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${exportname}Config.cmake" @ONLY)
|
||||
|
||||
file(RELATIVE_PATH _pdir "${CMAKE_INSTALL_PREFIX}/${OBS_CMAKE_DESTINATION}/${exportname}" "${CMAKE_INSTALL_PREFIX}")
|
||||
set(CONF_INCLUDE_DIRS "\${CMAKE_CURRENT_LIST_DIR}/${_pdir}${OBS_INCLUDE_DESTINATION}")
|
||||
set(CONF_PLUGIN_DEST "\${CMAKE_CURRENT_LIST_DIR}/${_pdir}${OBS_PLUGIN_DESTINATION}")
|
||||
set(CONF_PLUGIN_DEST32 "\${CMAKE_CURRENT_LIST_DIR}/${_pdir}${OBS_PLUGIN32_DESTINATION}")
|
||||
set(CONF_PLUGIN_DEST64 "\${CMAKE_CURRENT_LIST_DIR}/${_pdir}${OBS_PLUGIN64_DESTINATION}")
|
||||
set(CONF_PLUGIN_DATA_DEST "\${CMAKE_CURRENT_LIST_DIR}/${_pdir}${OBS_DATA_DESTINATION}/obs-plugins")
|
||||
configure_file("${exportname}Config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${exportname}Config.cmake" @ONLY)
|
||||
|
||||
set(_pdir)
|
||||
|
||||
configure_file("${exportname}ConfigVersion.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${exportname}ConfigVersion.cmake" @ONLY)
|
||||
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${exportname}Config.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${exportname}ConfigVersion.cmake"
|
||||
DESTINATION "${OBS_CMAKE_DESTINATION}/${exportname}")
|
||||
|
||||
install(EXPORT "${exportname}Target"
|
||||
DESTINATION "${OBS_CMAKE_DESTINATION}/${exportname}")
|
||||
install(
|
||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/
|
||||
DESTINATION ${OBS_DATA_DESTINATION}/${destination}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(install_obs_headers)
|
||||
foreach(hdr ${ARGN})
|
||||
if(IS_ABSOLUTE "${hdr}")
|
||||
set(subdir)
|
||||
else()
|
||||
get_filename_component(subdir "${hdr}" DIRECTORY)
|
||||
if(subdir)
|
||||
set(subdir "/${subdir}")
|
||||
endif()
|
||||
endif()
|
||||
install(FILES "${hdr}" DESTINATION "${OBS_INCLUDE_DESTINATION}${subdir}")
|
||||
endforeach()
|
||||
# Helper function to set up specific resource files for targets
|
||||
function(add_target_resource target resource destination)
|
||||
install(
|
||||
FILES ${resource}
|
||||
DESTINATION ${OBS_DATA_DESTINATION}/${destination}
|
||||
COMPONENT ${target}_Runtime)
|
||||
|
||||
install(
|
||||
FILES ${resource}
|
||||
DESTINATION
|
||||
${OBS_OUTPUT_DIR}/$<CONFIG>/${OBS_DATA_DESTINATION}/${destination}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endfunction()
|
||||
|
||||
function(obs_debug_copy_helper target dest)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
"-DCONFIG=$<CONFIGURATION>"
|
||||
"-DFNAME=$<TARGET_FILE_NAME:${target}>"
|
||||
"-DINPUT=$<TARGET_FILE_DIR:${target}>"
|
||||
"-DOUTPUT=${dest}"
|
||||
-P "${CMAKE_SOURCE_DIR}/cmake/copy_on_debug_helper.cmake"
|
||||
VERBATIM)
|
||||
# Helper function to set up OBS app target
|
||||
function(setup_obs_app target)
|
||||
setup_binary_target(${target})
|
||||
|
||||
get_property(OBS_MODULE_LIST GLOBAL PROPERTY OBS_MODULE_LIST)
|
||||
list(LENGTH OBS_MODULE_LIST _LEN)
|
||||
if(_LEN GREATER 0)
|
||||
add_dependencies(${target} ${OBS_MODULE_LIST})
|
||||
endif()
|
||||
|
||||
get_property(OBS_SCRIPTING_MODULE_LIST GLOBAL
|
||||
PROPERTY OBS_SCRIPTING_MODULE_LIST)
|
||||
list(LENGTH OBS_SCRIPTING_MODULE_LIST _LEN)
|
||||
if(_LEN GREATER 0)
|
||||
add_dependencies(${target} ${OBS_SCRIPTING_MODULE_LIST})
|
||||
endif()
|
||||
|
||||
# detect outdated obs-browser submodule
|
||||
if(NOT TARGET OBS::browser AND TARGET obs-browser)
|
||||
target_compile_features(obs-browser-page PRIVATE cxx_std_17)
|
||||
|
||||
add_library(OBS::browser ALIAS obs-browser)
|
||||
|
||||
if(NOT TARGET OBS::browser-panels AND BROWSER_PANEL_SUPPORT_ENABLED)
|
||||
add_library(OBS::browser-panels ALIAS obs-browser)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TARGET OBS::browser)
|
||||
setup_target_browser(${target})
|
||||
endif()
|
||||
|
||||
if(TARGET OBS::ffmpeg-mux)
|
||||
add_dependencies(${target} OBS::ffmpeg-mux)
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" --install .. --config $<CONFIG> --prefix
|
||||
${OBS_OUTPUT_DIR}/$<CONFIG> --component obs_rundir
|
||||
COMMENT "Installing OBS rundir"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
|
||||
function(install_obs_pdb ttype target)
|
||||
if(NOT MSVC)
|
||||
return()
|
||||
endif()
|
||||
# Helper function to do additional setup for browser source plugin
|
||||
function(setup_target_browser target)
|
||||
install(
|
||||
DIRECTORY ${CEF_ROOT_DIR}/Resources/
|
||||
DESTINATION ${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT ${target}_Runtime)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bit_suffix "64bit")
|
||||
else()
|
||||
set(_bit_suffix "32bit")
|
||||
endif()
|
||||
install(
|
||||
DIRECTORY ${CEF_ROOT_DIR}/Release/
|
||||
DESTINATION ${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT ${target}_Runtime)
|
||||
|
||||
obs_debug_copy_helper(${target} "${CMAKE_CURRENT_BINARY_DIR}/pdbs")
|
||||
install(
|
||||
DIRECTORY ${CEF_ROOT_DIR}/Resources/
|
||||
DESTINATION ${OBS_OUTPUT_DIR}/$<CONFIG>/${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if("${ttype}" STREQUAL "PLUGIN")
|
||||
obs_debug_copy_helper(${target} "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/obs-plugins/${_bit_suffix}")
|
||||
|
||||
if(DEFINED ENV{obsInstallerTempDir})
|
||||
obs_debug_copy_helper(${target} "$ENV{obsInstallerTempDir}/${OBS_PLUGIN_DESTINATION}")
|
||||
endif()
|
||||
|
||||
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pdbs/"
|
||||
DESTINATION "${OBS_PLUGIN_DESTINATION}"
|
||||
CONFIGURATIONS Debug RelWithDebInfo)
|
||||
else()
|
||||
obs_debug_copy_helper(${target} "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/bin/${_bit_suffix}")
|
||||
|
||||
if(DEFINED ENV{obsInstallerTempDir})
|
||||
obs_debug_copy_helper(${target} "$ENV{obsInstallerTempDir}/${OBS_EXECUTABLE_DESTINATION}")
|
||||
endif()
|
||||
|
||||
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pdbs/"
|
||||
DESTINATION "${OBS_EXECUTABLE_DESTINATION}"
|
||||
CONFIGURATIONS Debug RelWithDebInfo)
|
||||
endif()
|
||||
install(
|
||||
DIRECTORY ${CEF_ROOT_DIR}/Release/
|
||||
DESTINATION ${OBS_OUTPUT_DIR}/$<CONFIG>/${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endfunction()
|
||||
|
||||
function(install_obs_core target)
|
||||
if(APPLE)
|
||||
set(_bit_suffix "")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bit_suffix "64bit/")
|
||||
else()
|
||||
set(_bit_suffix "32bit/")
|
||||
endif()
|
||||
# Helper function to export target to build and install tree. Allows usage of
|
||||
# `find_package(libobs)` by other build trees
|
||||
function(export_target target)
|
||||
set(CMAKE_EXPORT_PACKAGE_REGISTRY OFF)
|
||||
|
||||
if("${ARGV1}" STREQUAL "EXPORT")
|
||||
export_obs_core("${target}" "${ARGV2}")
|
||||
else()
|
||||
install(TARGETS ${target}
|
||||
LIBRARY DESTINATION "${OBS_LIBRARY_DESTINATION}"
|
||||
RUNTIME DESTINATION "${OBS_EXECUTABLE_DESTINATION}")
|
||||
endif()
|
||||
install(
|
||||
TARGETS ${target}
|
||||
EXPORT ${target}Targets
|
||||
RUNTIME DESTINATION ${OBS_EXECUTABLE_DESTINATION} COMPONENT obs_libraries
|
||||
LIBRARY DESTINATION ${OBS_LIBRARY_DESTINATION} COMPONENT obs_libraries
|
||||
ARCHIVE DESTINATION ${OBS_LIBRARY_DESTINATION} COMPONENT obs_libraries
|
||||
INCLUDES
|
||||
DESTINATION ${OBS_INCLUDE_DESTINATION}
|
||||
PUBLIC_HEADER
|
||||
DESTINATION ${OBS_INCLUDE_DESTINATION}
|
||||
COMPONENT obs_libraries
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"$<TARGET_FILE:${target}>"
|
||||
"${OBS_OUTPUT_DIR}/$<CONFIGURATION>/bin/${_bit_suffix}$<TARGET_FILE_NAME:${target}>"
|
||||
VERBATIM)
|
||||
include(GenerateExportHeader)
|
||||
generate_export_header(${target} EXPORT_FILE_NAME
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}_EXPORT.h)
|
||||
|
||||
if(DEFINED ENV{obsInstallerTempDir})
|
||||
get_property(target_type TARGET ${target} PROPERTY TYPE)
|
||||
if("${target_type}" STREQUAL "EXECUTABLE")
|
||||
set(tmp_target_dir "${OBS_EXECUTABLE_DESTINATION}")
|
||||
else()
|
||||
set(tmp_target_dir "${OBS_LIBRARY_DESTINATION}")
|
||||
endif()
|
||||
target_sources(${target}
|
||||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${target}_EXPORT.h)
|
||||
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"$<TARGET_FILE:${target}>"
|
||||
"$ENV{obsInstallerTempDir}/${tmp_target_dir}/$<TARGET_FILE_NAME:${target}>"
|
||||
VERBATIM)
|
||||
endif()
|
||||
set(TARGETS_EXPORT_NAME "${target}Targets")
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${target}Config.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake
|
||||
INSTALL_DESTINATION ${OBS_CMAKE_DESTINATION}/${target}
|
||||
PATH_VARS OBS_PLUGIN_DESTINATION OBS_DATA_DESTINATION)
|
||||
|
||||
install_obs_pdb(CORE ${target})
|
||||
write_basic_package_version_file(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake
|
||||
VERSION ${OBS_VERSION_CANONICAL}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
export(
|
||||
EXPORT ${target}Targets
|
||||
FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGETS_EXPORT_NAME}.cmake
|
||||
NAMESPACE OBS::)
|
||||
|
||||
export(PACKAGE "${target}")
|
||||
|
||||
install(
|
||||
EXPORT ${TARGETS_EXPORT_NAME}
|
||||
FILE ${TARGETS_EXPORT_NAME}.cmake
|
||||
NAMESPACE OBS::
|
||||
DESTINATION ${OBS_CMAKE_DESTINATION}/${target}
|
||||
COMPONENT obs_libraries
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake
|
||||
DESTINATION ${OBS_CMAKE_DESTINATION}/${target}
|
||||
COMPONENT obs_libraries
|
||||
EXCLUDE_FROM_ALL)
|
||||
endfunction()
|
||||
|
||||
function(install_obs_bin target mode)
|
||||
foreach(bin ${ARGN})
|
||||
if(APPLE)
|
||||
set(_bit_suffix "")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bit_suffix "64bit/")
|
||||
else()
|
||||
set(_bit_suffix "32bit/")
|
||||
endif()
|
||||
# Helper function to install header files
|
||||
function(install_headers target)
|
||||
install(
|
||||
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/"
|
||||
DESTINATION ${OBS_INCLUDE_DESTINATION}
|
||||
COMPONENT obs_libraries
|
||||
EXCLUDE_FROM_ALL FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.hpp"
|
||||
PATTERN "cmake" EXCLUDE
|
||||
PATTERN "pkgconfig" EXCLUDE
|
||||
PATTERN "data" EXCLUDE)
|
||||
|
||||
if(NOT IS_ABSOLUTE "${bin}")
|
||||
set(bin "${CMAKE_CURRENT_SOURCE_DIR}/${bin}")
|
||||
endif()
|
||||
|
||||
get_filename_component(fname "${bin}" NAME)
|
||||
|
||||
if(NOT "${mode}" MATCHES "INSTALL_ONLY")
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"${bin}"
|
||||
"${OBS_OUTPUT_DIR}/$<CONFIGURATION>/bin/${_bit_suffix}${fname}"
|
||||
VERBATIM)
|
||||
endif()
|
||||
|
||||
install(FILES "${bin}"
|
||||
DESTINATION "${OBS_EXECUTABLE_DESTINATION}")
|
||||
|
||||
if(DEFINED ENV{obsInstallerTempDir})
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"${bin}"
|
||||
"$ENV{obsInstallerTempDir}/${OBS_EXECUTABLE_DESTINATION}/${fname}"
|
||||
VERBATIM)
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function(install_obs_plugin target)
|
||||
if(APPLE)
|
||||
set(_bit_suffix "")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bit_suffix "64bit/")
|
||||
else()
|
||||
set(_bit_suffix "32bit/")
|
||||
endif()
|
||||
|
||||
set_target_properties(${target} PROPERTIES
|
||||
PREFIX "")
|
||||
|
||||
install(TARGETS ${target}
|
||||
LIBRARY DESTINATION "${OBS_PLUGIN_DESTINATION}"
|
||||
RUNTIME DESTINATION "${OBS_PLUGIN_DESTINATION}")
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"$<TARGET_FILE:${target}>"
|
||||
"${OBS_OUTPUT_DIR}/$<CONFIGURATION>/obs-plugins/${_bit_suffix}$<TARGET_FILE_NAME:${target}>"
|
||||
VERBATIM)
|
||||
|
||||
if(DEFINED ENV{obsInstallerTempDir})
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"$<TARGET_FILE:${target}>" "$ENV{obsInstallerTempDir}/${OBS_PLUGIN_DESTINATION}/$<TARGET_FILE_NAME:${target}>"
|
||||
VERBATIM)
|
||||
endif()
|
||||
|
||||
install_obs_pdb(PLUGIN ${target})
|
||||
endfunction()
|
||||
|
||||
function(install_obs_data target datadir datadest)
|
||||
install(DIRECTORY ${datadir}/
|
||||
DESTINATION "${OBS_DATA_DESTINATION}/${datadest}"
|
||||
USE_SOURCE_PERMISSIONS)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${datadir}" "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/${datadest}"
|
||||
VERBATIM)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND DEFINED ENV{obsInstallerTempDir})
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${datadir}" "$ENV{obsInstallerTempDir}/${OBS_DATA_DESTINATION}/${datadest}"
|
||||
VERBATIM)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(install_obs_data_from_abs_path target datadir datadest)
|
||||
install(DIRECTORY ${datadir}/
|
||||
DESTINATION "${OBS_DATA_DESTINATION}/${datadest}"
|
||||
USE_SOURCE_PERMISSIONS)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||
"${datadir}" "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/${datadest}"
|
||||
VERBATIM)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND DEFINED ENV{obsInstallerTempDir})
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||
"${datadir}" "$ENV{obsInstallerTempDir}/${OBS_DATA_DESTINATION}/${datadest}"
|
||||
VERBATIM)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(install_obs_data_file target datafile datadest)
|
||||
install(FILES ${datafile}
|
||||
DESTINATION "${OBS_DATA_DESTINATION}/${datadest}")
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E make_directory
|
||||
"${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/${datadest}"
|
||||
VERBATIM)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${datafile}" "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/${datadest}"
|
||||
VERBATIM)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND DEFINED ENV{obsInstallerTempDir})
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E make_directory
|
||||
"$ENV{obsInstallerTempDir}/${OBS_DATA_DESTINATION}/${datadest}"
|
||||
VERBATIM)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${datafile}" "$ENV{obsInstallerTempDir}/${OBS_DATA_DESTINATION}/${datadest}"
|
||||
VERBATIM)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(install_obs_datatarget target datadest)
|
||||
install(TARGETS ${target}
|
||||
LIBRARY DESTINATION "${OBS_DATA_DESTINATION}/${datadest}"
|
||||
RUNTIME DESTINATION "${OBS_DATA_DESTINATION}/${datadest}")
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"$<TARGET_FILE:${target}>"
|
||||
"${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/${datadest}/$<TARGET_FILE_NAME:${target}>"
|
||||
VERBATIM)
|
||||
|
||||
if(DEFINED ENV{obsInstallerTempDir})
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"$<TARGET_FILE:${target}>"
|
||||
"$ENV{obsInstallerTempDir}/${OBS_DATA_DESTINATION}/${datadest}/$<TARGET_FILE_NAME:${target}>"
|
||||
VERBATIM)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
obs_debug_copy_helper(${target} "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/${datadest}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(install_obs_plugin_with_data target datadir)
|
||||
install_obs_plugin(${target})
|
||||
install_obs_data(${target} "${datadir}" "obs-plugins/${target}")
|
||||
if(NOT EXISTS "${OBS_INCLUDE_DESTINATION}/obsconfig.h")
|
||||
install(
|
||||
FILES "${CMAKE_BINARY_DIR}/config/obsconfig.h"
|
||||
DESTINATION "${OBS_INCLUDE_DESTINATION}"
|
||||
COMPONENT obs_libraries
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to define available graphics modules for targets
|
||||
function(define_graphic_modules target)
|
||||
foreach(dl_lib opengl d3d9 d3d11)
|
||||
string(TOUPPER ${dl_lib} dl_lib_upper)
|
||||
if(TARGET libobs-${dl_lib})
|
||||
if(UNIX AND UNIX_STRUCTURE)
|
||||
target_compile_definitions(${target}
|
||||
PRIVATE
|
||||
DL_${dl_lib_upper}="$<TARGET_SONAME_FILE_NAME:libobs-${dl_lib}>"
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(${target}
|
||||
PRIVATE
|
||||
DL_${dl_lib_upper}="$<TARGET_FILE_NAME:libobs-${dl_lib}>"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
target_compile_definitions(${target}
|
||||
PRIVATE
|
||||
DL_${dl_lib_upper}=""
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
foreach(_GRAPHICS_API metal d3d11 opengl d3d9)
|
||||
string(TOUPPER ${_GRAPHICS_API} _GRAPHICS_API_u)
|
||||
if(TARGET OBS::libobs-${_GRAPHICS_API})
|
||||
if(OS_POSIX AND NOT LINUX_PORTABLE)
|
||||
target_compile_definitions(
|
||||
${target}
|
||||
PRIVATE
|
||||
DL_${_GRAPHICS_API_u}="$<TARGET_SONAME_FILE_NAME:libobs-${_GRAPHICS_API}>"
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(
|
||||
${target}
|
||||
PRIVATE
|
||||
DL_${_GRAPHICS_API_u}="$<TARGET_FILE_NAME:libobs-${_GRAPHICS_API}>")
|
||||
endif()
|
||||
add_dependencies(${target} OBS::libobs-${_GRAPHICS_API})
|
||||
else()
|
||||
target_compile_definitions(${target} PRIVATE DL_${_GRAPHICS_API_u}="")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
macro(find_qt)
|
||||
set(oneValueArgs VERSION)
|
||||
set(multiValueArgs COMPONENTS COMPONENTS_WIN COMPONENTS_MAC COMPONENTS_LINUX)
|
||||
cmake_parse_arguments(FIND_QT "" "${oneValueArgs}" "${multiValueArgs}"
|
||||
${ARGN})
|
||||
|
||||
if(OS_WINDOWS)
|
||||
find_package(
|
||||
Qt${FIND_QT_VERSION}
|
||||
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_WIN}
|
||||
REQUIRED)
|
||||
elseif(OS_MACOS)
|
||||
find_package(
|
||||
Qt${FIND_QT_VERSION}
|
||||
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_MAC}
|
||||
REQUIRED)
|
||||
else()
|
||||
find_package(
|
||||
Qt${FIND_QT_VERSION}
|
||||
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_LINUX}
|
||||
REQUIRED)
|
||||
endif()
|
||||
|
||||
foreach(_COMPONENT IN LISTS FIND_QT_COMPONENTS FIND_QT_COMPONENTS_WIN
|
||||
FIND_QT_COMPONENTS_MAC FIND_QT_COMPONENTS_LINUX)
|
||||
if(NOT TARGET Qt::${_COMPONENT} AND TARGET
|
||||
Qt${FIND_QT_VERSION}::${_COMPONENT})
|
||||
|
||||
add_library(Qt::${_COMPONENT} INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
Qt::${_COMPONENT} PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"Qt${FIND_QT_VERSION}::${_COMPONENT}")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# Idea adapted from: https://github.com/edsiper/cmake-options
|
||||
macro(set_option option value)
|
||||
set(${option}
|
||||
${value}
|
||||
CACHE INTERNAL "")
|
||||
endmacro()
|
||||
|
||||
if(OS_WINDOWS)
|
||||
include(ObsHelpers_Windows)
|
||||
elseif(OS_MACOS)
|
||||
include(ObsHelpers_macOS)
|
||||
elseif(OS_POSIX)
|
||||
include(ObsHelpers_Linux)
|
||||
endif()
|
||||
|
||||
# ##############################################################################
|
||||
# LEGACY FALLBACKS #
|
||||
# ##############################################################################
|
||||
|
||||
# Helper function to install OBS plugin with associated resource directory
|
||||
function(_install_obs_plugin_with_data target source)
|
||||
setup_plugin_target(${target})
|
||||
|
||||
if(NOT ${source} STREQUAL "data"
|
||||
AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${source}"
|
||||
AND NOT OS_MACOS)
|
||||
install(
|
||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${source}/
|
||||
DESTINATION ${OBS_DATA_DESTINATION}/obs-plugins/${target}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT ${target}_Runtime)
|
||||
|
||||
install(
|
||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${source}/
|
||||
DESTINATION
|
||||
${OBS_OUTPUT_DIR}/$<CONFIG>/${OBS_DATA_DESTINATION}/obs-plugins/${target}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(OS_WINDOWS AND DEFINED ENV{obsInstallerTempDir})
|
||||
install(
|
||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${source}/
|
||||
DESTINATION
|
||||
$ENV{obsInstallerTempDir}/${OBS_DATA_DESTINATION}/obs-plugins/${target}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to install OBS plugin
|
||||
function(_install_obs_plugin target)
|
||||
setup_plugin_target(${target})
|
||||
endfunction()
|
||||
|
||||
# Helper function to install data for a target only
|
||||
function(_install_obs_datatarget target destination)
|
||||
install(
|
||||
TARGETS ${target}
|
||||
LIBRARY DESTINATION ${OBS_DATA_DESTINATION}/${destination}
|
||||
COMPONENT ${target}_Runtime
|
||||
NAMELINK_COMPONENT ${target}_Development
|
||||
RUNTIME DESTINATION ${OBS_DATA_DESTINATION}/${destination}
|
||||
COMPONENT ${target}_Runtime)
|
||||
|
||||
install(
|
||||
TARGETS ${target}
|
||||
LIBRARY
|
||||
DESTINATION
|
||||
${OBS_OUTPUT_DIR}/$<CONFIG>/${OBS_DATA_DESTINATION}/${destination}
|
||||
COMPONENT obs_rundir
|
||||
RUNTIME
|
||||
DESTINATION
|
||||
${OBS_OUTPUT_DIR}/$<CONFIG>/${OBS_DATA_DESTINATION}/${destination}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
if(MSVC)
|
||||
add_target_resource(${target} "$<TARGET_PDB_FILE:${target}>"
|
||||
"${destination}")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{obsInstallerTempDir})
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME
|
||||
DESTINATION
|
||||
$ENV{obsInstallerTempDir}/${OBS_DATA_DESTINATION}/${destination}/$<TARGET_FILE_NAME:${target}>
|
||||
LIBRARY
|
||||
DESTINATION
|
||||
$ENV{obsInstallerTempDir}/${OBS_DATA_DESTINATION}/${destination}/$<TARGET_FILE_NAME:${target}>
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
# Helper function to set up runtime or library targets
|
||||
function(setup_binary_target target)
|
||||
set_target_properties(
|
||||
${target}
|
||||
PROPERTIES
|
||||
BUILD_RPATH
|
||||
"${OBS_OUTPUT_DIR}/$<CONFIG>/${OBS_EXECUTABLE_DESTINATION}$<$<BOOL:LINUX_PORTABLE>:/${_ARCH_SUFFIX}bit>"
|
||||
)
|
||||
|
||||
_setup_binary_target(${target})
|
||||
endfunction()
|
||||
|
||||
# Helper function to export target to build and install tree Allows usage of
|
||||
# `find_package(libobs)` by other build trees
|
||||
function(export_target target)
|
||||
_export_target(${ARGV})
|
||||
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig")
|
||||
export_target_pkgconf(${target})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to build pkgconfig file for target
|
||||
function(export_target_pkgconf target)
|
||||
get_target_property(_TARGET_DEPENDENCIES ${target} INTERFACE_LINK_LIBRARIES)
|
||||
get_target_property(_TARGET_DEFINITIONS ${target}
|
||||
INTERFACE_COMPILE_DEFINITIONS)
|
||||
get_target_property(_TARGET_OPTIONS ${target} INTERFACE_LINK_OPTIONS)
|
||||
|
||||
foreach(_LIBRARY IN LISTS _TARGET_DEPENDENCIES)
|
||||
get_target_property(_LINK_LIBRARY ${_LIBRARY} INTERFACE_LINK_LIBRARIES)
|
||||
get_target_property(_LINK_DEFINITIONS ${_LIBRARY}
|
||||
INTERFACE_COMPILE_DEFINITIONS)
|
||||
list(APPEND _LINKED_LIBRARIES "${_LINK_LIBRARY}")
|
||||
|
||||
if(NOT "${_LINK_DEFINITIONS}" STREQUAL "_LINK_DEFINITIONS-NOTFOUND")
|
||||
list(APPEND _LINKED_DEFINITIONS "${_LINK_DEFINITIONS}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
string(REPLACE ";" " " _LINKED_LIBRARIES "${_LINKED_LIBRARIES}")
|
||||
string(REPLACE ";" " " _LINKED_DEFINITIONS "${_LINKED_DEFINITIONS}")
|
||||
|
||||
if(NOT "${_TARGET_DEFINITIONS}" STREQUAL "_TARGET_DEFINITIONS-NOTFOUND")
|
||||
list(JOIN _TARGET_DEFINITIONS "-D" _TARGET_DEFINITIONS)
|
||||
set(_TARGET_DEFINITIONS "-D${_TARGET_DEFINITIONS}")
|
||||
else()
|
||||
set(_TARGET_DEFINITIONS "")
|
||||
endif()
|
||||
|
||||
if(NOT "${_TARGET_OPTIONS}" STREQUAL "_TARGET_OPTIONS-NOTFOUND")
|
||||
list(JOIN _TARGET_OPTIONS "-" _TARGET_OPTIONS)
|
||||
set(_TARGET_OPTIONS "-${_TARGET_OPTIONS}")
|
||||
else()
|
||||
set(_TARGET_OPTIONS "")
|
||||
endif()
|
||||
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/${target}.pc.in"
|
||||
"${target}.pc" @ONLY)
|
||||
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${target}.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
endfunction()
|
|
@ -0,0 +1,400 @@
|
|||
# Helper function to set up runtime or library targets
|
||||
function(setup_binary_target target)
|
||||
_setup_binary_target(${ARGV})
|
||||
|
||||
if(DEFINED ENV{OBS_InstallerTempDir})
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME
|
||||
DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_EXECUTABLE_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
LIBRARY DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_LIBRARY_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
PUBLIC_HEADER
|
||||
DESTINATION ${OBS_INCLUDE_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(MSVC)
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:${target}>
|
||||
CONFIGURATIONS "RelWithDebInfo" "Debug"
|
||||
DESTINATION
|
||||
$ENV{OBS_InstallerTempDir}/$<IF:$<STREQUAL:$<TARGET_PROPERTY:${target},TYPE>,EXECUTABLE>,${OBS_EXECUTABLE_DESTINATION},${OBS_LIBRARY_DESTINATION}>
|
||||
COMPONENT obs_rundir
|
||||
OPTIONAL EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:${target}>
|
||||
CONFIGURATIONS "RelWithDebInfo" "Debug"
|
||||
DESTINATION
|
||||
$<IF:$<STREQUAL:$<TARGET_PROPERTY:${target},TYPE>,EXECUTABLE>,${OBS_EXECUTABLE_DESTINATION},${OBS_LIBRARY_DESTINATION}>
|
||||
COMPONENT ${target}_Runtime
|
||||
OPTIONAL)
|
||||
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:${target}>
|
||||
CONFIGURATIONS "RelWithDebInfo" "Debug"
|
||||
DESTINATION
|
||||
$<IF:$<STREQUAL:$<TARGET_PROPERTY:${target},TYPE>,EXECUTABLE>,${OBS_EXECUTABLE_DESTINATION},${OBS_LIBRARY_DESTINATION}>
|
||||
COMPONENT obs_rundir
|
||||
OPTIONAL EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(${target} STREQUAL "libobs")
|
||||
setup_libobs_target(${target})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up OBS plugin targets
|
||||
function(setup_plugin_target target)
|
||||
_setup_plugin_target(${ARGV})
|
||||
|
||||
if(MSVC)
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:${target}>
|
||||
CONFIGURATIONS "RelWithDebInfo" "Debug"
|
||||
DESTINATION ${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT ${target}_Runtime
|
||||
OPTIONAL)
|
||||
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:${target}>
|
||||
CONFIGURATIONS "RelWithDebInfo" "Debug"
|
||||
DESTINATION ${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
OPTIONAL EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{OBS_InstallerTempDir})
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
LIBRARY DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(MSVC)
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:${target}>
|
||||
CONFIGURATIONS "RelWithDebInfo" "Debug"
|
||||
DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
OPTIONAL EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up OBS scripting plugin targets
|
||||
function(setup_script_plugin_target target)
|
||||
_setup_script_plugin_target(${ARGV})
|
||||
|
||||
if(MSVC)
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:${target}>
|
||||
CONFIGURATIONS "RelWithDebInfo" "Debug"
|
||||
DESTINATION ${OBS_SCRIPT_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
OPTIONAL EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{OBS_InstallerTempDir})
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME
|
||||
DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_SCRIPT_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
LIBRARY
|
||||
DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_SCRIPT_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(MSVC)
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:${target}>
|
||||
CONFIGURATIONS "RelWithDebInfo" "Debug"
|
||||
DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_SCRIPT_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
OPTIONAL EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(${target} STREQUAL "obspython" AND ${_ARCH_SUFFIX} EQUAL 64)
|
||||
install(
|
||||
FILES
|
||||
"$<TARGET_FILE_DIR:${target}>/$<TARGET_FILE_BASE_NAME:${target}>.py"
|
||||
DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_SCRIPT_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up target resources (e.g. L10N files)
|
||||
function(setup_target_resources target destination)
|
||||
_setup_target_resources(${ARGV})
|
||||
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
|
||||
if(${_ARCH_SUFFIX} EQUAL 64 AND DEFINED ENV{OBS_InstallerTempDir})
|
||||
|
||||
install(
|
||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/
|
||||
DESTINATION
|
||||
$ENV{OBS_InstallerTempDir}/${OBS_DATA_DESTINATION}/${destination}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up specific resource files for targets
|
||||
function(add_target_resource target resource destination)
|
||||
_add_target_resource(${ARGV})
|
||||
|
||||
if(DEFINED ENV{OBS_InstallerTempDir})
|
||||
install(
|
||||
FILES ${resource}
|
||||
DESTINATION
|
||||
$ENV{OBS_InstallerTempDir}/${OBS_DATA_DESTINATION}/${destination}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up OBS app target
|
||||
function(setup_obs_app target)
|
||||
# detect outdated obs-browser submodule
|
||||
if(NOT TARGET OBS::browser AND TARGET obs-browser)
|
||||
if(MSVC)
|
||||
target_compile_options(obs-browser PRIVATE $<IF:$<CONFIG:DEBUG>,/MTd,/MT>)
|
||||
|
||||
target_compile_options(obs-browser-page
|
||||
PRIVATE $<IF:$<CONFIG:DEBUG>,/MTd,/MT>)
|
||||
endif()
|
||||
|
||||
target_link_options(obs-browser PRIVATE "LINKER:/IGNORE:4099")
|
||||
|
||||
target_link_options(obs-browser-page PRIVATE "LINKER:/IGNORE:4099"
|
||||
"LINKER:/SUBSYSTEM:WINDOWS")
|
||||
endif()
|
||||
|
||||
_setup_obs_app(${ARGV})
|
||||
|
||||
if(MSVC)
|
||||
include(CopyMSVCBins)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to export target to build and install tree. Allows usage of
|
||||
# `find_package(libobs)` by other build trees
|
||||
function(export_target target)
|
||||
set(CMAKE_EXPORT_PACKAGE_REGISTRY OFF)
|
||||
|
||||
install(
|
||||
TARGETS ${target}
|
||||
EXPORT ${target}Targets
|
||||
RUNTIME DESTINATION "${OBS_EXECUTABLE_EXPORT_DESTINATION}"
|
||||
COMPONENT obs_libraries
|
||||
LIBRARY DESTINATION "${OBS_LIBRARY_EXPORT_DESTINATION}"
|
||||
COMPONENT obs_libraries
|
||||
ARCHIVE DESTINATION "${OBS_LIBRARY_EXPORT_DESTINATION}"
|
||||
COMPONENT obs_libraries
|
||||
INCLUDES
|
||||
DESTINATION "${OBS_INCLUDE_DESTINATION}"
|
||||
PUBLIC_HEADER DESTINATION "${OBS_INCLUDE_DESTINATION}"
|
||||
COMPONENT obs_libraries)
|
||||
|
||||
if(MSVC)
|
||||
install(
|
||||
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pdbs/"
|
||||
DESTINATION "${OBS_EXECUTABLE_EXPORT_DESTINATION}"
|
||||
CONFIGURATIONS Debug RelWithDebInfo
|
||||
COMPONENT obs_libraries
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
include(GenerateExportHeader)
|
||||
generate_export_header(${target} EXPORT_FILE_NAME
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${target}_EXPORT.h")
|
||||
|
||||
target_sources(${target}
|
||||
PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${target}_EXPORT.h")
|
||||
|
||||
set(TARGETS_EXPORT_NAME "${target}Targets")
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/${target}Config.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake"
|
||||
INSTALL_DESTINATION ${OBS_CMAKE_DESTINATION}
|
||||
PATH_VARS OBS_PLUGIN_DESTINATION OBS_DATA_DESTINATION)
|
||||
|
||||
write_basic_package_version_file(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake
|
||||
VERSION ${OBS_VERSION_CANONICAL}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
export(
|
||||
EXPORT ${target}Targets
|
||||
FILE "${CMAKE_CURRENT_BINARY_DIR}/${TARGETS_EXPORT_NAME}.cmake"
|
||||
NAMESPACE OBS::)
|
||||
|
||||
export(PACKAGE "${target}")
|
||||
|
||||
install(
|
||||
EXPORT ${TARGETS_EXPORT_NAME}
|
||||
FILE ${TARGETS_EXPORT_NAME}.cmake
|
||||
NAMESPACE OBS::
|
||||
DESTINATION ${OBS_CMAKE_DESTINATION}
|
||||
COMPONENT obs_libraries)
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake
|
||||
DESTINATION ${OBS_CMAKE_DESTINATION}
|
||||
COMPONENT obs_libraries)
|
||||
endfunction()
|
||||
|
||||
# Helper function to do additional setup for browser source plugin
|
||||
function(setup_target_browser target)
|
||||
install(
|
||||
DIRECTORY ${CEF_ROOT_DIR}/Resources/
|
||||
DESTINATION ${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT ${target}_Runtime)
|
||||
|
||||
install(
|
||||
DIRECTORY ${CEF_ROOT_DIR}/Resources/
|
||||
DESTINATION ${OBS_OUTPUT_DIR}/$<CONFIG>/${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(DEFINED ENV{OBS_InstallerTempDir})
|
||||
install(
|
||||
DIRECTORY ${CEF_ROOT_DIR}/Resources/
|
||||
DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_PLUGIN_DESTINATION}
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
set(_ADDITIONAL_BROWSER_FILES
|
||||
"libcef.dll"
|
||||
"libEGL.dll"
|
||||
"libGLESv2.dll"
|
||||
"snapshot_blob.bin"
|
||||
"v8_context_snapshot.bin"
|
||||
"natives_blob.bin"
|
||||
"chrome_elf.dll")
|
||||
|
||||
foreach(_ADDITIONAL_BROWSER_FILE IN LISTS _ADDITIONAL_BROWSER_FILES)
|
||||
list(REMOVE_ITEM _ADDITIONAL_BROWSER_FILES "${_ADDITIONAL_BROWSER_FILE}")
|
||||
if(EXISTS "${CEF_ROOT_DIR}/Release/${_ADDITIONAL_BROWSER_FILE}")
|
||||
list(APPEND _ADDITIONAL_BROWSER_FILES
|
||||
"${CEF_ROOT_DIR}/Release/${_ADDITIONAL_BROWSER_FILE}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
install(
|
||||
FILES ${_ADDITIONAL_BROWSER_FILES}
|
||||
DESTINATION ${OBS_PLUGIN_DESTINATION}/
|
||||
COMPONENT ${target}_Runtime)
|
||||
|
||||
install(
|
||||
FILES ${_ADDITIONAL_BROWSER_FILES}
|
||||
DESTINATION ${OBS_OUTPUT_DIR}/$<CONFIG>/${OBS_PLUGIN_DESTINATION}/
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(DEFINED ENV{OBS_InstallerTempDir})
|
||||
install(
|
||||
FILES ${_ADDITIONAL_BROWSER_FILES}
|
||||
DESTINATION $ENV{OBS_InstallerTempDir}/${OBS_PLUGIN_DESTINATION}/
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to gather external libraries depended-on by libobs
|
||||
function(setup_libobs_target target)
|
||||
set(_ADDITIONAL_FILES "${CMAKE_SOURCE_DIR}/additional_install_files")
|
||||
|
||||
if(DEFINED ENV{OBS_AdditionalInstallFiles})
|
||||
set(_ADDITIONAL_FILES "$ENV{OBS_AdditionalInstallFiles}")
|
||||
endif()
|
||||
|
||||
if(NOT INSTALLER_RUN)
|
||||
list(APPEND _LIBOBS_FIXUPS "misc:." "data:${OBS_DATA_DESTINATION}"
|
||||
"libs${_ARCH_SUFFIX}:${OBS_LIBRARY_DESTINATION}"
|
||||
"exec${_ARCH_SUFFIX}:${OBS_EXECUTABLE_DESTINATION}")
|
||||
else()
|
||||
list(
|
||||
APPEND
|
||||
_LIBOBS_FIXUPS
|
||||
"misc:."
|
||||
"data:${OBS_DATA_DESTINATION}"
|
||||
"libs32:${OBS_LIBRARY32_DESTINATION}"
|
||||
"libs64:${OBS_LIBRARY64_DESTINATION}"
|
||||
"exec32:${OBS_EXECUTABLE32_DESTINATION}"
|
||||
"exec64:${OBS_EXECUTABLE64_DESTINATION}")
|
||||
endif()
|
||||
|
||||
foreach(_FIXUP IN LISTS _LIBOBS_FIXUPS)
|
||||
string(REPLACE ":" ";" _FIXUP ${_FIXUP})
|
||||
list(GET _FIXUP 0 _SOURCE)
|
||||
list(GET _FIXUP 1 _DESTINATION)
|
||||
|
||||
install(
|
||||
DIRECTORY ${_ADDITIONAL_FILES}/${_SOURCE}/
|
||||
DESTINATION ${_DESTINATION}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT ${target}_Runtime
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
|
||||
install(
|
||||
DIRECTORY ${_ADDITIONAL_FILES}/${_SOURCE}/
|
||||
DESTINATION ${_DESTINATION}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
|
||||
if(_SOURCE MATCHES "(libs|exec)(32|64)?")
|
||||
install(
|
||||
DIRECTORY ${_ADDITIONAL_FILES}/${_SOURCE}$<IF:$<CONFIG:Debug>,d,r>/
|
||||
DESTINATION ${_DESTINATION}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT ${target}_Runtime
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
|
||||
install(
|
||||
DIRECTORY ${_ADDITIONAL_FILES}/${_SOURCE}$<IF:$<CONFIG:Debug>,d,r>/
|
||||
DESTINATION ${_DESTINATION}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL
|
||||
PATTERN ".gitignore" EXCLUDE)
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Helper function to compile artifacts for multi-architecture installer
|
||||
function(generate_multiarch_installer)
|
||||
if(NOT DEFINED ENV{OBS_InstallerTempDir} AND NOT DEFINED
|
||||
ENV{obsInstallerTempDir})
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Function generate_multiarch_installer requires environment variable 'OBS_InstallerTempDir' to be set"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_custom_target(installer_files ALL)
|
||||
|
||||
setup_libobs_target(installer_files)
|
||||
|
||||
install(
|
||||
DIRECTORY "$ENV{OBS_InstallerTempDir}/"
|
||||
DESTINATION "."
|
||||
USE_SOURCE_PERMISSIONS)
|
||||
endfunction()
|
|
@ -0,0 +1,488 @@
|
|||
# Helper function to set up runtime or library targets
|
||||
function(setup_binary_target target)
|
||||
set_target_properties(
|
||||
${target}
|
||||
PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER
|
||||
"com.obsproject.${target}"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY
|
||||
"${OBS_BUNDLE_CODESIGN_IDENTITY}"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
|
||||
"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/entitlements.plist")
|
||||
|
||||
set(MACOSX_PLUGIN_BUNDLE_NAME
|
||||
"${target}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_GUI_IDENTIFIER
|
||||
"com.obsproject.${target}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_BUNDLE_VERSION
|
||||
"${MACOSX_BUNDLE_BUNDLE_VERSION}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_SHORT_VERSION_STRING
|
||||
"${MACOSX_BUNDLE_SHORT_VERSION_STRING}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_EXECUTABLE_NAME
|
||||
"${target}"
|
||||
PARENT_SCOPE)
|
||||
|
||||
if(${target} STREQUAL libobs)
|
||||
setup_framework_target(${target})
|
||||
set_property(GLOBAL APPEND PROPERTY OBS_FRAMEWORK_LIST "${target}")
|
||||
elseif(NOT ${target} STREQUAL obs-ffmpeg-mux AND NOT ${target} STREQUAL
|
||||
mac-dal-plugin)
|
||||
set_property(GLOBAL APPEND PROPERTY OBS_FRAMEWORK_LIST "${target}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to set-up framework targets on macOS
|
||||
function(setup_framework_target target)
|
||||
set_target_properties(
|
||||
${target}
|
||||
PROPERTIES FRAMEWORK ON
|
||||
FRAMEWORK_VERSION A
|
||||
OUTPUT_NAME "${target}"
|
||||
MACOSX_FRAMEWORK_IDENTIFIER "com.obsproject.${target}"
|
||||
MACOSX_FRAMEWORK_INFO_PLIST
|
||||
"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Plugin-Info.plist.in"
|
||||
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER
|
||||
"com.obsproject.${target}")
|
||||
|
||||
install(
|
||||
TARGETS ${target}
|
||||
EXPORT "${target}Targets"
|
||||
FRAMEWORK DESTINATION "Frameworks" COMPONENT obs_libraries
|
||||
INCLUDES
|
||||
DESTINATION Frameworks/$<TARGET_FILE_BASE_NAME:${target}>.framework/Headers
|
||||
PUBLIC_HEADER
|
||||
DESTINATION
|
||||
Frameworks/$<TARGET_FILE_BASE_NAME:${target}>.framework/Headers
|
||||
EXCLUDE_FROM_ALL)
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up OBS plugin targets
|
||||
function(setup_plugin_target target)
|
||||
set(MACOSX_PLUGIN_BUNDLE_NAME
|
||||
"${target}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_GUI_IDENTIFIER
|
||||
"com.obsproject.${target}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_BUNDLE_VERSION
|
||||
"${MACOSX_BUNDLE_BUNDLE_VERSION}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_SHORT_VERSION_STRING
|
||||
"${MACOSX_BUNDLE_SHORT_VERSION_STRING}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_EXECUTABLE_NAME
|
||||
"${target}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_BUNDLE_TYPE
|
||||
"BNDL"
|
||||
PARENT_SCOPE)
|
||||
|
||||
set_target_properties(
|
||||
${target}
|
||||
PROPERTIES BUNDLE ON
|
||||
BUNDLE_EXTENSION "plugin"
|
||||
OUTPUT_NAME "${target}"
|
||||
MACOSX_BUNDLE_INFO_PLIST
|
||||
"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Plugin-Info.plist.in"
|
||||
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER
|
||||
"com.obsproject.${target}"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY
|
||||
"${OBS_BUNDLE_CODESIGN_IDENTITY}"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
|
||||
"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/entitlements.plist")
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY OBS_MODULE_LIST "${target}")
|
||||
message(STATUS "OBS: ENABLED ${target}")
|
||||
|
||||
install_bundle_resources(${target})
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up OBS scripting plugin targets
|
||||
function(setup_script_plugin_target target)
|
||||
set_target_properties(
|
||||
${target}
|
||||
PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER
|
||||
"com.obsproject.${target}"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY
|
||||
"${OBS_BUNDLE_CODESIGN_IDENTITY}"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
|
||||
"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/entitlements.plist")
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY OBS_SCRIPTING_MODULE_LIST "${target}")
|
||||
message(STATUS "OBS: ENABLED ${target}")
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up target resources (e.g. L10N files)
|
||||
function(setup_target_resources target destination)
|
||||
install_bundle_resources(${target})
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up plugin resources inside plugin bundle
|
||||
function(install_bundle_resources target)
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
|
||||
file(GLOB_RECURSE _DATA_FILES "${CMAKE_CURRENT_SOURCE_DIR}/data/*")
|
||||
foreach(_DATA_FILE IN LISTS _DATA_FILES)
|
||||
file(RELATIVE_PATH _RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/data/
|
||||
${_DATA_FILE})
|
||||
get_filename_component(_RELATIVE_PATH "${_RELATIVE_PATH}" PATH)
|
||||
target_sources(${target} PRIVATE ${_DATA_FILE})
|
||||
set_source_files_properties(
|
||||
${_DATA_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION
|
||||
"Resources/${_RELATIVE_PATH}")
|
||||
string(REPLACE "\\" "\\\\" _GROUP_NAME "${_RELATIVE_PATH}")
|
||||
source_group("Resources\\${_GROUP_NAME}" FILES ${_DATA_FILE})
|
||||
endforeach()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up specific resource files for targets
|
||||
function(add_target_resource target resource destination)
|
||||
target_sources(${target} PRIVATE ${resource})
|
||||
set_source_files_properties(${resource} PROPERTIES MACOSX_PACKAGE_LOCATION
|
||||
Resources)
|
||||
endfunction()
|
||||
|
||||
# Helper function to set up OBS app target
|
||||
function(setup_obs_app target)
|
||||
set_target_properties(
|
||||
${target}
|
||||
PROPERTIES BUILD_WITH_INSTALL_RPATH OFF
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY
|
||||
"${OBS_BUNDLE_CODESIGN_IDENTITY}"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
|
||||
"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/entitlements.plist"
|
||||
XCODE_SCHEME_ENVIRONMENT "PYTHONDONTWRITEBYTECODE=1")
|
||||
|
||||
install(TARGETS ${target} BUNDLE DESTINATION "." COMPONENT obs_app)
|
||||
|
||||
# detect outdated obs-browser submodule
|
||||
if(TARGET obs-browser-page OR TARGET obs-browser-page_gpu)
|
||||
add_library(OBS::browser ALIAS obs-browser)
|
||||
endif()
|
||||
|
||||
if(TARGET OBS::browser)
|
||||
setup_target_browser(${target})
|
||||
endif()
|
||||
|
||||
setup_obs_frameworks(${target})
|
||||
setup_obs_modules(${target})
|
||||
setup_obs_bundle(${target})
|
||||
endfunction()
|
||||
|
||||
# Helper function to do additional setup for browser source plugin
|
||||
function(setup_target_browser target)
|
||||
get_filename_component(_CEF_FRAMEWORK_NAME "${CEF_LIBRARY}" NAME)
|
||||
|
||||
install(
|
||||
DIRECTORY "${CEF_LIBRARY}"
|
||||
DESTINATION "Frameworks"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT obs_browser_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
foreach(_CEF_LIBRARY IN ITEMS "libEGL" "libswiftshader_libEGL" "libGLESv2"
|
||||
"libswiftshader_libGLESv2" "libvk_swiftshader")
|
||||
set(_COMMAND
|
||||
"/usr/bin/codesign --force --sign \\\"${OBS_BUNDLE_CODESIGN_IDENTITY}\\\" $<$<BOOL:${OBS_CODESIGN_LINKER}>:--options linker-signed > \\\"\${CMAKE_INSTALL_PREFIX}/Frameworks/${_CEF_FRAMEWORK_NAME}/Libraries/${_CEF_LIBRARY}.dylib\\\""
|
||||
)
|
||||
list(APPEND _CEF_CODESIGN_COMMANDS
|
||||
"execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")")
|
||||
endforeach()
|
||||
|
||||
set(_COMMAND
|
||||
"/usr/bin/codesign --force --sign \\\"${OBS_BUNDLE_CODESIGN_IDENTITY}\\\" $<$<BOOL:${OBS_CODESIGN_LINKER}>:--options linker-signed > --deep \\\"\${CMAKE_INSTALL_PREFIX}/Frameworks/${_CEF_FRAMEWORK_NAME}/Chromium Embedded Framework\\\""
|
||||
)
|
||||
|
||||
list(APPEND _CEF_CODESIGN_COMMANDS
|
||||
"execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")")
|
||||
string(REPLACE ";" "\n " _CEF_CODESIGN_COMMANDS "${_CEF_CODESIGN_COMMANDS}")
|
||||
install(
|
||||
CODE "${_CEF_CODESIGN_COMMANDS}"
|
||||
COMPONENT obs_browser_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
foreach(_SUFFIX IN ITEMS "_gpu" "_plugin" "_renderer" "")
|
||||
if(TARGET obs-browser-page${_SUFFIX})
|
||||
add_executable(OBS::browser-helper${_SUFFIX} ALIAS
|
||||
obs-browser-page${_SUFFIX})
|
||||
target_compile_features(obs-browser-page${_SUFFIX} PRIVATE cxx_std_17)
|
||||
endif()
|
||||
|
||||
if(TARGET OBS::browser-helper${_SUFFIX})
|
||||
add_dependencies(${target} OBS::browser-helper${_SUFFIX})
|
||||
|
||||
install(
|
||||
DIRECTORY "$<TARGET_BUNDLE_DIR:OBS::browser-helper${_SUFFIX}>"
|
||||
DESTINATION "Frameworks"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT obs_browser_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
set(_COMMAND
|
||||
"/usr/bin/codesign --force --sign \\\"${OBS_BUNDLE_CODESIGN_IDENTITY}\\\" $<$<BOOL:${OBS_CODESIGN_LINKER}>:--options linker-signed > \\\"\${CMAKE_INSTALL_PREFIX}/Frameworks/$<TARGET_FILE_NAME:OBS::browser-helper${_SUFFIX}>.app\\\""
|
||||
)
|
||||
|
||||
install(
|
||||
CODE "execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")"
|
||||
COMPONENT obs_browser_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" --install . --config $<CONFIG> --prefix
|
||||
$<TARGET_BUNDLE_CONTENT_DIR:${target}> --component obs_browser_dev
|
||||
COMMENT "Installing Chromium Embedded Framework for development"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
|
||||
# Helper function to set-up OBS frameworks for macOS bundling
|
||||
function(setup_obs_frameworks target)
|
||||
get_property(OBS_FRAMEWORK_LIST GLOBAL PROPERTY OBS_FRAMEWORK_LIST)
|
||||
install(
|
||||
TARGETS ${OBS_FRAMEWORK_LIST}
|
||||
RUNTIME
|
||||
DESTINATION "$<TARGET_FILE_BASE_NAME:${target}>.app/Contents/Frameworks/"
|
||||
COMPONENT obs_frameworks
|
||||
LIBRARY
|
||||
DESTINATION "$<TARGET_FILE_BASE_NAME:${target}>.app/Contents/Frameworks/"
|
||||
COMPONENT obs_frameworks
|
||||
FRAMEWORK
|
||||
DESTINATION "$<TARGET_FILE_BASE_NAME:${target}>.app/Contents/Frameworks/"
|
||||
COMPONENT obs_frameworks
|
||||
PUBLIC_HEADER DESTINATION "${OBS_INCLUDE_DESTINATION}"
|
||||
COMPONENT obs_libraries)
|
||||
endfunction()
|
||||
|
||||
# Helper function to set-up OBS plugins and helper binaries for macOS bundling
|
||||
function(setup_obs_modules target)
|
||||
|
||||
get_property(OBS_MODULE_LIST GLOBAL PROPERTY OBS_MODULE_LIST)
|
||||
add_dependencies(${target} ${OBS_MODULE_LIST})
|
||||
|
||||
install(
|
||||
TARGETS ${OBS_MODULE_LIST}
|
||||
LIBRARY DESTINATION "PlugIns"
|
||||
COMPONENT obs_plugin_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
install(
|
||||
TARGETS ${OBS_MODULE_LIST}
|
||||
LIBRARY DESTINATION $<TARGET_FILE_BASE_NAME:${target}>.app/Contents/PlugIns
|
||||
COMPONENT obs_plugins
|
||||
NAMELINK_COMPONENT ${target}_Development)
|
||||
|
||||
get_property(OBS_SCRIPTING_MODULE_LIST GLOBAL
|
||||
PROPERTY OBS_SCRIPTING_MODULE_LIST)
|
||||
add_dependencies(${target} ${OBS_SCRIPTING_MODULE_LIST})
|
||||
|
||||
install(
|
||||
TARGETS ${OBS_SCRIPTING_MODULE_LIST}
|
||||
LIBRARY DESTINATION "PlugIns"
|
||||
COMPONENT obs_plugin_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(TARGET obspython)
|
||||
install(
|
||||
FILES "$<TARGET_FILE_DIR:obspython>/obspython.py"
|
||||
DESTINATION "PlugIns"
|
||||
COMPONENT obs_plugin_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
set(_COMMAND
|
||||
"/usr/bin/codesign --force --sign \\\"${OBS_BUNDLE_CODESIGN_IDENTITY}\\\" $<$<BOOL:${OBS_CODESIGN_LINKER}>:--options linker-signed > \\\"\${CMAKE_INSTALL_PREFIX}/PlugIns/obspython.py\\\""
|
||||
)
|
||||
|
||||
install(
|
||||
CODE "execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")"
|
||||
COMPONENT obs_plugin_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
install(TARGETS ${OBS_SCRIPTING_MODULE_LIST}
|
||||
LIBRARY DESTINATION $<TARGET_FILE_BASE_NAME:obs>.app/Contents/PlugIns
|
||||
COMPONENT obs_scripting_plugins)
|
||||
|
||||
if(TARGET obs-ffmpeg-mux)
|
||||
add_dependencies(${target} obs-ffmpeg-mux)
|
||||
|
||||
install(
|
||||
TARGETS obs-ffmpeg-mux
|
||||
RUNTIME DESTINATION "MacOS"
|
||||
COMPONENT obs_plugin_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
set(_COMMAND
|
||||
"/usr/bin/codesign --force --sign \\\"${OBS_BUNDLE_CODESIGN_IDENTITY}\\\" $<$<BOOL:${OBS_CODESIGN_LINKER}>:--options linker-signed > \\\"\${CMAKE_INSTALL_PREFIX}/MacOS/$<TARGET_FILE_NAME:obs-ffmpeg-mux>\\\""
|
||||
)
|
||||
|
||||
install(
|
||||
CODE "execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")"
|
||||
COMPONENT obs_plugin_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
install(TARGETS obs-ffmpeg-mux
|
||||
RUNTIME DESTINATION $<TARGET_FILE_BASE_NAME:obs>.app/Contents/MacOS
|
||||
COMPONENT obs_plugins)
|
||||
endif()
|
||||
|
||||
if(TARGET mac-dal-plugin)
|
||||
add_dependencies(${target} mac-dal-plugin)
|
||||
|
||||
install(
|
||||
TARGETS mac-dal-plugin
|
||||
LIBRARY DESTINATION "Resources"
|
||||
COMPONENT obs_plugin_dev
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" --install .. --config $<CONFIG> --prefix
|
||||
$<TARGET_BUNDLE_CONTENT_DIR:${target}> --component obs_plugin_dev
|
||||
COMMENT "Installing OBS plugins for development"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
|
||||
# Helper function to finalize macOS app bundles
|
||||
function(setup_obs_bundle target)
|
||||
install(
|
||||
CODE "
|
||||
set(_DEPENDENCY_PREFIX \"${CMAKE_PREFIX_PATH}\")
|
||||
set(_BUILD_FOR_DISTRIBUTION \"${BUILD_FOR_DISTRIBUTION}\")
|
||||
set(_BUNDLENAME \"$<TARGET_FILE_BASE_NAME:${target}>.app\")
|
||||
set(_BUNDLER_COMMAND \"${CMAKE_SOURCE_DIR}/cmake/bundle/macos/dylibbundler\")
|
||||
set(_CODESIGN_IDENTITY \"${OBS_BUNDLE_CODESIGN_IDENTITY}\")
|
||||
set(_CODESIGN_ENTITLEMENTS \"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS\")"
|
||||
COMPONENT obs_resources)
|
||||
|
||||
if(ENABLE_SPARKLE_UPDATER)
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
/bin/sh -c
|
||||
"plutil -replace SUFeedURL -string https://obsproject.com/osx_update/stable/updates.xml \"$<TARGET_BUNDLE_CONTENT_DIR:${target}>/Info.plist\""
|
||||
VERBATIM)
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
/bin/sh -c
|
||||
"plutil -replace SUPublicDSAKeyFile -string OBSPublicDSAKey.pem \"$<TARGET_BUNDLE_CONTENT_DIR:${target}>/Info.plist\""
|
||||
VERBATIM)
|
||||
|
||||
target_sources(
|
||||
${target}
|
||||
PRIVATE "${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/OBSPublicDSAKey.pem")
|
||||
set_source_files_properties(
|
||||
"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/OBSPublicDSAKey.pem"
|
||||
PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
source_group(
|
||||
"Resources"
|
||||
FILES "${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/OBSPublicDSAKey.pem")
|
||||
|
||||
install(
|
||||
DIRECTORY ${SPARKLE}
|
||||
DESTINATION $<TARGET_FILE_BASE_NAME:${target}>.app/Contents/Frameworks
|
||||
COMPONENT obs_frameworks)
|
||||
endif()
|
||||
|
||||
install(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/bundleutils.cmake"
|
||||
COMPONENT obs_resources)
|
||||
endfunction()
|
||||
|
||||
# Helper function to export target to build and install tree Allows usage of
|
||||
# `find_package(libobs)` by other build trees
|
||||
function(export_target target)
|
||||
get_target_property(_IS_FRAMEWORK ${target} FRAMEWORK)
|
||||
|
||||
set(OBS_PLUGIN_DESTINATION "")
|
||||
set(OBS_DATA_DESTINATION "")
|
||||
|
||||
if(_IS_FRAMEWORK)
|
||||
export_framework_target(${target})
|
||||
else()
|
||||
_export_target(${ARGV})
|
||||
endif()
|
||||
set_target_properties(
|
||||
${target} PROPERTIES PUBLIC_HEADER
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${target}_EXPORT.h")
|
||||
endfunction()
|
||||
|
||||
# Helper function to export macOS framework targets
|
||||
function(export_framework_target)
|
||||
set(CMAKE_EXPORT_PACKAGE_REGISTRY OFF)
|
||||
|
||||
include(GenerateExportHeader)
|
||||
generate_export_header(${target} EXPORT_FILE_NAME
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${target}_EXPORT.h")
|
||||
|
||||
target_sources(${target}
|
||||
PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${target}_EXPORT.h")
|
||||
|
||||
set(TARGETS_EXPORT_NAME "${target}Targets")
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/${target}Config.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake"
|
||||
INSTALL_DESTINATION Frameworks/${target}.framework/Resources/cmake
|
||||
PATH_VARS OBS_PLUGIN_DESTINATION OBS_DATA_DESTINATION)
|
||||
|
||||
write_basic_package_version_file(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake
|
||||
VERSION ${OBS_VERSION_CANONICAL}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
export(
|
||||
EXPORT ${target}Targets
|
||||
FILE "${CMAKE_CURRENT_BINARY_DIR}/${TARGETS_EXPORT_NAME}.cmake"
|
||||
NAMESPACE OBS::)
|
||||
|
||||
export(PACKAGE "${target}")
|
||||
|
||||
install(
|
||||
EXPORT ${TARGETS_EXPORT_NAME}
|
||||
FILE ${TARGETS_EXPORT_NAME}.cmake
|
||||
NAMESPACE OBS::
|
||||
DESTINATION Frameworks/${target}.framework/Resources/cmake
|
||||
COMPONENT obs_libraries
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake
|
||||
DESTINATION
|
||||
Frameworks/$<TARGET_FILE_BASE_NAME:${target}>.framework/Resources/cmake
|
||||
COMPONENT obs_libraries
|
||||
EXCLUDE_FROM_ALL)
|
||||
endfunction()
|
||||
|
||||
# Helper function to install header files
|
||||
function(install_headers target)
|
||||
install(
|
||||
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/"
|
||||
DESTINATION
|
||||
$<IF:$<BOOL:$<TARGET_PROPERTY:${target},FRAMEWORK>>,Frameworks/$<TARGET_FILE_BASE_NAME:${target}>.framework/Headers,${OBS_INCLUDE_DESTINATION}>
|
||||
COMPONENT obs_libraries
|
||||
EXCLUDE_FROM_ALL FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.hpp"
|
||||
PATTERN "cmake" EXCLUDE
|
||||
PATTERN "pkgconfig" EXCLUDE
|
||||
PATTERN "data" EXCLUDE)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_BINARY_DIR}/config/obsconfig.h"
|
||||
DESTINATION
|
||||
$<IF:$<BOOL:$<TARGET_PROPERTY:${target},FRAMEWORK>>,Frameworks/$<TARGET_FILE_BASE_NAME:${target}>.framework/Headers,${OBS_INCLUDE_DESTINATION}>
|
||||
COMPONENT obs_libraries
|
||||
EXCLUDE_FROM_ALL)
|
||||
endfunction()
|
|
@ -0,0 +1,103 @@
|
|||
set(OBS_COMPANY_NAME "OBS Project")
|
||||
set(OBS_PRODUCT_NAME "OBS Studio")
|
||||
set(OBS_WEBSITE "https://www.obsproject.com")
|
||||
set(OBS_COMMENTS
|
||||
"Free and open source software for video recording and live streaming")
|
||||
set(OBS_LEGAL_COPYRIGHT "(C) Hugh Bailey")
|
||||
|
||||
# Configure default version strings
|
||||
set(_OBS_DEFAULT_VERSION "0" "0" "1")
|
||||
set(_OBS_RELEASE_CANDIDATE "0" "0" "0" "0")
|
||||
set(_OBS_BETA "0" "0" "0" "0")
|
||||
|
||||
# Set full and canonical OBS version from current git tag or manual override
|
||||
if(NOT DEFINED OBS_VERSION_OVERRIDE)
|
||||
# Set release candidate version information Must be a string in the format of
|
||||
# "x.x.x-rcx"
|
||||
if(DEFINED RELEASE_CANDIDATE)
|
||||
string(REPLACE "-rc" "." _OBS_RELEASE_CANDIDATE ${RELEASE_CANDIDATE})
|
||||
string(REPLACE "." ";" _OBS_VERSION ${RELEASE_CANDIDATE})
|
||||
string(REPLACE "." ";" _OBS_RELEASE_CANDIDATE ${_OBS_RELEASE_CANDIDATE})
|
||||
list(GET _OBS_RELEASE_CANDIDATE 0 1 2 _OBS_VERSION_CANONICAL)
|
||||
# Set beta version information Must be a string in the format of
|
||||
# "x.x.x-betax"
|
||||
elseif(DEFINED BETA)
|
||||
string(REPLACE "-beta" "." _OBS_BETA ${BETA})
|
||||
string(REPLACE "." ";" _OBS_VERSION ${BETA})
|
||||
string(REPLACE "." ";" _OBS_BETA ${_OBS_BETA})
|
||||
list(GET _OBS_BETA 0 1 2 _OBS_VERSION_CANONICAL)
|
||||
elseif(EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
execute_process(
|
||||
COMMAND git describe --always --tags --dirty=-modified
|
||||
OUTPUT_VARIABLE _OBS_VERSION
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
RESULT_VARIABLE _OBS_VERSION_RESULT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(NOT _OBS_VERSION_RESULT EQUAL 0)
|
||||
set(_OBS_VERSION "${_OBS_DEFAULT_VERSION}")
|
||||
endif()
|
||||
string(REPLACE "-" "." _CANONICAL_SPLIT ${_OBS_VERSION})
|
||||
string(REPLACE "." ";" _CANONICAL_SPLIT ${_CANONICAL_SPLIT})
|
||||
list(GET _CANONICAL_SPLIT 0 1 2 _OBS_VERSION_CANONICAL)
|
||||
string(REPLACE "." ";" _OBS_VERSION ${_OBS_VERSION})
|
||||
else()
|
||||
set(_OBS_VERSION ${_OBS_DEFAULT_VERSION})
|
||||
set(_OBS_VERSION_CANONICAL ${_OBS_DEFAULT_VERSION})
|
||||
endif()
|
||||
else()
|
||||
string(REPLACE "." ";" _OBS_VERSION "${OBS_VERSION_OVERRIDE}")
|
||||
string(REPLACE "-" ";" _OBS_VERSION_CANONICAL "${OBS_VERSION_OVERRIDE}")
|
||||
list(GET _OBS_VERSION_CANONICAL 0 _OBS_VERSION_CANONICAL)
|
||||
string(REPLACE "." ";" _OBS_VERSION_CANONICAL "${_OBS_VERSION_CANONICAL}")
|
||||
endif()
|
||||
|
||||
list(GET _OBS_VERSION_CANONICAL 0 OBS_VERSION_MAJOR)
|
||||
list(GET _OBS_VERSION_CANONICAL 1 OBS_VERSION_MINOR)
|
||||
list(GET _OBS_VERSION_CANONICAL 2 OBS_VERSION_PATCH)
|
||||
list(GET _OBS_RELEASE_CANDIDATE 0 OBS_RELEASE_CANDIDATE_MAJOR)
|
||||
list(GET _OBS_RELEASE_CANDIDATE 1 OBS_RELEASE_CANDIDATE_MINOR)
|
||||
list(GET _OBS_RELEASE_CANDIDATE 2 OBS_RELEASE_CANDIDATE_PATCH)
|
||||
list(GET _OBS_RELEASE_CANDIDATE 3 OBS_RELEASE_CANDIDATE)
|
||||
list(GET _OBS_BETA 0 OBS_BETA_MAJOR)
|
||||
list(GET _OBS_BETA 1 OBS_BETA_MINOR)
|
||||
list(GET _OBS_BETA 2 OBS_BETA_PATCH)
|
||||
list(GET _OBS_BETA 3 OBS_BETA)
|
||||
|
||||
string(REPLACE ";" "." OBS_VERSION_CANONICAL "${_OBS_VERSION_CANONICAL}")
|
||||
string(REPLACE ";" "." OBS_VERSION "${_OBS_VERSION}")
|
||||
|
||||
if(OBS_RELEASE_CANDIDATE GREATER 0)
|
||||
message(
|
||||
AUTHOR_WARNING
|
||||
"******************************************************************************\n"
|
||||
" + OBS-Studio - Release candidate detected, OBS_VERSION is now: ${OBS_VERSION}\n"
|
||||
"******************************************************************************"
|
||||
)
|
||||
elseif(OBS_BETA GREATER 0)
|
||||
message(
|
||||
AUTHOR_WARNING
|
||||
"******************************************************************************\n"
|
||||
" + OBS-Studio - Beta detected, OBS_VERSION is now: ${OBS_VERSION}\n"
|
||||
"******************************************************************************"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Define build number cache file
|
||||
set(BUILD_NUMBER_CACHE
|
||||
${CMAKE_SOURCE_DIR}/cmake/.CMakeBuildNumber
|
||||
CACHE INTERNAL "OBS build number cache file")
|
||||
|
||||
# Read build number from cache file or manual override
|
||||
if(NOT DEFINED OBS_BUILD_NUMBER AND EXISTS ${BUILD_NUMBER_CACHE})
|
||||
file(READ ${BUILD_NUMBER_CACHE} OBS_BUILD_NUMBER)
|
||||
math(EXPR OBS_BUILD_NUMBER "${OBS_BUILD_NUMBER}+1")
|
||||
elseif(NOT DEFINED OBS_BUILD_NUMBER)
|
||||
set(OBS_BUILD_NUMBER "1")
|
||||
endif()
|
||||
file(WRITE ${BUILD_NUMBER_CACHE} "${OBS_BUILD_NUMBER}")
|
||||
|
||||
message(
|
||||
STATUS
|
||||
"OBS: Application Version: ${OBS_VERSION} - Build Number: ${OBS_BUILD_NUMBER}"
|
||||
)
|
|
@ -1,43 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?include "cpack_variables.wxi"?>
|
||||
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
|
||||
RequiredVersion="3.6.3303.0">
|
||||
|
||||
<Product Id="$(var.CPACK_WIX_PRODUCT_GUID)"
|
||||
Name="$(var.CPACK_PACKAGE_NAME)"
|
||||
Language="1033"
|
||||
Version="$(var.CPACK_PACKAGE_VERSION)"
|
||||
Manufacturer="$(var.CPACK_PACKAGE_VENDOR)"
|
||||
UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)">
|
||||
|
||||
<Package InstallerVersion="301" Compressed="yes"/>
|
||||
|
||||
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes"/>
|
||||
|
||||
<MajorUpgrade
|
||||
Schedule="afterInstallInitialize"
|
||||
AllowDowngrades="yes"/>
|
||||
|
||||
<WixVariable Id="WixUILicenseRtf" Value="$(var.CPACK_WIX_LICENSE_RTF)"/>
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALL_ROOT"/>
|
||||
|
||||
<?ifdef CPACK_WIX_PRODUCT_ICON?>
|
||||
<Property Id="ARPPRODUCTICON">ProductIcon.ico</Property>
|
||||
<Icon Id="ProductIcon.ico" SourceFile="$(var.CPACK_WIX_PRODUCT_ICON)"/>
|
||||
<?endif?>
|
||||
|
||||
<?ifdef CPACK_WIX_UI_BANNER?>
|
||||
<WixVariable Id="WixUIBannerBmp" Value="$(var.CPACK_WIX_UI_BANNER)"/>
|
||||
<?endif?>
|
||||
|
||||
<?ifdef CPACK_WIX_UI_DIALOG?>
|
||||
<WixVariable Id="WixUIDialogBmp" Value="$(var.CPACK_WIX_UI_DIALOG)"/>
|
||||
<?endif?>
|
||||
|
||||
<FeatureRef Id="ProductFeature"/>
|
||||
|
||||
<UIRef Id="WixUI_InstallDir" />
|
||||
</Product>
|
||||
</Wix>
|
|
@ -1,17 +0,0 @@
|
|||
|
||||
if(NOT EXISTS "${INPUT}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(_do_pass FALSE)
|
||||
foreach(target ${TARGET_CONFIGS})
|
||||
if(target STREQUAL "${CONFIG}" OR target STREQUAL "ALL")
|
||||
set(_do_pass TRUE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT _do_pass)
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(COPY "${INPUT}" DESTINATION "${OUTPUT}")
|
|
@ -1,7 +0,0 @@
|
|||
string(REGEX REPLACE "\\.(dll|exe)$" ".pdb" FNAME "${FNAME}")
|
||||
|
||||
if(CONFIG STREQUAL Debug OR CONFIG STREQUAL RelWithDebInfo)
|
||||
file(COPY "${INPUT}/${FNAME}" DESTINATION "${OUTPUT}")
|
||||
elseif(EXISTS "${OUTPUT}/${FNAME}")
|
||||
file(REMOVE "${OUTPUT}/${FNAME}")
|
||||
endif()
|
|
@ -1,107 +0,0 @@
|
|||
# This module can be copied and used by external plugins for OBS
|
||||
#
|
||||
# Once done these will be defined:
|
||||
#
|
||||
# LIBOBS_FOUND
|
||||
# LIBOBS_INCLUDE_DIRS
|
||||
# LIBOBS_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_OBS QUIET obs libobs)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
if(DEFINED CMAKE_BUILD_TYPE)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(_build_type_base "debug")
|
||||
else()
|
||||
set(_build_type_base "release")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_path(LIBOBS_INCLUDE_DIR
|
||||
NAMES obs.h
|
||||
HINTS
|
||||
ENV obsPath${_lib_suffix}
|
||||
ENV obsPath
|
||||
${obsPath}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
libobs
|
||||
)
|
||||
|
||||
function(find_obs_lib base_name repo_build_path lib_name)
|
||||
string(TOUPPER "${base_name}" base_name_u)
|
||||
|
||||
if(DEFINED _build_type_base)
|
||||
set(_build_type_${repo_build_path} "${_build_type_base}/${repo_build_path}")
|
||||
set(_build_type_${repo_build_path}${_lib_suffix} "${_build_type_base}${_lib_suffix}/${repo_build_path}")
|
||||
endif()
|
||||
|
||||
find_library(${base_name_u}_LIB
|
||||
NAMES ${_${base_name_u}_LIBRARIES} ${lib_name} lib${lib_name}
|
||||
HINTS
|
||||
ENV obsPath${_lib_suffix}
|
||||
ENV obsPath
|
||||
${obsPath}
|
||||
${_${base_name_u}_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin
|
||||
# base repo non-msvc-specific search paths
|
||||
${_build_type_${repo_build_path}}
|
||||
${_build_type_${repo_build_path}${_lib_suffix}}
|
||||
build/${repo_build_path}
|
||||
build${_lib_suffix}/${repo_build_path}
|
||||
# base repo msvc-specific search paths on windows
|
||||
build${_lib_suffix}/${repo_build_path}/Debug
|
||||
build${_lib_suffix}/${repo_build_path}/RelWithDebInfo
|
||||
build/${repo_build_path}/Debug
|
||||
build/${repo_build_path}/RelWithDebInfo
|
||||
)
|
||||
endfunction()
|
||||
|
||||
find_obs_lib(LIBOBS libobs obs)
|
||||
|
||||
if(MSVC)
|
||||
find_obs_lib(W32_PTHREADS deps/w32-pthreads w32-pthreads)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libobs DEFAULT_MSG LIBOBS_LIB LIBOBS_INCLUDE_DIR)
|
||||
mark_as_advanced(LIBOBS_INCLUDE_DIR LIBOBS_LIB)
|
||||
|
||||
if(LIBOBS_FOUND)
|
||||
if(MSVC)
|
||||
if (NOT DEFINED W32_PTHREADS_LIB)
|
||||
message(FATAL_ERROR "Could not find the w32-pthreads library" )
|
||||
endif()
|
||||
|
||||
set(W32_PTHREADS_INCLUDE_DIR ${LIBOBS_INCLUDE_DIR}/../deps/w32-pthreads)
|
||||
endif()
|
||||
|
||||
set(LIBOBS_INCLUDE_DIRS ${LIBOBS_INCLUDE_DIR} ${W32_PTHREADS_INCLUDE_DIR})
|
||||
set(LIBOBS_LIBRARIES ${LIBOBS_LIB} ${W32_PTHREADS_LIB})
|
||||
include(${LIBOBS_INCLUDE_DIR}/../cmake/external/ObsPluginHelpers.cmake)
|
||||
|
||||
# allows external plugins to easily use/share common dependencies that are often included with libobs (such as FFmpeg)
|
||||
if(NOT DEFINED INCLUDED_LIBOBS_CMAKE_MODULES)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LIBOBS_INCLUDE_DIR}/../cmake/Modules/")
|
||||
set(INCLUDED_LIBOBS_CMAKE_MODULES true)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find the libobs library" )
|
||||
endif()
|
|
@ -1,163 +1,373 @@
|
|||
# Functions for generating external plugins
|
||||
if(POLICY CMP0087)
|
||||
cmake_policy(SET CMP0087 NEW)
|
||||
endif()
|
||||
|
||||
set(EXTERNAL_PLUGIN_OUTPUT_DIR "${CMAKE_BINARY_DIR}/rundir")
|
||||
set(OBS_STANDALONE_PLUGIN_DIR "${CMAKE_SOURCE_DIR}/release")
|
||||
|
||||
# Fix XCode includes to ignore warnings on system includes
|
||||
function(target_include_directories_system _target)
|
||||
if(XCODE)
|
||||
foreach(_arg ${ARGN})
|
||||
if("${_arg}" STREQUAL "PRIVATE" OR "${_arg}" STREQUAL "PUBLIC" OR "${_arg}" STREQUAL "INTERFACE")
|
||||
set(_scope ${_arg})
|
||||
else()
|
||||
target_compile_options(${_target} ${_scope} -isystem${_arg})
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
target_include_directories(${_target} SYSTEM ${_scope} ${ARGN})
|
||||
include(GNUInstallDirs)
|
||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
||||
set(OS_MACOS ON)
|
||||
set(OS_POSIX ON)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux|FreeBSD|OpenBSD")
|
||||
set(OS_POSIX ON)
|
||||
string(TOUPPER "${CMAKE_SYSTEM_NAME}" _SYSTEM_NAME_U)
|
||||
set(OS_${_SYSTEM_NAME_U} ON)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
|
||||
set(OS_WINDOWS ON)
|
||||
set(OS_POSIX OFF)
|
||||
endif()
|
||||
|
||||
# Old-Style plugin detected, find "modern" libobs variant instead and set global
|
||||
# include directories to fix "bad" plugin behavior
|
||||
if(DEFINED LIBOBS_INCLUDE_DIR AND NOT TARGET OBS::libobs)
|
||||
message(
|
||||
DEPRECATION
|
||||
"You are using an outdated method of adding 'libobs' to your project. Refer to the updated wiki on how to build and export 'libobs' and use it in your plugin projects."
|
||||
)
|
||||
find_package(libobs REQUIRED)
|
||||
if(TARGET OBS::libobs)
|
||||
set_target_properties(OBS::libobs PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
message(STATUS "OBS: Using modern libobs target")
|
||||
|
||||
add_library(libobs ALIAS OBS::libobs)
|
||||
if(OS_WINDOWS)
|
||||
add_library(w32-pthreads ALIAS OBS::w32-pthreads)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
endif()
|
||||
|
||||
function(install_external_plugin_data_internal target source_dir target_dir)
|
||||
install(DIRECTORY ${source_dir}/
|
||||
DESTINATION "${target}/${target_dir}"
|
||||
USE_SOURCE_PERMISSIONS)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${source_dir}" "${EXTERNAL_PLUGIN_OUTPUT_DIR}/$<CONFIGURATION>/${target}/${target_dir}"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND (OS_WINDOWS OR OS_MACOS))
|
||||
set(CMAKE_INSTALL_PREFIX
|
||||
"${OBS_STANDALONE_PLUGIN_DIR}"
|
||||
CACHE STRING "Directory to install OBS plugin after building" FORCE)
|
||||
endif()
|
||||
|
||||
# Installs data
|
||||
# 'target' is the destination target project being installed to
|
||||
# 'data_loc' specifies the directory of the data
|
||||
function(install_external_plugin_data target data_loc)
|
||||
install_external_plugin_data_internal(${target} ${data_loc} "data")
|
||||
endfunction()
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE
|
||||
"RelWithDebInfo"
|
||||
CACHE STRING
|
||||
"OBS build type [Release, RelWithDebInfo, Debug, MinSizeRel]" FORCE)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Release RelWithDebInfo
|
||||
Debug MinSizeRel)
|
||||
endif()
|
||||
|
||||
# Installs data in an architecture-specific data directory on windows/linux (data/32bit or data/64bit). Does not apply for mac.
|
||||
# 'target' is the destination target project being installed to
|
||||
# 'data_loc' specifies the directory of the data being installed
|
||||
function(install_external_plugin_arch_data target data_loc)
|
||||
if(APPLE)
|
||||
set(_bit_suffix "")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bit_suffix "/64bit")
|
||||
else()
|
||||
set(_bit_suffix "/32bit")
|
||||
endif()
|
||||
file(RELATIVE_PATH RELATIVE_INSTALL_PATH "${CMAKE_SOURCE_DIR}"
|
||||
"${CMAKE_INSTALL_PREFIX}")
|
||||
file(RELATIVE_PATH RELATIVE_BUILD_PATH "${CMAKE_SOURCE_DIR}"
|
||||
"${CMAKE_BINARY_DIR}")
|
||||
|
||||
install_external_plugin_data_internal(${target} ${data_loc} "data${_bit_suffix}")
|
||||
endfunction()
|
||||
# Set up OS-specific environment and helper functions
|
||||
if(OS_MACOS)
|
||||
if(NOT CMAKE_OSX_ARCHITECTURES)
|
||||
set(CMAKE_OSX_ARCHITECTURES
|
||||
"x86_64"
|
||||
CACHE
|
||||
STRING
|
||||
"OBS plugin build architecture for macOS - x86_64 required at least"
|
||||
FORCE)
|
||||
endif()
|
||||
|
||||
# Installs data in the target's bin directory
|
||||
# 'target' is the destination target project being installed to
|
||||
# 'data_loc' specifies the directory of the data being installed
|
||||
function(install_external_plugin_data_to_bin target data_loc)
|
||||
if(APPLE)
|
||||
set(_bit_suffix "")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bit_suffix "/64bit")
|
||||
else()
|
||||
set(_bit_suffix "/32bit")
|
||||
endif()
|
||||
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET
|
||||
"10.13"
|
||||
CACHE STRING "OBS plugin deployment target for macOS - 10.13+ required"
|
||||
FORCE)
|
||||
endif()
|
||||
|
||||
install_external_plugin_data_internal(${target} ${data_loc} "bin${_bit_suffix}")
|
||||
endfunction()
|
||||
if(NOT DEFINED OBS_CODESIGN_LINKER)
|
||||
set(OBS_CODESIGN_LINKER
|
||||
ON
|
||||
CACHE BOOL "Enable linker code-signing on macOS (macOS 11+ required"
|
||||
FORCE)
|
||||
endif()
|
||||
|
||||
# Installs an additional binary to a target
|
||||
# 'target' is the destination target project being installed to
|
||||
# 'additional_target' specifies the additional binary
|
||||
function(install_external_plugin_additional target additional_target)
|
||||
if(APPLE)
|
||||
set(_bit_suffix "")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bit_suffix "64bit/")
|
||||
else()
|
||||
set(_bit_suffix "32bit/")
|
||||
endif()
|
||||
if(NOT DEFINED OBS_BUNDLE_CODESIGN_IDENTITY)
|
||||
set(OBS_BUNDLE_CODESIGN_IDENTITY
|
||||
"-"
|
||||
CACHE STRING "Codesign identity for macOS" FORCE)
|
||||
endif()
|
||||
|
||||
set_target_properties(${additional_target} PROPERTIES
|
||||
PREFIX "")
|
||||
# Xcode configuration
|
||||
if(XCODE)
|
||||
# Tell Xcode to pretend the linker signed binaries so that editing with
|
||||
# install_name_tool preserves ad-hoc signatures. This option is supported by
|
||||
# `codesign` on macOS 11 or higher.
|
||||
#
|
||||
# See CMake Issue 21854:
|
||||
# (https://gitlab.kitware.com/cmake/cmake/-/issues/21854).
|
||||
|
||||
install(TARGETS ${additional_target}
|
||||
LIBRARY DESTINATION "bin"
|
||||
RUNTIME DESTINATION "bin")
|
||||
add_custom_command(TARGET ${additional_target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"$<TARGET_FILE:${additional_target}>"
|
||||
"${EXTERNAL_PLUGIN_OUTPUT_DIR}/$<CONFIGURATION>/${target}/bin/${_bit_suffix}$<TARGET_FILE_NAME:${additional_target}>"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
set(CMAKE_XCODE_GENERATE_SCHEME ON)
|
||||
if(OBS_CODESIGN_LINKER)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "-o linker-signed")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Installs the binary of the target
|
||||
# 'target' is the target project being installed
|
||||
function(install_external_plugin target)
|
||||
install_external_plugin_additional(${target} ${target})
|
||||
endfunction()
|
||||
# Set default options for bundling on macOS
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
set(CMAKE_SKIP_BUILD_RPATH OFF)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
|
||||
set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks/")
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH OFF)
|
||||
|
||||
# Installs the binary and data of the target
|
||||
# 'target' is the destination target project being installed to
|
||||
function(install_external_plugin_with_data target data_loc)
|
||||
install_external_plugin(${target})
|
||||
install_external_plugin_data(${target} ${data_loc})
|
||||
endfunction()
|
||||
function(setup_plugin_target target)
|
||||
if(NOT DEFINED MACOSX_PLUGIN_GUI_IDENTIFIER)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"No 'MACOSX_PLUGIN_GUI_IDENTIFIER' set, but is required to build plugin bundles on macOS - example: 'com.yourname.pluginname'"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Installs an additional binary to the data of a target
|
||||
# 'target' is the destination target project being installed to
|
||||
# 'additional_target' specifies the additional binary
|
||||
function(install_external_plugin_bin_to_data target additional_target)
|
||||
install(TARGETS ${additional_target}
|
||||
LIBRARY DESTINATION "data"
|
||||
RUNTIME DESTINATION "data")
|
||||
add_custom_command(TARGET ${additional_target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"$<TARGET_FILE:${additional_target}>"
|
||||
"${EXTERNAL_PLUGIN_OUTPUT_DIR}/$<CONFIGURATION>/${target}/data/$<TARGET_FILE_NAME:${additional_target}>"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
if(NOT DEFINED MACOSX_PLUGIN_BUNDLE_VERSION)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"No 'MACOSX_PLUGIN_BUNDLE_VERSION' set, but is required to build plugin bundles on macOS - example: '25'"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Installs an additional binary in an architecture-specific data directory on windows/linux (data/32bit or data/64bit). Does not apply for mac.
|
||||
# 'target' is the destination target project being installed to
|
||||
# 'additional_target' specifies the additional binary
|
||||
function(install_external_plugin_bin_to_arch_data target additional_target)
|
||||
if(APPLE)
|
||||
set(_bit_suffix "")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bit_suffix "/64bit")
|
||||
else()
|
||||
set(_bit_suffix "/32bit")
|
||||
endif()
|
||||
if(NOT DEFINED MACOSX_PLUGIN_SHORT_VERSION_STRING)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"No 'MACOSX_PLUGIN_SHORT_VERSION_STRING' set, but is required to build plugin bundles on macOS - example: '1.0.2'"
|
||||
)
|
||||
endif()
|
||||
|
||||
install(TARGETS ${additional_target}
|
||||
LIBRARY DESTINATION "data${_bit_suffix}"
|
||||
RUNTIME DESTINATION "data${_bit_suffix}")
|
||||
add_custom_command(TARGET ${additional_target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"$<TARGET_FILE:${additional_target}>"
|
||||
"${EXTERNAL_PLUGIN_OUTPUT_DIR}/$<CONFIGURATION>/${target}/data${_bit_suffix}/$<TARGET_FILE_NAME:${additional_target}>"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
set(MACOSX_PLUGIN_BUNDLE_NAME
|
||||
"${target}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_BUNDLE_VERSION
|
||||
"${MACOSX_BUNDLE_BUNDLE_VERSION}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_SHORT_VERSION_STRING
|
||||
"${MACOSX_BUNDLE_SHORT_VERSION_STRING}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_EXECUTABLE_NAME
|
||||
"${target}"
|
||||
PARENT_SCOPE)
|
||||
set(MACOSX_PLUGIN_BUNDLE_TYPE
|
||||
"BNDL"
|
||||
PARENT_SCOPE)
|
||||
|
||||
# Installs an additional file in an architecture-specific data directory on windows/linux (data/32bit or data/64bit). Does not apply for mac.
|
||||
# 'target' is the destination target project being installed to
|
||||
# 'additional_target' specifies the additional binary
|
||||
function(install_external_plugin_data_file_to_arch_data target additional_target file_target)
|
||||
if(APPLE)
|
||||
set(_bit_suffix "")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bit_suffix "/64bit")
|
||||
else()
|
||||
set(_bit_suffix "/32bit")
|
||||
endif()
|
||||
install(
|
||||
TARGETS ${target}
|
||||
LIBRARY DESTINATION "."
|
||||
COMPONENT obs_plugins
|
||||
NAMELINK_COMPONENT ${target}_Development)
|
||||
|
||||
get_filename_component(file_target_name ${file_target} NAME)
|
||||
set(_COMMAND
|
||||
"${CMAKE_INSTALL_NAME_TOOL} \\
|
||||
-change ${CMAKE_PREFIX_PATH}/lib/QtWidgets.framework/Versions/5/QtWidgets @rpath/QtWidgets.framework/Versions/5/QtWidgets \\
|
||||
-change ${CMAKE_PREFIX_PATH}/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore.framework/Versions/5/QtCore \\
|
||||
-change ${CMAKE_PREFIX_PATH}/lib/QtGui.framework/Versions/5/QtGui @rpath/QtGui.framework/Versions/5/QtGui \\
|
||||
\\\"\${CMAKE_INSTALL_PREFIX}/${target}.plugin/Contents/MacOS/${target}\\\""
|
||||
)
|
||||
install(CODE "execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")"
|
||||
COMPONENT obs_plugins)
|
||||
|
||||
install(TARGETS ${additional_target}
|
||||
LIBRARY DESTINATION "data${_bit_suffix}"
|
||||
RUNTIME DESTINATION "data${_bit_suffix}")
|
||||
add_custom_command(TARGET ${additional_target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"${file_target}"
|
||||
"${EXTERNAL_PLUGIN_OUTPUT_DIR}/$<CONFIGURATION>/${target}/data${_bit_suffix}/${file_target_name}"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
if(NOT XCODE)
|
||||
set(_COMMAND
|
||||
"/usr/bin/codesign --force \\
|
||||
--sign \\\"${OBS_BUNDLE_CODESIGN_IDENTITY}\\\" \\
|
||||
--options runtime \\
|
||||
--entitlements \\\"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../bundle/macOS/entitlements.plist\\\" \\
|
||||
\\\"${CMAKE_INSTALL_PREFIX}/${target}.plugin\\\"")
|
||||
install(CODE "execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")"
|
||||
COMPONENT obs_plugins)
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
${target}
|
||||
PROPERTIES
|
||||
BUNDLE ON
|
||||
BUNDLE_EXTENSION "plugin"
|
||||
OUTPUT_NAME ${target}
|
||||
MACOSX_BUNDLE_INFO_PLIST
|
||||
"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../bundle/macOS/Plugin-Info.plist.in"
|
||||
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER
|
||||
"${MACOSX_PLUGIN_GUI_IDENTIFIER}"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${OBS_BUNDLE_CODESIGN_IDENTITY}"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
|
||||
"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../bundle/macOS/entitlements.plist")
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
/bin/sh -c
|
||||
"codesign --force --sign \"-\" $<$<BOOL:${OBS_CODESIGN_LINKER}>:--options linker-signed >\"$<TARGET_BUNDLE_DIR:${target}>\""
|
||||
COMMENT "Codesigning ${target}"
|
||||
VERBATIM)
|
||||
|
||||
install_bundle_resources(${target})
|
||||
endfunction()
|
||||
|
||||
function(install_bundle_resources target)
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
|
||||
file(GLOB_RECURSE _DATA_FILES "${CMAKE_CURRENT_SOURCE_DIR}/data/*")
|
||||
foreach(_DATA_FILE IN LISTS _DATA_FILES)
|
||||
file(RELATIVE_PATH _RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/data/
|
||||
${_DATA_FILE})
|
||||
get_filename_component(_RELATIVE_PATH "${_RELATIVE_PATH}" PATH)
|
||||
target_sources(${target} PRIVATE ${_DATA_FILE})
|
||||
set_source_files_properties(
|
||||
${_DATA_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION
|
||||
"Resources/${_RELATIVE_PATH}")
|
||||
string(REPLACE "\\" "\\\\" _GROUP_NAME "${_RELATIVE_PATH}")
|
||||
source_group("Resources\\${_GROUP_NAME}" FILES ${_DATA_FILE})
|
||||
endforeach()
|
||||
endif()
|
||||
endfunction()
|
||||
else()
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_ARCH_SUFFIX 64)
|
||||
else()
|
||||
set(_ARCH_SUFFIX 32)
|
||||
endif()
|
||||
set(OBS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/rundir")
|
||||
|
||||
if(OS_POSIX)
|
||||
option(LINUX_PORTABLE "Build portable version (Linux)" OFF)
|
||||
if(NOT LINUX_PORTABLE)
|
||||
set(OBS_LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
set(OBS_PLUGIN_DESTINATION "${OBS_LIBRARY_DESTINATION}/obs-plugins")
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
set(OBS_DATA_DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/obs")
|
||||
else()
|
||||
set(OBS_LIBRARY_DESTINATION "bin/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_PLUGIN_DESTINATION "obs-plugins/${_ARCH_SUFFIX}bit")
|
||||
set(CMAKE_INSTALL_RPATH
|
||||
"$ORIGIN/" "${CMAKE_INSTALL_PREFIX}/${OBS_LIBRARY_DESTINATION}")
|
||||
set(OBS_DATA_DESTINATION "data")
|
||||
endif()
|
||||
|
||||
if(OS_LINUX)
|
||||
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${LINUX_MAINTAINER_EMAIL}")
|
||||
set(CPACK_PACKAGE_VERSION "${CMAKE_PROJECT_VERSION}")
|
||||
|
||||
set(CPACK_GENERATOR "DEB")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS
|
||||
"obs-studio (>= 27.0.0), libqt5core5a (>= 5.9.0~beta), libqt5gui5 (>= 5.3.0), libqt5widgets5 (>= 5.7.0)"
|
||||
)
|
||||
|
||||
if(NOT LINUX_PORTABLE)
|
||||
set(CPACK_SET_DESTDIR ON)
|
||||
endif()
|
||||
include(CPack)
|
||||
endif()
|
||||
else()
|
||||
set(OBS_LIBRARY_DESTINATION "bin/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_LIBRARY32_DESTINATION "bin/32bit")
|
||||
set(OBS_LIBRARY64_DESTINATION "bin/64bit")
|
||||
set(OBS_PLUGIN_DESTINATION "obs-plugins/${_ARCH_SUFFIX}bit")
|
||||
set(OBS_PLUGIN32_DESTINATION "obs-plugins/32bit")
|
||||
set(OBS_PLUGIN64_DESTINATION "obs-plugins/64bit")
|
||||
|
||||
set(OBS_DATA_DESTINATION "data")
|
||||
endif()
|
||||
|
||||
function(setup_plugin_target target)
|
||||
set_target_properties(${target} PROPERTIES PREFIX "")
|
||||
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME DESTINATION "${OBS_PLUGIN_DESTINATION}"
|
||||
COMPONENT ${target}_Runtime
|
||||
LIBRARY DESTINATION "${OBS_PLUGIN_DESTINATION}"
|
||||
COMPONENT ${target}_Runtime
|
||||
NAMELINK_COMPONENT ${target}_Development)
|
||||
|
||||
install(
|
||||
FILES "$<TARGET_FILE:${target}>"
|
||||
DESTINATION "$<CONFIG>/${OBS_PLUGIN_DESTINATION}"
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
install(
|
||||
FILES "$<TARGET_PDB_FILE:${target}>"
|
||||
CONFIGURATIONS "RelWithDebInfo" "Debug"
|
||||
DESTINATION "$<CONFIG>/${OBS_PLUGIN_DESTINATION}"
|
||||
COMPONENT obs_rundir
|
||||
OPTIONAL EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
target_link_options(
|
||||
${target}
|
||||
PRIVATE
|
||||
"LINKER:/OPT:REF"
|
||||
"$<$<NOT:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>>:LINKER\:/SAFESEH\:NO>"
|
||||
"$<$<CONFIG:DEBUG>:LINKER\:/INCREMENTAL:NO>"
|
||||
"$<$<CONFIG:RELWITHDEBINFO>:LINKER\:/INCREMENTAL:NO>")
|
||||
endif()
|
||||
|
||||
setup_target_resources("${target}" "obs-plugins/${target}")
|
||||
|
||||
if(OS_WINDOWS AND DEFINED OBS_BUILD_DIR)
|
||||
setup_target_for_testing(${target})
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -DCMAKE_INSTALL_PREFIX=${OBS_OUTPUT_DIR}
|
||||
-DCMAKE_INSTALL_COMPONENT=obs_rundir
|
||||
-DCMAKE_INSTALL_CONFIG_NAME=$<CONFIG> -P
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake
|
||||
COMMENT "Installing to plugin rundir"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
|
||||
function(setup_target_resources target destination)
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
|
||||
install(
|
||||
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
|
||||
DESTINATION "${OBS_DATA_DESTINATION}/${destination}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT obs_plugins)
|
||||
|
||||
install(
|
||||
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data"
|
||||
DESTINATION "$<CONFIG>/${OBS_DATA_DESTINATION}/${destination}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT obs_rundir
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if(OS_WINDOWS)
|
||||
function(setup_target_for_testing target)
|
||||
install(
|
||||
FILES "$<TARGET_FILE:${target}>"
|
||||
DESTINATION "$<CONFIG>/${OBS_PLUGIN_DESTINATION}"
|
||||
COMPONENT obs_testing
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
install(
|
||||
FILES "$<TARGET_PDB_FILE:${target}>"
|
||||
CONFIGURATIONS "RelWithDebInfo" "Debug"
|
||||
DESTINATION "$<CONFIG>/${OBS_PLUGIN_DESTINATION}"
|
||||
COMPONENT obs_testing
|
||||
OPTIONAL EXCLUDE_FROM_ALL)
|
||||
|
||||
install(
|
||||
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data"
|
||||
DESTINATION "$<CONFIG>/${OBS_DATA_DESTINATION}/${destination}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT obs_testing
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -DCMAKE_INSTALL_PREFIX=${OBS_BUILD_DIR}/rundir
|
||||
-DCMAKE_INSTALL_COMPONENT=obs_testing
|
||||
-DCMAKE_INSTALL_CONFIG_NAME=$<CONFIG> -P
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake
|
||||
COMMENT "Installing to OBS test directory"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
1 VERSIONINFO
|
||||
FILEVERSION ${UI_VERSION_MAJOR},${UI_VERSION_MINOR},${UI_VERSION_PATCH},0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "${OBS_COMPANY_NAME}"
|
||||
VALUE "FileDescription", "${MODULE_DESCRIPTION}"
|
||||
VALUE "FileVersion", "${UI_VERSION}"
|
||||
VALUE "ProductName", "${OBS_PRODUCT_NAME}"
|
||||
VALUE "ProductVersion", "${UI_VERSION}"
|
||||
VALUE "Comments", "${OBS_COMMENTS}"
|
||||
VALUE "LegalCopyright", "${OBS_LEGAL_COPYRIGHT}"
|
||||
VALUE "InternalName", "${PROJECT_NAME}"
|
||||
VALUE "OriginalFilename", "${PROJECT_NAME}"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
Binary file not shown.
Before Width: | Height: | Size: 91 KiB |
Loading…
Reference in New Issue