Commit e7413143 authored by Ghislain MARY's avatar Ghislain MARY

Restore possibility to build as static library (needed for the Python module).

parent 246152ef
......@@ -24,6 +24,10 @@ cmake_minimum_required(VERSION 3.0)
project(MSWASAPI CXX)
option(ENABLE_SHARED "Build shared library." YES)
option(ENABLE_STATIC "Build static library." YES)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_ms2_CONFIG_DIR}/Mediastreamer2Config.cmake")
else()
......@@ -48,21 +52,32 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
list(APPEND LIBS phoneaudioses)
endif()
add_library(mswasapi MODULE ${SOURCE_FILES})
set_target_properties(mswasapi PROPERTIES PREFIX "lib")
target_link_libraries(mswasapi ${LIBS})
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set_target_properties(mswasapi PROPERTIES VS_WINRT_COMPONENT TRUE)
if(ENABLE_STATIC)
add_library(mswasapi-static STATIC ${SOURCE_FILES})
set_target_properties(mswasapi-static PROPERTIES OUTPUT_NAME mswasapi)
target_link_libraries(mswasapi-static ${LIBS})
install(TARGETS mswasapi-static
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/libmswasapi.pdb
DESTINATION bin
if(ENABLE_SHARED)
add_library(mswasapi MODULE ${SOURCE_FILES})
set_target_properties(mswasapi PROPERTIES PREFIX "lib")
target_link_libraries(mswasapi ${LIBS})
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set_target_properties(mswasapi PROPERTIES VS_WINRT_COMPONENT TRUE)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/libmswasapi.pdb
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
install(TARGETS mswasapi
RUNTIME DESTINATION lib/mediastreamer/plugins
LIBRARY DESTINATION lib/mediastreamer/plugins
ARCHIVE DESTINATION lib/mediastreamer/plugins
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
install(TARGETS mswasapi
RUNTIME DESTINATION lib/mediastreamer/plugins
LIBRARY DESTINATION lib/mediastreamer/plugins
ARCHIVE DESTINATION lib/mediastreamer/plugins
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
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