Do not install testsuite on TV product
[platform/core/api/wav-player.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2
3 SET(Services 
4         "application"
5         "base"
6         "content"
7         "location"
8         "media"
9         "messaging"
10         "network"
11         "social"
12         "telephony"
13         "system"
14    )
15
16
17 # project
18 SET(project_prefix "capi")
19 SET(prefix "/usr")
20 SET(version "0.0.1")
21 SET(maintainer "Seungbae Shin <seungbae.shin@samsung.com>, Sangchul Lee <sc11.lee@samsung.com>, Jeongho Mok <jho.mok@samsung.com>")
22 SET(description "A wav player library in Tizen Native API")
23 SET(service "media")
24 SET(submodule "wav-player")
25
26 # for package file
27 SET(dependents "mm-sound dlog capi-base-common capi-media-sound-manager")
28 SET(pc_dependents "capi-base-common capi-media-sound-manager")
29
30 SET(fw_name "${project_prefix}-${service}-${submodule}")
31
32 PROJECT(${fw_name})
33
34 SET(CMAKE_INSTALL_PREFIX ${prefix})
35 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
36 SET(VERSION ${version})
37
38 SET(INC_DIR include)
39 INCLUDE_DIRECTORIES(${INC_DIR})
40
41 INCLUDE(FindPkgConfig)
42 pkg_check_modules(${fw_name} REQUIRED ${dependents})
43 FOREACH(flag ${${fw_name}_CFLAGS})
44     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
45 ENDFOREACH(flag)
46
47 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall")
48 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
49
50 IF("${ARCH}" MATCHES "^arm.*")
51     ADD_DEFINITIONS("-DTARGET")
52 ENDIF("${ARCH}" MATCHES "^arm.*")
53
54 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
55 ADD_DEFINITIONS("-DTIZEN_DEBUG")
56
57 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
58
59 aux_source_directory(src SOURCES)
60 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
61
62 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
63
64 SET_TARGET_PROPERTIES(${fw_name}
65      PROPERTIES
66      VERSION ${FULLVER}
67      SOVERSION ${MAJORVER}
68      CLEAN_DIRECT_OUTPUT 1
69 )
70
71 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
72 INSTALL(
73         DIRECTORY ${INC_DIR}/ DESTINATION include/${service}
74         FILES_MATCHING
75         PATTERN "*_private.h" EXCLUDE
76         PATTERN "${INC_DIR}/*.h"
77         )
78
79 SET(PC_NAME ${fw_name})
80 SET(PC_REQUIRED ${pc_dependents})
81 SET(PC_LDFLAGS -l${fw_name})
82
83 CONFIGURE_FILE(
84     ${fw_name}.pc.in
85     ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
86     @ONLY
87 )
88 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
89
90 IF(TIZEN_FEATURE_TESTSUITE)
91 ADD_SUBDIRECTORY(test)
92 ENDIF(TIZEN_FEATURE_TESTSUITE)
93
94 IF(UNIX)
95
96 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
97 ADD_CUSTOM_COMMAND(
98         DEPENDS clean
99         COMMENT "distribution clean"
100         COMMAND find
101         ARGS    .
102         -not -name config.cmake -and \(
103         -name tester.c -or
104         -name Testing -or
105         -name CMakeFiles -or
106         -name cmake.depends -or
107         -name cmake.check_depends -or
108         -name CMakeCache.txt -or
109         -name cmake.check_cache -or
110         -name *.cmake -or
111         -name Makefile -or
112         -name core -or
113         -name core.* -or
114         -name gmon.out -or
115         -name install_manifest.txt -or
116         -name *.pc -or
117         -name *~ \)
118         | grep -v TC | xargs rm -rf
119         TARGET  distclean
120         VERBATIM
121 )
122
123 ENDIF(UNIX)