1 cmake_minimum_required(VERSION 2.6)
3 INCLUDE(CheckIncludeFiles)
6 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
8 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
10 FIND_PATH(ubox_include_dir libubox/ustream-ssl.h)
11 INCLUDE_DIRECTORIES(${ubox_include_dir})
14 FIND_LIBRARY(ubox_library NAMES ubox.a)
16 FIND_LIBRARY(ubox_library NAMES ubox)
19 ADD_LIBRARY(uclient SHARED uclient.c uclient-http.c uclient-utils.c)
20 TARGET_LINK_LIBRARIES(uclient ${ubox_library} dl)
22 ADD_EXECUTABLE(uclient-fetch uclient-fetch.c progress.c)
23 TARGET_LINK_LIBRARIES(uclient-fetch uclient)
25 INSTALL(FILES uclient.h uclient-utils.h
26 DESTINATION include/libubox
28 INSTALL(TARGETS uclient uclient-fetch
29 LIBRARY DESTINATION lib
30 RUNTIME DESTINATION bin