1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
17 SET(project_prefix "capi")
20 SET(maintainer "Seungkeun Lee <sngn.lee@samsung.com>, Kangho Hur<kagho.hur@samsung.com>")
21 SET(description "A Camera library in Tizen Native API")
23 SET(submodule "camera")
26 SET(dependents "dlog audio-session-mgr mm-camcorder capi-base-common capi-media-tool gstreamer-1.0 libtbm evas ecore elementary")
27 SET(pc_dependents "mm-camcorder capi-base-common capi-media-tool gstreamer-1.0 libtbm evas ecore elementary")
29 SET(fw_name "${project_prefix}-${service}-${submodule}")
33 SET(CMAKE_INSTALL_PREFIX ${prefix})
34 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
35 SET(VERSION ${version})
38 INCLUDE_DIRECTORIES(${INC_DIR})
40 INCLUDE(FindPkgConfig)
41 pkg_check_modules(${fw_name} REQUIRED ${dependents})
42 FOREACH(flag ${${fw_name}_CFLAGS})
43 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
46 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Wcast-align -Wcast-qual -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")
47 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
49 IF("${ARCH}" STREQUAL "arm")
50 ADD_DEFINITIONS("-DTARGET")
51 ENDIF("${ARCH}" STREQUAL "arm")
54 ADD_DEFINITIONS("-DHAVE_WAYLAND")
55 ENDIF(WAYLAND_SUPPORT)
57 ADD_DEFINITIONS("-DHAVE_X11")
60 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
61 ADD_DEFINITIONS("-DTIZEN_DEBUG")
63 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
65 aux_source_directory(src SOURCES)
66 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
68 SET_TARGET_PROPERTIES(${fw_name}
76 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
78 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
80 DIRECTORY ${INC_DIR}/ DESTINATION include/${service}
82 PATTERN "*_private.h" EXCLUDE
83 PATTERN "${INC_DIR}/*.h"
86 SET(PC_NAME ${fw_name})
87 SET(PC_REQUIRED ${pc_dependents})
88 SET(PC_LDFLAGS -l${fw_name})
92 ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
95 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
97 #ADD_SUBDIRECTORY(test)
101 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
104 COMMENT "distribution clean"
107 -not -name config.cmake -and \(
111 -name cmake.depends -or
112 -name cmake.check_depends -or
113 -name CMakeCache.txt -or
114 -name cmake.check_cache -or
120 -name install_manifest.txt -or
123 | grep -v TC | xargs rm -rf