mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 02:34:26 +08:00
添加对mac的支持
This commit is contained in:
parent
1a6840d3be
commit
a4233bdeb8
@ -23,7 +23,7 @@ endforeach(SUB_DIR ${SUB_DIR_LIST})
|
||||
|
||||
|
||||
#查找openssl是否安装
|
||||
find_package(OpenSSL QUIET)
|
||||
find_package(OPENSSL QUIET)
|
||||
if(OPENSSL_FOUND)
|
||||
message(STATUS "找到openssl库:\"${OPENSSL_INCLUDE_DIR}\",ENABLE_OPENSSL宏已打开")
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
@ -90,6 +90,37 @@ if(NOT IOS)
|
||||
add_library(${CMAKE_PROJECT_NAME}_shared SHARED ${SRC_LIST})
|
||||
set_target_properties(${CMAKE_PROJECT_NAME}_shared PROPERTIES OUTPUT_NAME "${CMAKE_PROJECT_NAME}")
|
||||
install(TARGETS ${CMAKE_PROJECT_NAME}_shared LIBRARY DESTINATION lib)
|
||||
|
||||
#查找mp4v2是否安装
|
||||
if(MP4V2_FOUND)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME}_shared ${MP4V2_LIBRARY})
|
||||
endif(MP4V2_FOUND)
|
||||
|
||||
#查找x264是否安装
|
||||
if(X264_FOUND)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME}_shared ${X264_LIBRARIES})
|
||||
endif(X264_FOUND)
|
||||
|
||||
#查找faac是否安装
|
||||
if(FAAC_FOUND)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME}_shared ${FAAC_LIBRARY})
|
||||
endif(FAAC_FOUND)
|
||||
|
||||
#查找ZLToolKit是否安装
|
||||
if(ZLTOOLKIT_FOUND)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME}_shared ${ZLTOOLKIT_LIBRARY})
|
||||
endif(ZLTOOLKIT_FOUND)
|
||||
|
||||
#查找openssl是否安装
|
||||
if(OPENSSL_FOUND)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME}_shared ${OPENSSL_LIBRARYS})
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
#查找mysql是否安装
|
||||
if(MYSQL_FOUND)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME}_shared ${MYSQL_LIBRARYS})
|
||||
endif(MYSQL_FOUND)
|
||||
|
||||
endif(NOT IOS)
|
||||
|
||||
#编译静态库
|
||||
|
@ -31,7 +31,7 @@ class Mp4Info
|
||||
public:
|
||||
time_t ui64StartedTime; //GMT标准时间,单位秒
|
||||
time_t ui64TimeLen;//录像长度,单位秒
|
||||
__off_t ui64FileSize;//文件大小,单位BYTE
|
||||
off_t ui64FileSize;//文件大小,单位BYTE
|
||||
string strFilePath;//文件路径
|
||||
string strFileName;//文件名称
|
||||
string strFolder;//文件夹路径
|
||||
|
@ -39,37 +39,37 @@ target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_shared pthread)
|
||||
|
||||
#查找mp4v2是否安装
|
||||
if(MP4V2_FOUND)
|
||||
target_link_libraries(${TEST_EXE_NAME} mp4v2)
|
||||
target_link_libraries(${TEST_EXE_NAME} ${MP4V2_LIBRARY})
|
||||
endif(MP4V2_FOUND)
|
||||
|
||||
#查找x264是否安装
|
||||
if(X264_FOUND)
|
||||
target_link_libraries(${TEST_EXE_NAME} x264)
|
||||
target_link_libraries(${TEST_EXE_NAME} ${X264_LIBRARIES})
|
||||
endif(X264_FOUND)
|
||||
|
||||
#查找faac是否安装
|
||||
if(FAAC_FOUND)
|
||||
target_link_libraries(${TEST_EXE_NAME} faac)
|
||||
target_link_libraries(${TEST_EXE_NAME} ${FAAC_LIBRARY})
|
||||
endif(FAAC_FOUND)
|
||||
|
||||
#查找ZLToolKit是否安装
|
||||
if(ZLTOOLKIT_FOUND)
|
||||
target_link_libraries(${TEST_EXE_NAME} ZLToolKit)
|
||||
target_link_libraries(${TEST_EXE_NAME} ${ZLTOOLKIT_LIBRARY})
|
||||
endif(ZLTOOLKIT_FOUND)
|
||||
|
||||
#查找openssl是否安装
|
||||
if(OPENSSL_FOUND)
|
||||
target_link_libraries(${TEST_EXE_NAME} ssl)
|
||||
target_link_libraries(${TEST_EXE_NAME} ${OPENSSL_LIBRARYS})
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
#查找mysql是否安装
|
||||
if(MYSQL_FOUND)
|
||||
target_link_libraries(${TEST_EXE_NAME} mysqlclient)
|
||||
target_link_libraries(${TEST_EXE_NAME} ${MYSQL_LIBRARYS})
|
||||
endif(MYSQL_FOUND)
|
||||
|
||||
#link test_player
|
||||
if(TEST_EXE_NAME STREQUAL test_player)
|
||||
target_link_libraries(${TEST_EXE_NAME} SDL avcodec avutil)
|
||||
target_link_libraries(${TEST_EXE_NAME} ${SDL_LIBRARY} ${AVCODEC_LIBRARIES} ${AVUTIL_LIBRARIES})
|
||||
endif(TEST_EXE_NAME STREQUAL test_player)
|
||||
|
||||
endforeach(TEST_SRC ${TEST_SRC_LIST})
|
||||
|
@ -30,7 +30,7 @@ class H264Decoder
|
||||
public:
|
||||
H264Decoder(void){
|
||||
avcodec_register_all();
|
||||
AVCodec *pCodec = avcodec_find_decoder(CODEC_ID_H264);
|
||||
AVCodec *pCodec = avcodec_find_decoder(AV_CODEC_ID_H264);
|
||||
if (!pCodec) {
|
||||
throw std::runtime_error("未找到H264解码器");
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ void programExit(int arg) {
|
||||
EventPoller::Instance().shutdown();
|
||||
}
|
||||
int main(int argc,char *argv[]){
|
||||
setExePath(argv[0]);
|
||||
signal(SIGINT, programExit);
|
||||
Logger::Instance().add(std::make_shared<ConsoleChannel>("stdout", LTrace));
|
||||
Config::loaIniConfig();
|
||||
|
Loading…
Reference in New Issue
Block a user