2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 SET(fw_name "capi-mediademuxer")
7 SET(CMAKE_INSTALL_PREFIX /usr)
8 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
11 SET(INC_PORT_GST_DIR include/port_gst)
12 SET(INC_PORT_CUSTOM_DIR include/port_custom)
13 SET(INC_PORT_FFMPEG_DIR include/port_ffmpeg)
14 INCLUDE_DIRECTORIES(${INC_DIR} ${INC_PORT_GST_DIR} ${INC_PORT_CUSTOM_DIR} ${INC_PORT_FFMPEG_DIR})
16 SET(dependents "dlog glib-2.0 mm-common capi-media-tool iniparser gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-app-1.0 capi-media-codec")
17 SET(pc_dependents "capi-base-common capi-media-tool")
19 INCLUDE(FindPkgConfig)
20 pkg_check_modules(${fw_name} REQUIRED ${dependents})
21 FOREACH(flag ${${fw_name}_CFLAGS})
22 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
25 SET(CMAKE_C_FLAGS "-I./include -I./include/headers ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")
26 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
28 IF("${ARCH}" STREQUAL "arm")
29 ADD_DEFINITIONS("-DTARGET")
30 ENDIF("${ARCH}" STREQUAL "arm")
32 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
33 ADD_DEFINITIONS("-DTIZEN_DEBUG")
35 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
37 AUX_SOURCE_DIRECTORY (src MAIN_SRC)
38 AUX_SOURCE_DIRECTORY (src/port_gst PORT_GST_SRC)
39 AUX_SOURCE_DIRECTORY (src/port_custom PORT_CUST_SRC)
40 AUX_SOURCE_DIRECTORY (src/port_ffmpeg PORT_FFMPEG_SRC)
49 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
51 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
53 SET_TARGET_PROPERTIES(${fw_name}
60 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
62 DIRECTORY ${INC_DIR}/ DESTINATION include/media
64 PATTERN "mediademuxer_*.h" EXCLUDE
65 PATTERN "${INC_DIR}/*.h"
68 SET(PC_NAME ${fw_name})
69 SET(PC_REQUIRED ${pc_dependents})
70 SET(PC_LDFLAGS -l${fw_name})
71 SET(PC_CFLAGS -I\${includedir}/media)
75 ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
78 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
80 ADD_SUBDIRECTORY(test)
84 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
87 COMMENT "distribution clean"
90 -not -name config.cmake -and \(
94 -name cmake.depends -or
95 -name cmake.check_depends -or
96 -name CMakeCache.txt -or
97 -name cmake.check_cache -or
103 -name install_manifest.txt -or
106 | grep -v TC | xargs rm -rf