obs-studio/obs/CMakeLists.txt

58 lines
1.4 KiB
CMake
Raw Normal View History

2013-11-14 08:25:36 -08:00
find_package(wxWidgets COMPONENTS core base REQUIRED)
include("${wxWidgets_USE_FILE}")
function(wx_required_version)
include(CheckCXXSourceCompiles)
set(WX_CHECK_DEFINITIONS "")
foreach(wxw_def ${wxWidgets_DEFINITIONS})
set(WX_CHECK_DEFINITIONS "${WX_CHECK_DEFINITIONS} -D${wxw_def}")
endforeach()
set(CMAKE_REQUIRED_DEFINITIONS ${WX_CHECK_DEFINITIONS})
set(CMAKE_REQUIRED_INCLUDES ${wxWidgets_INCLUDE_DIRS})
set(CMAKE_REQUIRED_FLAGS ${wxWidgets_CXX_FLAGS})
2013-11-14 08:25:36 -08:00
check_cxx_source_compiles("
#include <wx/sysopt.h>
#if (wxMINOR_VERSION < 9 && wxMAJOR_VERSION <= 2) || wxMAJOR_VERSION < 3
#error
#endif
int main() {}"
WX_REQUIRED_VERSION)
if(NOT WX_REQUIRED_VERSION)
message(SEND_ERROR "wxWidgets version 2.9 or later is required")
endif()
endfunction()
wx_required_version()
include_directories(SYSTEM ${obs_SOURCE_DIR}/libobs)
2013-11-14 08:25:36 -08:00
link_libraries(${wxWidgets_LIBRARIES} libobs)
2013-11-14 08:25:36 -08:00
if(WIN32)
set(obs_platform_src
platform-windows.cpp)
elseif(APPLE)
set(obs_platform_src
2013-12-16 07:04:51 -08:00
platform-osx.mm)
elseif(UNIX)
set(obs_platform_src
platform-nix.cpp)
endif()
2013-11-14 08:25:36 -08:00
add_executable(obs
window-main-basic.cpp
2013-12-10 20:14:20 -08:00
window-settings-basic.cpp
settings-basic-general.cpp
settings-basic-video.cpp
wx-subclass.cpp
2013-11-22 19:57:24 -08:00
wx-wrappers.cpp
2013-11-22 15:24:54 -08:00
obs-app.cpp
forms/OBSWindows.cpp
${obs_platform_src})
2013-11-14 08:25:36 -08:00
if(APPLE)
set_target_properties(obs PROPERTIES
MACOSX_BUNDLE ${BUILD_APP_BUNDLE})
endif()