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})
|
2013-11-29 11:51:39 -08:00
|
|
|
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()
|
|
|
|
|
2013-11-29 11:51:39 -08:00
|
|
|
include_directories(SYSTEM ${obs_SOURCE_DIR}/libobs)
|
2013-11-14 08:25:36 -08:00
|
|
|
|
2013-11-29 11:51:39 -08:00
|
|
|
link_libraries(${wxWidgets_LIBRARIES} libobs)
|
2013-11-14 08:25:36 -08:00
|
|
|
|
2013-12-07 09:22:56 -08:00
|
|
|
if(WIN32)
|
|
|
|
set(obs_platform_src
|
|
|
|
platform-windows.cpp)
|
|
|
|
elseif(APPLE)
|
|
|
|
set(obs_platform_src
|
|
|
|
platform-osx.cpp)
|
|
|
|
elseif(UNIX)
|
|
|
|
set(obs_platform_src
|
|
|
|
platform-nix.cpp)
|
|
|
|
endif()
|
|
|
|
|
2013-11-14 08:25:36 -08:00
|
|
|
add_executable(obs
|
2013-12-06 08:18:47 -08:00
|
|
|
window-main-basic.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
|
2013-12-07 09:22:56 -08:00
|
|
|
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()
|