diff --git a/README.md b/README.md index c62cf3c8..c5fc66ee 100644 --- a/README.md +++ b/README.md @@ -200,13 +200,7 @@ git submodule update --init ## 编译(iOS) - 编译环境:`请参考macOS的编译指导。` -- 编译 - - ``` - cd ZLMediaKit - ./build_for_ios.sh - ``` -- 你也可以生成Xcode工程再编译,[了解更多](https://github.com/leetal/ios-cmake): +- 生成Xcode工程再编译,[了解更多](https://github.com/leetal/ios-cmake): ``` cd ZLMediaKit @@ -243,6 +237,19 @@ git submodule update --init   4 选择编译Release 版本. 5 找到目标文件并运行测试用例. ``` + +## Docker Image +You can pull a pre-built docker image from Docker Hub and run with +```bash +docker run -id -p 1935:1935 -p 8080:80 gemfield/zlmediakit +``` + +Dockerfile is also supplied to build images on Ubuntu 16.04 +```bash +cd docker +docker build -t zlmediakit . +``` + ## 使用方法 - 作为服务器: ```cpp diff --git a/README_en.md b/README_en.md index 20d908e6..d9947c01 100644 --- a/README_en.md +++ b/README_en.md @@ -176,14 +176,6 @@ git submodule update --init ``` ### Build on iOS - - This build method is no longer recommended.It is recommended that make Xcode project by yourself. - -- My environment - - Same with Build on macOS - - - You can generate Xcode projects and recompile them , [learn more](https://github.com/leetal/ios-cmake): ``` diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt index ff5db73e..9cdb0d83 100644 --- a/api/CMakeLists.txt +++ b/api/CMakeLists.txt @@ -1,24 +1,28 @@ include_directories(include source) + file(GLOB api_src_list include/*.h source/*.cpp source/*.h source/*.c) -add_library(mk_api SHARED ${api_src_list}) +if (IOS) + add_library(mk_api STATIC ${api_src_list}) + target_link_libraries(mk_api ${LINK_LIB_LIST}) +else () + add_library(mk_api SHARED ${api_src_list}) + if (WIN32) + add_definitions(-DMediaKitApi_EXPORTS) + endif () -if(WIN32) - add_definitions(-DMediaKitApi_EXPORTS) -endif() + target_link_libraries(mk_api ${LINK_LIB_LIST}) + add_subdirectory(tests) -target_link_libraries(mk_api ${LINK_LIB_LIST}) -add_subdirectory(tests) - -#安装目录 -if(WIN32) - set(INSTALL_PATH_LIB $ENV{HOME}/${CMAKE_PROJECT_NAME}/lib) - set(INSTALL_PATH_INCLUDE $ENV{HOME}/${CMAKE_PROJECT_NAME}/include) -else() - set(INSTALL_PATH_LIB lib) - set(INSTALL_PATH_INCLUDE include) -endif() - -file(GLOB api_header_list include/*.h) -install(FILES ${api_header_list} DESTINATION ${INSTALL_PATH_INCLUDE}) -install(TARGETS mk_api ARCHIVE DESTINATION ${INSTALL_PATH_LIB} LIBRARY DESTINATION ${INSTALL_PATH_LIB}) + #安装目录 + if (WIN32) + set(INSTALL_PATH_LIB $ENV{HOME}/${CMAKE_PROJECT_NAME}/lib) + set(INSTALL_PATH_INCLUDE $ENV{HOME}/${CMAKE_PROJECT_NAME}/include) + else () + set(INSTALL_PATH_LIB lib) + set(INSTALL_PATH_INCLUDE include) + endif () + file(GLOB api_header_list include/*.h) + install(FILES ${api_header_list} DESTINATION ${INSTALL_PATH_INCLUDE}) + install(TARGETS mk_api ARCHIVE DESTINATION ${INSTALL_PATH_LIB} LIBRARY DESTINATION ${INSTALL_PATH_LIB}) +endif () \ No newline at end of file diff --git a/build_for_ios.sh b/build_for_ios.sh deleted file mode 100755 index c7bf929b..00000000 --- a/build_for_ios.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -cd .. -git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit.git -cd ZLMediaKit -git submodule init -git submodule update - -mkdir -p ios_build -rm -rf ./build -ln -s ./ios_build build -cd ios_build -cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/iOS.cmake -DIOS_PLATFORM=OS -make -j4