Tizen 2.1 base
[platform/core/system/sync-agent.git] / test / dummy_project / src / agent / CMakeLists.txt
1
2 #############################################
3 #
4 # Step 1. Set Variable and Build Dependency
5 #
6
7 # set a name for the entire project
8 PROJECT(dummy)
9
10 # set variables
11 SET(EXENAME "${PROJECT_NAME}-agent")
12 SET(BINDIR "${PREFIX}/bin")
13 SET(DUMMY_SRC_DIR "${CMAKE_SOURCE_DIR}/src/agent")
14 SET(DUMMY_COMPONETS "main")
15
16 # checks for build dependency modules : a pkg-config module for CMake
17 INCLUDE(FindPkgConfig)
18 pkg_check_modules(LPKGS REQUIRED
19                                         glib-2.0
20                                         sync-agent
21                                         libwbxml2
22                                         dlog
23                                         )
24
25 #############################################
26 #
27 # Step 2. Set Compile Environment
28 #
29
30 # set extra cflags from build dependency
31 STRING(REPLACE ";" " " EXTRA_CFLAGS "${LPKGS_CFLAGS}")
32
33 # find all source files in a directory.
34 FOREACH(DUMMY_COMPONET ${DUMMY_COMPONETS})
35         AUX_SOURCE_DIRECTORY(${DUMMY_SRC_DIR}/${DUMMY_COMPONET} SRCS)
36 ENDFOREACH(DUMMY_COMPONET)
37
38 # add internal include directories to the build.
39
40 # add define macros
41 ADD_DEFINITIONS("-DGLIB_VERSION_MIN_REQUIRED=(2<<16|32<<8) ")
42
43 #############################################
44 #
45 # Step 3. Set Link Environment
46 #
47
48 # add an executable to the project using the specified source files.
49 ADD_EXECUTABLE(${EXENAME} ${SRCS})
50
51 # link a target to given libraries.
52 TARGET_LINK_LIBRARIES(${EXENAME} ${LPKGS_LIBRARIES})
53
54 # sets additional compiler flags used to build sources within the target.
55 SET_TARGET_PROPERTIES(${EXENAME} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS})
56
57 #############################################
58 #
59 # Step 4. Install packages
60 #
61
62 # install executable file
63 INSTALL(TARGETS ${EXENAME} DESTINATION ${BINDIR})
64
65 # install dummy configuration files
66 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/dummy-cfg DESTINATION /usr/share)