f8ad551f92c77108b66c83907e5063cb426382c1
[project/uclient.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 INCLUDE(CheckIncludeFiles)
4
5 PROJECT(uclient C)
6 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
7
8 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
9
10 IF(APPLE)
11   INCLUDE_DIRECTORIES(/opt/local/include)
12   LINK_DIRECTORIES(/opt/local/lib)
13 ENDIF()
14
15 ADD_LIBRARY(uclient SHARED uclient.c uclient-http.c uclient-utils.c)
16 TARGET_LINK_LIBRARIES(uclient ubox dl)
17
18 ADD_EXECUTABLE(uclient-fetch uclient-fetch.c)
19 TARGET_LINK_LIBRARIES(uclient-fetch uclient)
20
21 INSTALL(FILES uclient.h uclient-utils.h
22         DESTINATION include/libubox
23 )
24 INSTALL(TARGETS uclient
25         LIBRARY DESTINATION lib
26 )