1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
17 SET(project_prefix "capi")
19 SET(maintainer "Sahil Bansal <sahil.bansal@samsung.com>")
20 SET(description "A Stream Recorder library in Tizen Native API")
22 SET(submodule "streamrecorder")
25 SET(dependents "dlog mm-streamrecorder capi-media-tool")
26 SET(pc_dependents "capi-base-common capi-media-tool")
28 SET(fw_name "${project_prefix}-${service}-${submodule}")
32 SET(CMAKE_INSTALL_PREFIX ${prefix})
33 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
36 INCLUDE_DIRECTORIES(${INC_DIR})
38 INCLUDE(FindPkgConfig)
39 pkg_check_modules(${fw_name} REQUIRED ${dependents})
40 FOREACH(flag ${${fw_name}_CFLAGS})
41 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
44 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Wextra -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
45 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
47 IF("${ARCH}" STREQUAL "arm")
48 ADD_DEFINITIONS("-DTARGET")
49 ENDIF("${ARCH}" STREQUAL "arm")
51 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
53 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
55 aux_source_directory(src SOURCES)
56 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
58 SET_TARGET_PROPERTIES(${fw_name}
65 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
67 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
69 DIRECTORY ${INC_DIR}/ DESTINATION include/${service}
71 PATTERN "*_private.h" EXCLUDE
72 PATTERN "${INC_DIR}/*.h"
75 SET(PC_NAME ${fw_name})
76 SET(PC_REQUIRED ${pc_dependents})
77 SET(PC_LDFLAGS -l${fw_name})
81 ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
84 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
86 ADD_SUBDIRECTORY(test)
90 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
93 COMMENT "distribution clean"
96 -not -name config.cmake -and \(
100 -name cmake.depends -or
101 -name cmake.check_depends -or
102 -name CMakeCache.txt -or
103 -name cmake.check_cache -or
109 -name install_manifest.txt -or
112 | grep -v TC | xargs rm -rf