2019-12-17 18:45:31 +08:00
|
|
|
|
include_directories(include source)
|
|
|
|
|
file(GLOB api_src_list include/*.h source/*.cpp source/*.h source/*.c)
|
2019-12-27 12:03:54 +08:00
|
|
|
|
add_library(mk_api SHARED ${api_src_list})
|
2019-12-17 18:45:31 +08:00
|
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
|
add_definitions(-DMediaKitApi_EXPORTS)
|
|
|
|
|
endif()
|
|
|
|
|
|
2019-12-27 12:03:54 +08:00
|
|
|
|
target_link_libraries(mk_api ${LINK_LIB_LIST})
|
2019-12-23 14:01:00 +08:00
|
|
|
|
add_subdirectory(tests)
|
|
|
|
|
|
2019-12-27 12:03:54 +08:00
|
|
|
|
#安装目录
|
|
|
|
|
if(WIN32)
|
|
|
|
|
set(INSTALL_PATH_LIB $ENV{HOME}/${CMAKE_PROJECT_NAME}/lib)
|
|
|
|
|
set(INSTALL_PATH_INCLUDE $ENV{HOME}/${CMAKE_PROJECT_NAME}/include)
|
|
|
|
|
else()
|
|
|
|
|
set(INSTALL_PATH_LIB lib)
|
|
|
|
|
set(INSTALL_PATH_INCLUDE include)
|
|
|
|
|
endif()
|
2019-12-17 18:45:31 +08:00
|
|
|
|
|
2019-12-27 12:03:54 +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})
|
2019-12-17 18:45:31 +08:00
|
|
|
|
|