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 mm-camcorder capi-base-common")
27 SET(pc_dependents "capi-base-common")
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")
47 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
49 IF("${ARCH}" STREQUAL "arm")
50 ADD_DEFINITIONS("-DTARGET")
51 ENDIF("${ARCH}" STREQUAL "arm")
53 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
54 ADD_DEFINITIONS("-DTIZEN_DEBUG")
56 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
58 aux_source_directory(src SOURCES)
59 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
61 SET_TARGET_PROPERTIES(${fw_name}
69 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
71 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
73 DIRECTORY ${INC_DIR}/ DESTINATION include/${service}
75 PATTERN "*_private.h" EXCLUDE
76 PATTERN "${INC_DIR}/*.h"
79 SET(PC_NAME ${fw_name})
80 SET(PC_REQUIRED ${pc_dependents})
81 SET(PC_LDFLAGS -l${fw_name})
85 ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
88 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
90 #ADD_SUBDIRECTORY(test)
94 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
97 COMMENT "distribution clean"
100 -not -name config.cmake -and \(
104 -name cmake.depends -or
105 -name cmake.check_depends -or
106 -name CMakeCache.txt -or
107 -name cmake.check_cache -or
113 -name install_manifest.txt -or
116 | grep -v TC | xargs rm -rf