Imported Upstream version 0.13.2+dsfg1
This commit is contained in:
commit
fb3990e9e5
2036 changed files with 287360 additions and 0 deletions
38
cmake/Modules/CheckForPthreads.c
Normal file
38
cmake/Modules/CheckForPthreads.c
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void* runner(void*);
|
||||
|
||||
int res = 0;
|
||||
#ifdef __CLASSIC_C__
|
||||
int main(){
|
||||
int ac;
|
||||
char*av[];
|
||||
#else
|
||||
int main(int ac, char*av[]){
|
||||
#endif
|
||||
pthread_t tid[2];
|
||||
pthread_create(&tid[0], 0, runner, (void*)1);
|
||||
pthread_create(&tid[1], 0, runner, (void*)2);
|
||||
|
||||
#if defined(__BEOS__) && !defined(__ZETA__) // (no usleep on BeOS 5.)
|
||||
usleep(1); // for strange behavior on single-processor sun
|
||||
#endif
|
||||
|
||||
pthread_join(tid[0], 0);
|
||||
pthread_join(tid[1], 0);
|
||||
if(ac > 1000){return *av[0];}
|
||||
return res;
|
||||
}
|
||||
|
||||
void* runner(void* args)
|
||||
{
|
||||
int cc;
|
||||
for ( cc = 0; cc < 10; cc ++ )
|
||||
{
|
||||
printf("%d CC: %d\n", (int)args, cc);
|
||||
}
|
||||
res ++;
|
||||
return 0;
|
||||
}
|
||||
243
cmake/Modules/CopyMSVCBins.cmake
Normal file
243
cmake/Modules/CopyMSVCBins.cmake
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
# Doesn't realy make sense anywhere else
|
||||
if(NOT MSVC)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Internal variable to avoid copying more than once
|
||||
if(COPIED_DEPENDENCIES)
|
||||
return()
|
||||
endif()
|
||||
|
||||
option(COPY_DEPENDENCIES "Automaticaly try copying all dependencies" OFF)
|
||||
if(NOT COPY_DEPENDENCIES)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bin_suffix 64)
|
||||
else()
|
||||
set(_bin_suffix 32)
|
||||
endif()
|
||||
|
||||
find_package(Libavcodec QUIET)
|
||||
find_package(Libx264 QUIET)
|
||||
find_package(Libfdk QUIET)
|
||||
find_package(ssl QUIET)
|
||||
find_package(Qt5Core QUIET)
|
||||
|
||||
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${_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}/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"
|
||||
)
|
||||
|
||||
if (ZLIB_LIB)
|
||||
GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIB} PATH)
|
||||
endif()
|
||||
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"
|
||||
)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CONFIGURATION_TYPES MATCHES "Debug")
|
||||
file(GLOB QT_DEBUG_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Cored.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Guid.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Widgetsd.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libGLESv2d.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libEGLd.dll")
|
||||
file(GLOB QT_DEBUG_PLAT_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/platforms/qwindowsd.dll")
|
||||
endif()
|
||||
|
||||
if (CMAKE_CONFIGURATION_TYPES MATCHES "Rel")
|
||||
file(GLOB QT_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Core.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Gui.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Widgets.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libGLESv2.dll"
|
||||
"${Qt5Core_DIR}/../../../bin/libEGL.dll")
|
||||
file(GLOB QT_PLAT_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../plugins/platforms/qwindows.dll")
|
||||
endif()
|
||||
|
||||
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}
|
||||
${SSL_BIN_FILES}
|
||||
${ZLIB_BIN_FILES}
|
||||
${LIBFDK_BIN_FILES}
|
||||
${FREETYPE_BIN_FILES}
|
||||
${QT_ICU_BIN_FILES})
|
||||
|
||||
set(ALL_REL_BIN_FILES
|
||||
${QT_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})
|
||||
|
||||
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)
|
||||
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 "curl files: ${CURL_BIN_FILES}")
|
||||
message(STATUS "ssl files: ${SSL_BIN_FILES}")
|
||||
message(STATUS "zlib files: ${ZLIB_BIN_FILES}")
|
||||
message(STATUS "QT Debug files: ${QT_DEBUG_BIN_FILES}")
|
||||
message(STATUS "QT Debug Platform files: ${QT_DEBUG_PLAT_BIN_FILES}")
|
||||
message(STATUS "QT Release files: ${QT_BIN_FILES}")
|
||||
message(STATUS "QT Release Platform files: ${QT_PLAT_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}/")
|
||||
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/")
|
||||
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/")
|
||||
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/")
|
||||
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/")
|
||||
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/")
|
||||
endforeach()
|
||||
|
||||
set(COPIED_DEPENDENCIES TRUE CACHE BOOL "Dependencies have been copied, set to false to copy again" FORCE)
|
||||
12
cmake/Modules/FindAppKit.cmake
Normal file
12
cmake/Modules/FindAppKit.cmake
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# 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)
|
||||
68
cmake/Modules/FindCXX11.cmake
Normal file
68
cmake/Modules/FindCXX11.cmake
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
# - 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)
|
||||
43
cmake/Modules/FindDBus.cmake
Normal file
43
cmake/Modules/FindDBus.cmake
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# DBUS_FOUND
|
||||
# DBUS_INCLUDE_DIRS
|
||||
# DBUS_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_DBUS QUIET dbus-1)
|
||||
endif()
|
||||
|
||||
find_path(DBUS_INCLUDE_DIR
|
||||
NAMES dbus/dbus.h
|
||||
HINTS
|
||||
${_DBUS_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include)
|
||||
|
||||
find_path(DBUS_ARCH_INCLUDE_DIR
|
||||
NAMES dbus/dbus-arch-deps.h
|
||||
HINTS
|
||||
${_DBUS_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include)
|
||||
|
||||
find_library(DBUS_LIB
|
||||
NAMES dbus-1
|
||||
HINTS
|
||||
${_DBUS_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(DBus DEFAULT_MSG DBUS_LIB DBUS_INCLUDE_DIR DBUS_ARCH_INCLUDE_DIR)
|
||||
mark_as_advanced(DBUS_INCLUDE_DIR DBUS_ARCH_INCLUDE_DIR DBUS_LIB)
|
||||
|
||||
if(DBUS_FOUND)
|
||||
set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
|
||||
set(DBUS_LIBRARIES ${DBUS_LIB})
|
||||
set(HAVE_DBUS "1")
|
||||
else()
|
||||
set(HAVE_DBUS "0")
|
||||
endif()
|
||||
151
cmake/Modules/FindFFmpeg.cmake
Normal file
151
cmake/Modules/FindFFmpeg.cmake
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
#
|
||||
# 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 componenets 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
|
||||
#
|
||||
# <component> is the uppercase name of the component
|
||||
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
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)
|
||||
|
||||
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}
|
||||
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}
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
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}")
|
||||
|
||||
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()
|
||||
endfunction()
|
||||
|
||||
set(FFMPEG_INCLUDE_DIRS)
|
||||
set(FFMPEG_LIBRARIES)
|
||||
|
||||
if(NOT FFmpeg_FIND_COMPONENTS)
|
||||
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()
|
||||
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)
|
||||
34
cmake/Modules/FindFontconfig.cmake
Normal file
34
cmake/Modules/FindFontconfig.cmake
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# 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()
|
||||
94
cmake/Modules/FindFreetype.cmake
Normal file
94
cmake/Modules/FindFreetype.cmake
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
# 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()
|
||||
45
cmake/Modules/FindIconv.cmake
Normal file
45
cmake/Modules/FindIconv.cmake
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# 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()
|
||||
82
cmake/Modules/FindJack.cmake
Normal file
82
cmake/Modules/FindJack.cmake
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
# - 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
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
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)
|
||||
include(UsePkgConfig)
|
||||
pkgconfig(jack _JACK_INCLUDEDIR _JACK_LIBDIR _JACK_LDFLAGS _JACK_CFLAGS)
|
||||
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
find_package(PkgConfig)
|
||||
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_INCLUDEDIR}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
)
|
||||
|
||||
find_library(JACK_LIBRARY
|
||||
NAMES
|
||||
jack
|
||||
PATHS
|
||||
${_JACK_LIBDIR}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
if (JACK_LIBRARY AND JACK_INCLUDE_DIR)
|
||||
set(JACK_FOUND TRUE)
|
||||
|
||||
set(JACK_INCLUDE_DIRS
|
||||
${JACK_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(JACK_LIBRARIES
|
||||
${JACK_LIBRARIES}
|
||||
${JACK_LIBRARY}
|
||||
)
|
||||
|
||||
endif (JACK_LIBRARY AND JACK_INCLUDE_DIR)
|
||||
|
||||
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)
|
||||
|
||||
# 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)
|
||||
|
||||
84
cmake/Modules/FindJansson.cmake
Normal file
84
cmake/Modules/FindJansson.cmake
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# JANSSON_FOUND
|
||||
# JANSSON_INCLUDE_DIRS
|
||||
# JANSSON_LIBRARIES
|
||||
# JANSSON_VERSION
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_JANSSON QUIET jansson)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
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_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)
|
||||
|
||||
if(JANSSON_VERSION)
|
||||
set(_JANSSON_VERSION_STRING "${JANSSON_VERSION}")
|
||||
elseif(_JANSSON_FOUND AND _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}")
|
||||
else()
|
||||
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)
|
||||
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})
|
||||
endif()
|
||||
33
cmake/Modules/FindLibUDev.cmake
Normal file
33
cmake/Modules/FindLibUDev.cmake
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# 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 udev)
|
||||
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()
|
||||
70
cmake/Modules/FindLibcurl.cmake
Normal file
70
cmake/Modules/FindLibcurl.cmake
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# 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)
|
||||
|
||||
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")
|
||||
|
||||
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()
|
||||
66
cmake/Modules/FindLibfdk.cmake
Normal file
66
cmake/Modules/FindLibfdk.cmake
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBFDK_FOUND
|
||||
# LIBFDK_INCLUDE_DIRS
|
||||
# LIBFDK_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# Libfdk_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_LIBFDK QUIET fdk-aac)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
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})
|
||||
endif()
|
||||
24
cmake/Modules/FindLibsysinfo.cmake
Normal file
24
cmake/Modules/FindLibsysinfo.cmake
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# 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()
|
||||
33
cmake/Modules/FindLibv4l2.cmake
Normal file
33
cmake/Modules/FindLibv4l2.cmake
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBV4L2_FOUND
|
||||
# LIBV4L2_INCLUDE_DIRS
|
||||
# LIBV4L2_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
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_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})
|
||||
endif()
|
||||
68
cmake/Modules/FindLibx264.cmake
Normal file
68
cmake/Modules/FindLibx264.cmake
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# LIBX264_FOUND
|
||||
# LIBX264_INCLUDE_DIRS
|
||||
# LIBX264_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# X264_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_X264 QUIET x264)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
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_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)
|
||||
|
||||
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})
|
||||
endif()
|
||||
77
cmake/Modules/FindSSL.cmake
Normal file
77
cmake/Modules/FindSSL.cmake
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# SSL_FOUND
|
||||
# SSL_INCLUDE_DIRS
|
||||
# SSL_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# SSL_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_CRYPTO QUIET libcrypto)
|
||||
pkg_check_modules(_SSL QUIET libssl)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
set(_SSL_BASE_HINTS
|
||||
ENV sslPath${_lib_suffix}
|
||||
ENV sslPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${sslPath${_lib_suffix}}
|
||||
${sslPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath})
|
||||
|
||||
set(_SSL_LIB_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_path(SSL_INCLUDE_DIR
|
||||
NAMES openssl/ssl.h
|
||||
HINTS
|
||||
${_SSL_BASE_HINTS}
|
||||
${_CRYPTO_INCLUDE_DIRS}
|
||||
${_SSL_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
|
||||
find_library(_SSL_LIB
|
||||
NAMES ${_SSL_LIBRARIES} ssleay32 ssl
|
||||
HINTS
|
||||
${_SSL_BASE_HINTS}
|
||||
${_SSL_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES ${_SSL_LIB_SUFFIXES})
|
||||
|
||||
find_library(_CRYPTO_LIB
|
||||
NAMES ${_CRYPTO_LIBRARIES} libeay32 crypto
|
||||
HINTS
|
||||
${_SSL_BASE_HINTS}
|
||||
${_CRYPTO_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES ${_SSL_LIB_SUFFIXES})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(ssl DEFAULT_MSG _SSL_LIB _CRYPTO_LIB SSL_INCLUDE_DIR)
|
||||
mark_as_advanced(SSL_INCLUDE_DIR _SSL_LIB _CRYPTO_LIB)
|
||||
|
||||
if(SSL_FOUND)
|
||||
set(SSL_INCLUDE_DIRS ${SSL_INCLUDE_DIR})
|
||||
set(SSL_LIBRARIES ${_SSL_LIB} ${_CRYPTO_LIB})
|
||||
endif()
|
||||
202
cmake/Modules/FindThreads.cmake
Normal file
202
cmake/Modules/FindThreads.cmake
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
#.rst:
|
||||
# FindThreads
|
||||
# -----------
|
||||
#
|
||||
# This module determines the thread library of the system.
|
||||
#
|
||||
# The following import target is created
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CMake::Threads
|
||||
#
|
||||
# The following variables are set
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# THREADS_FOUND
|
||||
# THREADS_LIBRARIES
|
||||
# THREADS_DEFINITIONS
|
||||
#
|
||||
# Legacy variables
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CMAKE_THREAD_LIBS_INIT - the thread library
|
||||
# CMAKE_THREAD_DEFS_INIT - the thread compile definitions
|
||||
# CMAKE_USE_SPROC_INIT - are we using sproc?
|
||||
# CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
|
||||
# CMAKE_USE_PTHREADS_INIT - are we using pthreads
|
||||
# CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
|
||||
#
|
||||
# For systems with multiple thread libraries, caller can set
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CMAKE_THREAD_PREFER_PTHREAD
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-2014 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckSymbolExists)
|
||||
set(Threads_FOUND FALSE)
|
||||
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
|
||||
set(CMAKE_REQUIRED_QUIET ${Threads_FIND_QUIETLY})
|
||||
|
||||
# Do we have sproc?
|
||||
if(CMAKE_SYSTEM_NAME MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
|
||||
check_include_files("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H)
|
||||
endif()
|
||||
|
||||
if(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD)
|
||||
# We have sproc
|
||||
set(CMAKE_USE_SPROC_INIT 1)
|
||||
else()
|
||||
# Do we have pthreads?
|
||||
check_include_files("pthread.h" CMAKE_HAVE_PTHREAD_H)
|
||||
|
||||
if(CMAKE_HAVE_PTHREAD_H)
|
||||
|
||||
#
|
||||
# We have pthread.h
|
||||
# Let's check for the library now.
|
||||
#
|
||||
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY)
|
||||
|
||||
# Check if pthread functions are in normal C library
|
||||
check_symbol_exists(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE)
|
||||
if(CMAKE_HAVE_LIBC_CREATE)
|
||||
set(CMAKE_THREAD_LIBS_INIT "")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(NOT Threads_FOUND AND NOT THREADS_HAVE_PTHREAD_ARG)
|
||||
message(STATUS "Check if compiler accepts -pthread")
|
||||
try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c
|
||||
COMPILE_DEFINITIONS -pthread
|
||||
CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
|
||||
COMPILE_OUTPUT_VARIABLE OUTPUT)
|
||||
|
||||
if(THREADS_HAVE_PTHREAD_ARG)
|
||||
if(THREADS_PTHREAD_ARG STREQUAL "2")
|
||||
message(STATUS "Check if compiler accepts -pthread - yes")
|
||||
else()
|
||||
message(STATUS "Check if compiler accepts -pthread - no")
|
||||
file(APPEND
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if compiler accepts -pthread returned ${THREADS_PTHREAD_ARG} instead of 2. The compiler had the following output:\n${OUTPUT}\n\n")
|
||||
set(THREADS_HAVE_PTHREAD_ARG)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Check if compiler accepts -pthread - no")
|
||||
file(APPEND
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT Threads_FOUND AND THREADS_HAVE_PTHREAD_ARG)
|
||||
set(Threads_FOUND TRUE)
|
||||
set(CMAKE_THREAD_LIBS_INIT "-pthread")
|
||||
set(CMAKE_THREAD_DEFS_INIT "-pthread")
|
||||
endif()
|
||||
|
||||
if(NOT Threads_FOUND)
|
||||
if(NOT CMAKE_HAVE_THREADS_LIBRARY)
|
||||
# Do we have -lpthreads
|
||||
check_library_exists(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE)
|
||||
if(CMAKE_HAVE_PTHREADS_CREATE)
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lpthreads")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
# Ok, how about -lpthread
|
||||
check_library_exists(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
|
||||
if(CMAKE_HAVE_PTHREAD_CREATE)
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES "SunOS.*")
|
||||
# On sun also check for -lthread
|
||||
check_library_exists(thread thr_create "" CMAKE_HAVE_THR_CREATE)
|
||||
if(CMAKE_HAVE_THR_CREATE)
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lthread")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
|
||||
set(CMAKE_USE_PTHREADS_INIT 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(CMAKE_USE_WIN32_THREADS_INIT 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_USE_PTHREADS_INIT)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
|
||||
# Use libcma if it exists and can be used. It provides more
|
||||
# symbols than the plain pthread library. CMA threads
|
||||
# have actually been deprecated:
|
||||
# http://docs.hp.com/en/B3920-90091/ch12s03.html#d0e11395
|
||||
# http://docs.hp.com/en/947/d8.html
|
||||
# but we need to maintain compatibility here.
|
||||
# The CMAKE_HP_PTHREADS setting actually indicates whether CMA threads
|
||||
# are available.
|
||||
check_library_exists(cma pthread_attr_create "" CMAKE_HAVE_HP_CMA)
|
||||
if(CMAKE_HAVE_HP_CMA)
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lcma")
|
||||
set(CMAKE_HP_PTHREADS_INIT 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
set(CMAKE_USE_PTHREADS_INIT 1)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES "OSF1-V")
|
||||
set(CMAKE_USE_PTHREADS_INIT 0)
|
||||
set(CMAKE_THREAD_LIBS_INIT )
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES "CYGWIN_NT")
|
||||
set(CMAKE_USE_PTHREADS_INIT 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
set(CMAKE_THREAD_LIBS_INIT )
|
||||
set(CMAKE_USE_WIN32_THREADS_INIT 0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Threads DEFAULT_MSG Threads_FOUND)
|
||||
|
||||
if(THREADS_FOUND)
|
||||
set(THREADS_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
set(THREADS_DEFINITIONS "${CMAKE_THREAD_DEFS_INIT}")
|
||||
endif()
|
||||
31
cmake/Modules/FindX11_XCB.cmake
Normal file
31
cmake/Modules/FindX11_XCB.cmake
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# - 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_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>
|
||||
#
|
||||
# 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)
|
||||
|
||||
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})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
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)
|
||||
244
cmake/Modules/FindXCB.cmake
Normal file
244
cmake/Modules/FindXCB.cmake
Normal file
|
|
@ -0,0 +1,244 @@
|
|||
# Try to find XCB on a Unix system
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# 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_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>
|
||||
#
|
||||
# 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
|
||||
XINERAMA)
|
||||
|
||||
unset(unknownComponents)
|
||||
|
||||
set(pkgConfigModules)
|
||||
set(requiredComponents)
|
||||
|
||||
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.
|
||||
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 "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()
|
||||
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 "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})
|
||||
|
||||
if(XCB_${_comp}_INCLUDE_DIR AND XCB_${_comp}_LIBRARY)
|
||||
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()
|
||||
|
||||
if(XCB_FIND_REQUIRED_${_comp})
|
||||
list(APPEND requiredComponents XCB_${_comp}_FOUND)
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(XCB_${_comp} DEFAULT_MSG XCB_${_comp}_LIBRARY XCB_${_comp}_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(XCB_${_comp}_LIBRARY XCB_${_comp}_INCLUDE_DIR)
|
||||
|
||||
# compatibility for old variable naming
|
||||
set(XCB_${_comp}_INCLUDE_DIRS ${XCB_${_comp}_INCLUDE_DIR})
|
||||
set(XCB_${_comp}_LIBRARIES ${XCB_${_comp}_LIBRARY})
|
||||
endmacro()
|
||||
|
||||
IF (NOT WIN32)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# 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})
|
||||
|
||||
foreach(comp ${comps})
|
||||
_xcb_handle_component(${comp})
|
||||
endforeach()
|
||||
|
||||
if(XCB_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(XCB DEFAULT_MSG XCB_LIBRARIES XCB_INCLUDE_DIRS ${requiredComponents})
|
||||
|
||||
# compatibility for old variable naming
|
||||
set(XCB_INCLUDE_DIR ${XCB_INCLUDE_DIRS})
|
||||
|
||||
ENDIF (NOT WIN32)
|
||||
68
cmake/Modules/FindZLIB.cmake
Normal file
68
cmake/Modules/FindZLIB.cmake
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
# Once done these will be defined:
|
||||
#
|
||||
# ZLIB_FOUND
|
||||
# ZLIB_INCLUDE_DIRS
|
||||
# ZLIB_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# ZLIB_INCLUDE_DIR
|
||||
|
||||
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()
|
||||
65
cmake/Modules/IDLFileHelper.cmake
Normal file
65
cmake/Modules/IDLFileHelper.cmake
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
macro(add_idl_files generated_files)
|
||||
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})
|
||||
|
||||
if(MSVC)
|
||||
add_custom_command(
|
||||
OUTPUT ${bin_file_h} ${bin_file_c}
|
||||
DEPENDS ${filename}
|
||||
COMMAND midl /h ${file_h} /iid ${file_c} /notlb ${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})
|
||||
|
||||
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()
|
||||
|
||||
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()
|
||||
|
||||
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_source_files_properties(${filename}
|
||||
PROPERTIES
|
||||
HEADER_FILE_ONLY TRUE)
|
||||
endforeach(filename ${ARGN})
|
||||
endmacro(add_idl_files)
|
||||
90
cmake/Modules/ObsCpack.cmake
Normal file
90
cmake/Modules/ObsCpack.cmake
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
|
||||
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_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()
|
||||
|
||||
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)
|
||||
544
cmake/Modules/ObsHelpers.cmake
Normal file
544
cmake/Modules/ObsHelpers.cmake
Normal file
|
|
@ -0,0 +1,544 @@
|
|||
set(OBS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/rundir")
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
set(_struct_def FALSE)
|
||||
else()
|
||||
set(_struct_def TRUE)
|
||||
endif()
|
||||
|
||||
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()
|
||||
|
||||
if(INSTALLER_RUN AND NOT DEFINED ENV{obsInstallerTempDir})
|
||||
message(FATAL_ERROR "Environment variable obsInstallerTempDir is needed for multiarch installer generation")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{obsInstallerTempDir})
|
||||
file(TO_CMAKE_PATH "$ENV{obsInstallerTempDir}" ENV{obsInstallerTempDir})
|
||||
endif()
|
||||
|
||||
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 "../")
|
||||
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 "../../")
|
||||
endif()
|
||||
set(OBS_CMAKE_DESTINATION "cmake")
|
||||
set(OBS_INCLUDE_DESTINATION "include")
|
||||
set(OBS_UNIX_STRUCTURE "0")
|
||||
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")
|
||||
endif()
|
||||
|
||||
function(obs_finish_bundle)
|
||||
if(NOT APPLE OR UNIX_STRUCTURE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
install(CODE
|
||||
"if(DEFINED ENV{FIXUP_BUNDLE})
|
||||
execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/cmake/osxbundle/fixup_bundle.sh\" . bin WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}\")
|
||||
endif()")
|
||||
endfunction()
|
||||
|
||||
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)
|
||||
endfunction()
|
||||
|
||||
function(obs_install_additional maintarget)
|
||||
set(addfdir "${CMAKE_SOURCE_DIR}/additional_install_files")
|
||||
if(DEFINED ENV{obsAdditionalInstallFiles})
|
||||
set(addfdir "$ENV{obsAdditionalInstallFiles}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
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}/")
|
||||
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}")
|
||||
|
||||
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}")
|
||||
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()
|
||||
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)
|
||||
endfunction()
|
||||
|
||||
function(install_obs_pdb ttype target)
|
||||
if(NOT MSVC)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_bit_suffix "64bit")
|
||||
else()
|
||||
set(_bit_suffix "32bit")
|
||||
endif()
|
||||
|
||||
obs_debug_copy_helper(${target} "${CMAKE_CURRENT_BINARY_DIR}/pdbs")
|
||||
|
||||
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()
|
||||
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()
|
||||
|
||||
if("${ARGV1}" STREQUAL "EXPORT")
|
||||
export_obs_core("${target}" "${ARGV2}")
|
||||
else()
|
||||
install(TARGETS ${target}
|
||||
LIBRARY DESTINATION "${OBS_LIBRARY_DESTINATION}"
|
||||
RUNTIME DESTINATION "${OBS_EXECUTABLE_DESTINATION}")
|
||||
endif()
|
||||
|
||||
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)
|
||||
|
||||
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()
|
||||
|
||||
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()
|
||||
|
||||
install_obs_pdb(CORE ${target})
|
||||
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()
|
||||
|
||||
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_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()
|
||||
endfunction()
|
||||
|
||||
function(install_obs_plugin_with_data target datadir)
|
||||
install_obs_plugin(${target})
|
||||
install_obs_data(${target} "${datadir}" "obs-plugins/${target}")
|
||||
endfunction()
|
||||
|
||||
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()
|
||||
endfunction()
|
||||
43
cmake/Modules/WIX.template.in
Normal file
43
cmake/Modules/WIX.template.in
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue