[v0.3.31] add network feature check of streaming related APIs
[platform/core/api/player.git] / CMakeLists.txt
1
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 SET(fw_name "capi-media-player")
4
5 PROJECT(${fw_name})
6
7 SET(CMAKE_INSTALL_PREFIX /usr)
8 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
9
10 IF (TIZEN_WEARABLE)
11 SET(INC_DIR include/wearable)
12 ELSE (TIZEN_WEARABLE)
13 SET(INC_DIR include/common)
14 ENDIF (TIZEN_WEARABLE)
15
16 SET(INC_COM_DIR include)
17
18 INCLUDE_DIRECTORIES(${INC_DIR}, ${INC_COM_DIR})
19 IF (TIZEN_FEATURE_EVAS_RENDERER)
20 SET(dependents "dlog glib-2.0 libtbm capi-media-tool capi-media-sound-manager capi-base-common mused mm-common tizen-extension-client evas ecore elementary mm-evas-renderer storage capi-system-info")
21 ELSE (TIZEN_FEATURE_EVAS_RENDERER)
22 SET(dependents "dlog glib-2.0 libtbm capi-media-tool capi-media-sound-manager capi-base-common mused mm-common tizen-extension-client evas ecore elementary storage capi-system-info")
23 ENDIF (TIZEN_FEATURE_EVAS_RENDERER)
24 SET(pc_dependents "libtbm capi-media-tool capi-base-common capi-media-sound-manager ecore-wayland")
25
26 INCLUDE(FindPkgConfig)
27 pkg_check_modules(${fw_name} REQUIRED ${dependents})
28 FOREACH(flag ${${fw_name}_CFLAGS})
29     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
30 ENDFOREACH(flag)
31
32 pkg_check_modules(MMSVC_PLAYER mmsvc-player)
33 FOREACH(mmsvcflag ${MMSVC_PLAYER_CFLAGS})
34     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${mmsvcflag}")
35 ENDFOREACH(mmsvcflag)
36
37 SET(CMAKE_C_FLAGS "-I./${INC_DIR} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -Wno-deprecated -Wno-deprecated-declarations")
38 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
39
40 IF("${ARCH}" STREQUAL "arm")
41     ADD_DEFINITIONS("-DTARGET")
42 ENDIF("${ARCH}" STREQUAL "arm")
43
44 IF (TIZEN_FEATURE_EVAS_RENDERER)
45  ADD_DEFINITIONS("-DTIZEN_FEATURE_EVAS_RENDERER")
46 ENDIF(TIZEN_FEATURE_EVAS_RENDERER)
47
48 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
49 ADD_DEFINITIONS("-DTIZEN_DEBUG")
50
51 IF (TIZEN_TV)
52 ADD_DEFINITIONS("-DTIZEN_TV")
53 ENDIF(TIZEN_TV)
54
55 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
56
57 aux_source_directory(src SOURCES)
58 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
59
60 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
61
62 SET_TARGET_PROPERTIES(${fw_name}
63      PROPERTIES
64      VERSION ${FULLVER}
65      SOVERSION ${MAJORVER}
66      CLEAN_DIRECT_OUTPUT 1
67 )
68
69 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
70 INSTALL(
71         DIRECTORY ${INC_DIR}/ DESTINATION include/media
72         FILES_MATCHING
73         PATTERN "*_private.h" EXCLUDE
74         PATTERN "${INC_DIR}/*.h"
75         )
76
77 SET(PC_NAME ${fw_name})
78 SET(PC_REQUIRED ${pc_dependents})
79 SET(PC_LDFLAGS -l${fw_name})
80 SET(PC_CFLAGS -I\${includedir}/media)
81
82 CONFIGURE_FILE(
83     ${fw_name}.pc.in
84     ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
85     @ONLY
86 )
87 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
88
89 ADD_SUBDIRECTORY(test)
90
91 IF(UNIX)
92
93 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
94 ADD_CUSTOM_COMMAND(
95         DEPENDS clean
96         COMMENT "distribution clean"
97         COMMAND find
98         ARGS    .
99         -not -name config.cmake -and \(
100         -name tester.c -or
101         -name Testing -or
102         -name CMakeFiles -or
103         -name cmake.depends -or
104         -name cmake.check_depends -or
105         -name CMakeCache.txt -or
106         -name cmake.check_cache -or
107         -name *.cmake -or
108         -name Makefile -or
109         -name core -or
110         -name core.* -or
111         -name gmon.out -or
112         -name install_manifest.txt -or
113         -name *.pc -or
114         -name *~ \)
115         | grep -v TC | xargs rm -rf
116         TARGET  distclean
117         VERBATIM
118 )
119
120 ENDIF(UNIX)
121