Commit b788b202 authored by Nicolas Michon's avatar Nicolas Michon

Cmake changes for cross-compilation and better use of imported targets

parent 1c1abd7d
......@@ -20,12 +20,19 @@
#
############################################################################
cmake_minimum_required(VERSION 3.0)
project(MSWINRTVID CXX)
cmake_minimum_required(VERSION 3.12.4)
set(CMAKE_CROSSCOMPILING "YES")
set(CMAKE_SYSTEM_NAME "WindowsStore")
set(CMAKE_SYSTEM_VERSION "10.0")
set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD "TRUE")
project(MSWINRTVID CXX)
option(ENABLE_STRICT "Build with strict compile options." YES)
# We need to redefine _WIN32_WINNT to use Windows 10 Function
add_compile_definitions(_WIN32_WINNT=0x0A00 _ALLOW_KEYWORD_MACROS)
macro(apply_compile_flags SOURCE_FILES)
if(${SOURCE_FILES})
......@@ -42,23 +49,9 @@ macro(apply_compile_flags SOURCE_FILES)
endif()
endmacro()
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake")
else()
find_package(BcToolbox REQUIRED)
endif()
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_ortp_CONFIG_DIR}/ORTPConfig.cmake")
else()
find_package(ORTP REQUIRED)
endif()
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_ms2_CONFIG_DIR}/Mediastreamer2Config.cmake")
else()
find_package(Mediastreamer2 REQUIRED)
endif()
find_package(bctoolbox CONFIG REQUIRED)
find_package(ortp CONFIG REQUIRED)
find_package(Mediastreamer2 CONFIG REQUIRED)
include_directories(
${MEDIASTREAMER2_INCLUDE_DIRS}
......@@ -110,8 +103,8 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
)
endif()
set_target_properties(mswinrtvid PROPERTIES PREFIX "lib")
set_target_properties(mswinrtvid PROPERTIES VS_WINRT_COMPONENT TRUE)
target_link_libraries(mswinrtvid ${LIBS})
set_target_properties(mswinrtvid PROPERTIES VS_WINRT_COMPONENT TRUE)
install(TARGETS mswinrtvid
RUNTIME DESTINATION lib/mediastreamer/plugins
......
......@@ -31,8 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <vector>
#ifdef MS2_WINDOWS_UNIVERSAL
#include <agile.h>
typedef struct WinRTWebcam {
......@@ -41,7 +39,6 @@ typedef struct WinRTWebcam {
bool_t external;
bool_t front;
} WinRTWebcam;
#endif
template <class T> class RefToPtrProxy
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment