enable evas renderer except wearable/tv profile
[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 (EVAS_RENDERER_SUPPORT)
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")
21 ELSE (EVAS_RENDERER_SUPPORT)
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")
23 ENDIF (EVAS_RENDERER_SUPPORT)
24 SET(pc_dependents "libtbm capi-media-tool capi-base-common capi-media-sound-manager")
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(WAYLAND_SUPPORT)
45  ADD_DEFINITIONS("-DHAVE_WAYLAND")
46 ENDIF(WAYLAND_SUPPORT)
47 IF(X11_SUPPORT)
48  ADD_DEFINITIONS("-DHAVE_X11")
49 ENDIF(X11_SUPPORT)
50 IF (EVAS_RENDERER_SUPPORT)
51  ADD_DEFINITIONS("-DEVAS_RENDERER_SUPPORT")
52 ENDIF(EVAS_RENDERER_SUPPORT)
53
54 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
55 ADD_DEFINITIONS("-DTIZEN_DEBUG")
56
57 IF (TIZEN_TV)
58 ADD_DEFINITIONS("-DTIZEN_TV")
59 ENDIF(TIZEN_TV)
60
61 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
62
63 aux_source_directory(src SOURCES)
64 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
65
66 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
67
68 SET_TARGET_PROPERTIES(${fw_name}
69      PROPERTIES
70      VERSION ${FULLVER}
71      SOVERSION ${MAJORVER}
72      CLEAN_DIRECT_OUTPUT 1
73 )
74
75 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
76 INSTALL(
77         DIRECTORY ${INC_DIR}/ DESTINATION include/media
78         FILES_MATCHING
79         PATTERN "*_private.h" EXCLUDE
80         PATTERN "${INC_DIR}/*.h"
81         )
82
83 SET(PC_NAME ${fw_name})
84 SET(PC_REQUIRED ${pc_dependents})
85 SET(PC_LDFLAGS -l${fw_name})
86 SET(PC_CFLAGS -I\${includedir}/media)
87
88 CONFIGURE_FILE(
89     ${fw_name}.pc.in
90     ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
91     @ONLY
92 )
93 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
94
95 ADD_SUBDIRECTORY(test)
96
97 IF(UNIX)
98
99 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
100 ADD_CUSTOM_COMMAND(
101         DEPENDS clean
102         COMMENT "distribution clean"
103         COMMAND find
104         ARGS    .
105         -not -name config.cmake -and \(
106         -name tester.c -or
107         -name Testing -or
108         -name CMakeFiles -or
109         -name cmake.depends -or
110         -name cmake.check_depends -or
111         -name CMakeCache.txt -or
112         -name cmake.check_cache -or
113         -name *.cmake -or
114         -name Makefile -or
115         -name core -or
116         -name core.* -or
117         -name gmon.out -or
118         -name install_manifest.txt -or
119         -name *.pc -or
120         -name *~ \)
121         | grep -v TC | xargs rm -rf
122         TARGET  distclean
123         VERBATIM
124 )
125
126 ENDIF(UNIX)
127