2019-05-20 11:22:59 +08:00
|
|
|
|
include_directories(../3rdpart)
|
|
|
|
|
file(GLOB jsoncpp_src_list ../3rdpart/jsoncpp/*.cpp ../3rdpart/jsoncpp/*.h )
|
|
|
|
|
add_library(jsoncpp STATIC ${jsoncpp_src_list})
|
2020-01-07 14:37:18 +08:00
|
|
|
|
file(GLOB MediaServer_src_list ./*.cpp ./*.h)
|
2020-12-29 11:36:06 +08:00
|
|
|
|
|
2022-06-19 01:12:14 +08:00
|
|
|
|
if (ENABLE_SERVER_LIB)
|
|
|
|
|
add_definitions(-DDISABLE_MAIN)
|
|
|
|
|
add_library(MediaServer STATIC ${MediaServer_src_list})
|
|
|
|
|
list(APPEND LINK_LIB_LIST MediaServer jsoncpp)
|
|
|
|
|
set(LINK_LIB_LIST ${LINK_LIB_LIST} PARENT_SCOPE)
|
|
|
|
|
return()
|
|
|
|
|
endif ()
|
|
|
|
|
|
2019-05-20 11:22:59 +08:00
|
|
|
|
add_executable(MediaServer ${MediaServer_src_list})
|
2019-06-15 17:07:10 +08:00
|
|
|
|
|
2021-06-29 17:44:35 +08:00
|
|
|
|
if(MSVC)
|
2019-06-15 17:07:10 +08:00
|
|
|
|
set_target_properties(MediaServer PROPERTIES COMPILE_FLAGS ${VS_FALGS} )
|
2020-12-17 19:43:17 +08:00
|
|
|
|
else()
|
|
|
|
|
install(TARGETS MediaServer DESTINATION ${INSTALL_PATH_EXECUTABLE})
|
2019-06-15 17:07:10 +08:00
|
|
|
|
endif()
|
|
|
|
|
|
2021-04-11 11:53:05 +08:00
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
2021-04-11 11:44:16 +08:00
|
|
|
|
target_link_libraries(MediaServer -Wl,--start-group jsoncpp ${LINK_LIB_LIST} -Wl,--end-group)
|
2021-04-11 11:53:05 +08:00
|
|
|
|
else ()
|
|
|
|
|
target_link_libraries(MediaServer jsoncpp ${LINK_LIB_LIST})
|
2021-04-11 11:44:16 +08:00
|
|
|
|
endif ()
|