2017-10-05 15:56:49 +03:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
|
|
|
|
|
|
|
project(librtmp C)
|
|
|
|
|
2018-03-16 16:32:44 +09:00
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
find_package(OpenSSL REQUIRED)
|
2017-10-05 15:56:49 +03: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")
|
2022-04-06 20:04:46 +02:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996")
|
2017-10-05 15:56:49 +03:00
|
|
|
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-08 22:12:37 +02:00
|
|
|
install(DIRECTORY ${PROJECT_SOURCE_DIR}/librtmp DESTINATION include FILES_MATCHING PATTERN "*.h")
|