rtspReceive/CMakeLists.txt

59 lines
2.1 KiB
CMake
Raw Permalink Normal View History

2024-03-21 16:23:30 +08:00
cmake_minimum_required(VERSION 3.7)
2024-03-22 08:39:37 +08:00
set(PROJECT_NAME rtspReceive)
#project(${PROJECT_NAME})
project(${PROJECT_NAME})
2024-03-21 16:23:30 +08:00
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
add_definitions(-DLIVEMEDIA_API=)
add_definitions(-DNO_OPENSSL=1)
2024-03-22 08:39:37 +08:00
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg)
2024-03-21 16:23:30 +08:00
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/includes)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/includes/rtc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/includes/nlohmann)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/includes/nlohmann/detail)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/includes/nlohmann/thirdparty)
2024-03-22 08:39:37 +08:00
# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg/ffmpeg)
# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg/ffmpeg/libavcodec)
# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg/ffmpeg/libavformat)
# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg/ffmpeg/libavutil)
2024-03-21 16:23:30 +08:00
set(LIBS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs)
# static
link_directories(${LIBS_PATH})
# for datachannel
link_libraries(datachannel)
link_libraries(json)
# for ffmpeg
2024-03-22 08:39:37 +08:00
link_libraries(ffmpeg)
# link_libraries(avcodec)
# link_libraries(avformat)
# link_libraries(avutil)
2024-03-21 16:23:30 +08:00
aux_source_directory(./src DIR_SRCS)
add_executable(${PROJECT_NAME} ${DIR_SRCS})
# shared
2024-03-22 08:39:37 +08:00
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} Threads::Threads)
target_link_libraries(${PROJECT_NAME} ws2_32)
2024-03-21 16:23:30 +08:00
# Copy dll to run dir.
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/libs/datachannel.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
2024-03-22 08:39:37 +08:00
#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/libs/ffmpeg/avcodec-60.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/libs/ffmpeg/avformat-60.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/libs/ffmpeg/avutil-58.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/libs/ffmpeg/postproc-57.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/libs/ffmpeg/swresample-4.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR})