update bug patch
[framework/api/media-content.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 SET(fw_name "capi-content-media-content")
3
4 PROJECT(${fw_name})
5
6 SET(CMAKE_INSTALL_PREFIX /usr)
7 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
8
9 SET(INC_DIR include)
10 INCLUDE_DIRECTORIES(${INC_DIR})
11
12 SET(dependents "dlog libmedia-service media-thumbnail libmedia-utils capi-base-common")
13 SET(pc_dependents "dlog capi-base-common")
14
15 INCLUDE(FindPkgConfig)
16 pkg_check_modules(${fw_name} REQUIRED ${dependents})
17 FOREACH(flag ${${fw_name}_CFLAGS})
18     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
19 ENDFOREACH(flag)
20
21 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
22 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
23
24 IF("${ARCH}" STREQUAL "arm")
25     ADD_DEFINITIONS("-DTARGET")
26 ENDIF("${ARCH}" STREQUAL "arm")
27
28 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
29 ADD_DEFINITIONS("-DTIZEN_DEBUG")
30
31 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
32
33 aux_source_directory(src SOURCES)
34 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
35
36 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
37
38 SET_TARGET_PROPERTIES(${fw_name}
39      PROPERTIES
40      VERSION ${FULLVER}
41      SOVERSION ${MAJORVER}
42      CLEAN_DIRECT_OUTPUT 1
43 )
44
45 INSTALL(TARGETS ${fw_name} DESTINATION lib)
46 INSTALL(
47         DIRECTORY ${INC_DIR}/ DESTINATION include/media-content
48         FILES_MATCHING
49         PATTERN "*_private.h" EXCLUDE
50         PATTERN "${INC_DIR}/*.h"
51         )
52
53 SET(PC_NAME ${fw_name})
54 SET(PC_REQUIRED ${pc_dependents})
55 SET(PC_LDFLAGS -l${fw_name})
56
57 CONFIGURE_FILE(
58     ${fw_name}.pc.in
59     ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
60     @ONLY
61 )
62 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig)
63
64 ADD_SUBDIRECTORY(test)
65
66 IF(UNIX)
67
68 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
69 ADD_CUSTOM_COMMAND(
70         DEPENDS clean 
71         COMMENT "distribution clean"
72         COMMAND find
73         ARGS    . 
74         -not -name config.cmake -and \(
75         -name tester.c -or
76         -name Testing -or
77         -name CMakeFiles -or
78         -name cmake.depends -or
79         -name cmake.check_depends -or
80         -name CMakeCache.txt -or
81         -name cmake.check_cache -or
82         -name *.cmake -or
83         -name Makefile -or
84         -name core -or
85         -name core.* -or
86         -name gmon.out -or
87         -name install_manifest.txt -or
88         -name *.pc -or
89         -name *~ \)
90         | grep -v TC | xargs rm -rf
91         TARGET  distclean
92         VERBATIM
93 )
94
95 ENDIF(UNIX)
96