summaryrefslogtreecommitdiff
path: root/unittest/CMakeLists.txt
blob: 1c4afb2484f6da9feff94d76525526cf14f731fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
SET(GTEST_TEST "gtest-ui-app-ambient")

ENABLE_TESTING()

INCLUDE(FindPkgConfig)
LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/appcore_ui_app_ambient/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/mock)

PKG_CHECK_MODULES(gtest_pkgs REQUIRED
	glib-2.0
	gmock
	dlog
	aul
	alarm-service
	bundle
	capi-appfw-app-common
	)

FOREACH(flag ${gtest_pkgs_CFLAGS})
	SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fpie")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fpie")

FILE(GLOB GTEST_TEST_SRCS *.cpp)
AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/unittest GTEST_TEST_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/mock GTEST_TEST_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/appcore_ui_app_ambient/src
UI_APP_AMBIENT_SRCS)

ADD_EXECUTABLE(${GTEST_TEST} ${GTEST_TEST_SRCS} ${UI_APP_AMBIENT_SRCS})
TARGET_LINK_LIBRARIES(${GTEST_TEST} ${gtest_pkgs_LDFLAGS})

ADD_TEST(${GTEST_TEST} ${GTEST_TEST})
INSTALL(TARGETS ${GTEST_TEST} DESTINATION /usr/bin)