2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 SET(MUSE_CORE "muse-core")
7 SET(CMAKE_INSTALL_PREFIX /usr)
8 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
10 SET(BINDIR "${PREFIX}/bin")
11 SET(INC_DIR core/include)
12 INCLUDE_DIRECTORIES(${INC_DIR})
14 SET(dependents "dlog json-c mm-common")
15 SET(pc_dependents "mm-common")
17 IF(${MUSE_REGISTER_VIP})
18 SET(dependents ${dependents} " libresourced")
19 ENDIF(${MUSE_REGISTER_VIP})
22 SET(dependents ${dependents} " lwipc")
23 ENDIF(${MUSE_USE_LWIPC})
25 IF(${MUSE_TTRACE_LOG})
26 SET(dependents ${dependents} " ttrace")
27 ENDIF(${MUSE_TTRACE_LOG})
29 INCLUDE(FindPkgConfig)
30 pkg_check_modules(${MUSE_CORE} REQUIRED ${dependents})
31 FOREACH(flag ${${MUSE_CORE}_CFLAGS})
32 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
35 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE -fno-strict-aliasing -Werror -Wformat -Wextra")
36 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers")
37 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter -Wshadow -Wwrite-strings -Wswitch-default")
38 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-result")
41 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
42 ENDIF(MUSE_GTESTS_BUILD)
44 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
46 IF("${ARCH}" STREQUAL "arm")
47 ADD_DEFINITIONS("-DTARGET")
48 ENDIF("${ARCH}" STREQUAL "arm")
50 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
51 ADD_DEFINITIONS("-DTIZEN_DEBUG")
52 ADD_DEFINITIONS(-DTZ_SYS_DATA_PATH="${TZ_SYS_DATA}")
54 aux_source_directory(core/src SOURCES)
55 ADD_LIBRARY(${MUSE_CORE} SHARED ${SOURCES})
57 TARGET_LINK_LIBRARIES(${MUSE_CORE} ${${MUSE_CORE}_LDFLAGS})
59 SET_TARGET_PROPERTIES(${MUSE_CORE}
66 INSTALL(TARGETS ${MUSE_CORE} DESTINATION ${LIBDIR})
68 DIRECTORY ${INC_DIR}/ DESTINATION include/media
70 PATTERN "*_private.h" EXCLUDE
71 PATTERN "${INC_DIR}/muse_core.h"
74 SET(PC_NAME ${MUSE_CORE})
75 SET(PC_REQUIRED ${pc_dependents})
76 SET(PC_LDFLAGS -l${MUSE_CORE})
77 SET(PC_CFLAGS -I\${includedir}/media)
81 ${CMAKE_CURRENT_SOURCE_DIR}/${MUSE_CORE}.pc
84 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${MUSE_CORE}.pc DESTINATION ${LIBDIR}/pkgconfig)
86 ADD_SUBDIRECTORY(server)
87 ADD_SUBDIRECTORY(client)
89 ADD_SUBDIRECTORY(unittest)
90 ENDIF(MUSE_GTESTS_BUILD)
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