2017-10-05 20:56:49 +08:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
|
|
|
|
|
|
|
project(librtmp C)
|
|
|
|
|
2018-03-16 15:32:44 +08:00
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
find_package(OpenSSL REQUIRED)
|
2017-10-05 20:56:49 +08:00
|
|
|
|
|
|
|
include_directories(${ZLIB_INCLUDE_DIRS})
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
set(CMAKE_DEBUG_POSTFIX "d")
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
|
|
|
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
|
|
|
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_definitions(-DLIBRTMP_ONLY)
|
|
|
|
|
|
|
|
# List the header files
|
|
|
|
set(HEADERS librtmp/amf.h
|
|
|
|
librtmp/bytes.h
|
|
|
|
librtmp/dh.h
|
|
|
|
librtmp/dhgroups.h
|
|
|
|
librtmp/handshake.h
|
|
|
|
librtmp/http.h
|
|
|
|
librtmp/log.h
|
|
|
|
librtmp/rtmp.h
|
|
|
|
librtmp/rtmp_sys.h
|
|
|
|
)
|
|
|
|
|
|
|
|
# List the source files
|
|
|
|
set(SRCS librtmp/amf.c
|
|
|
|
librtmp/hashswf.c
|
|
|
|
librtmp/log.c
|
|
|
|
librtmp/parseurl.c
|
|
|
|
librtmp/rtmp.c
|
|
|
|
)
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
set(SRCS_MSVC "librtmp/librtmp.def")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(librtmp ${SRCS} ${HEADERS} ${SRCS_MSVC})
|
|
|
|
|
|
|
|
target_include_directories(librtmp PRIVATE ./librtmp)
|
|
|
|
target_link_libraries(librtmp PRIVATE ${ZLIB_LIBRARIES} ${OPENSSL_LIBRARIES})
|
|
|
|
target_link_libraries(librtmp PRIVATE Ws2_32.lib Winmm.lib)
|
|
|
|
|
|
|
|
install(TARGETS librtmp
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib)
|
|
|
|
|
2018-01-09 04:12:37 +08:00
|
|
|
install(DIRECTORY ${PROJECT_SOURCE_DIR}/librtmp DESTINATION include FILES_MATCHING PATTERN "*.h")
|