2014-02-02 06:16:40 -08:00
|
|
|
if(WIN32 OR APPLE)
|
2014-01-24 14:16:55 -08:00
|
|
|
cmake_minimum_required(VERSION 2.8.12)
|
|
|
|
else()
|
|
|
|
cmake_minimum_required(VERSION 2.8.11)
|
|
|
|
endif()
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
project(obs-studio)
|
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
|
|
|
|
2014-01-24 18:44:34 -08:00
|
|
|
include(ObsHelpers)
|
2014-01-29 05:56:06 -08:00
|
|
|
include(ObsCpack)
|
|
|
|
|
|
|
|
add_definitions(-DOBS_VERSION="${OBS_VERSION}")
|
2014-01-24 18:44:34 -08:00
|
|
|
|
2014-01-30 16:59:22 -08:00
|
|
|
if(MSVC AND NOT EXISTS "${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.user")
|
|
|
|
file(GENERATE
|
|
|
|
OUTPUT "${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.user"
|
|
|
|
INPUT "${CMAKE_SOURCE_DIR}/cmake/ALL_BUILD.vcxproj.user.in")
|
2014-01-20 07:58:58 -08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE RelWithDebInfo)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(CXX11 REQUIRED)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAGS}")
|
|
|
|
|
|
|
|
if(${CMAKE_C_COMPILER_ID} MATCHES "Clang" OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
|
|
|
set(CMAKE_COMPILER_IS_CLANG TRUE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
|
2014-02-14 14:13:36 -08:00
|
|
|
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-function ${CMAKE_CXX_FLAGS}")
|
|
|
|
set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-function -Wno-missing-field-initializers ${CMAKE_C_FLAGS} -std=gnu99")
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
option(USE_LIBC++ "Use libc++ instead of libstdc++" ${APPLE})
|
|
|
|
if(USE_LIBC++)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
add_definitions(-DUNICODE -D_UNICODE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
set(CMAKE_MACOSX_RPATH TRUE)
|
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
2014-01-27 23:43:59 -08:00
|
|
|
list(APPEND CMAKE_INSTALL_RPATH "@loader_path/" "@executable_path/")
|
|
|
|
elseif(UNIX AND NOT UNIX_STRUCTURE)
|
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
|
|
|
list(APPEND CMAKE_INSTALL_RPATH "$ORIGIN")
|
2014-01-20 07:58:58 -08:00
|
|
|
endif()
|
|
|
|
|
2014-01-24 18:44:34 -08:00
|
|
|
if(NOT INSTALLER_RUN)
|
|
|
|
add_subdirectory(deps)
|
|
|
|
add_subdirectory(libobs)
|
2014-01-20 07:58:58 -08:00
|
|
|
|
2014-01-24 18:44:34 -08:00
|
|
|
if(WIN32)
|
|
|
|
add_subdirectory(libobs-d3d11)
|
|
|
|
add_subdirectory(libobs-d3d9)
|
|
|
|
endif()
|
2014-01-20 07:58:58 -08:00
|
|
|
|
2014-01-24 18:44:34 -08:00
|
|
|
add_subdirectory(libobs-opengl)
|
|
|
|
add_subdirectory(obs)
|
|
|
|
add_subdirectory(plugins)
|
|
|
|
add_subdirectory(test)
|
|
|
|
else()
|
|
|
|
obs_generate_multiarch_installer()
|
|
|
|
endif()
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
obs_install_additional()
|