2019-12-17 18:45:31 +08:00
|
|
|
|
include_directories(include source)
|
|
|
|
|
|
2020-02-05 23:34:51 +08:00
|
|
|
|
file(GLOB api_src_list include/*.h source/*.cpp source/*.h source/*.c)
|
2020-04-08 15:42:52 +08:00
|
|
|
|
|
2020-02-05 23:34:51 +08:00
|
|
|
|
if (IOS)
|
|
|
|
|
add_library(mk_api STATIC ${api_src_list})
|
2022-04-16 15:57:02 +08:00
|
|
|
|
target_link_libraries(mk_api ${LINK_LIB_LIST} jsoncpp)
|
2020-02-05 23:34:51 +08:00
|
|
|
|
else ()
|
2021-08-25 14:30:31 +08:00
|
|
|
|
if(ENABLE_API_STATIC_LIB)
|
2020-04-08 15:42:52 +08:00
|
|
|
|
add_library(mk_api STATIC ${api_src_list})
|
|
|
|
|
if (WIN32)
|
|
|
|
|
add_definitions(-DMediaKitApi_STATIC)
|
|
|
|
|
endif ()
|
|
|
|
|
else ()
|
|
|
|
|
add_library(mk_api SHARED ${api_src_list})
|
|
|
|
|
if (WIN32)
|
|
|
|
|
add_definitions(-DMediaKitApi_EXPORTS)
|
|
|
|
|
endif ()
|
|
|
|
|
endif()
|
2022-04-19 18:07:03 +08:00
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
|
target_link_libraries(mk_api -Wl,--start-group jsoncpp ${LINK_LIB_LIST} -Wl,--end-group)
|
|
|
|
|
else ()
|
|
|
|
|
target_link_libraries(mk_api jsoncpp ${LINK_LIB_LIST})
|
|
|
|
|
endif ()
|
2020-02-05 23:34:51 +08:00
|
|
|
|
add_subdirectory(tests)
|
2019-12-17 18:45:31 +08:00
|
|
|
|
|
2020-02-05 23:34:51 +08:00
|
|
|
|
file(GLOB api_header_list include/*.h)
|
|
|
|
|
install(FILES ${api_header_list} DESTINATION ${INSTALL_PATH_INCLUDE})
|
|
|
|
|
install(TARGETS mk_api ARCHIVE DESTINATION ${INSTALL_PATH_LIB} LIBRARY DESTINATION ${INSTALL_PATH_LIB})
|
2022-04-19 18:07:03 +08:00
|
|
|
|
endif ()
|