1 PROJECT(downloadagent2 C)
3 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
4 SET(CMAKE_BUILD_TYPE "Debug")
5 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
6 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
8 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
10 FIND_PROGRAM(UNAME NAMES uname)
11 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
13 #DA Engine Include Directory
14 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include)
16 INCLUDE(FindPkgConfig)
17 pkg_check_modules(subpkgs REQUIRED
21 capi-network-connection
26 FOREACH(flag ${subpkgs_CFLAGS})
27 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
30 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall -fPIC")
31 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
32 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall")
33 SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed -Wl,--hash-style=both")
35 IF("${ARCH}" MATCHES "^arm.*")
36 ADD_DEFINITIONS("-D_TARGET")
37 SET(CMAKE_C_FLAGS_RELEASE "-mabi=aapcs-linux -msoft-float -O2")
38 ENDIF("${ARCH}" MATCHES "^arm.*")
40 ADD_DEFINITIONS("-D_EFL_PLATFORM")
41 #allow to install widget, deb pkg and apk for testing
42 ADD_DEFINITIONS("-DDA_DEBUG_USING_DLOG")
43 #This should be removed when release a target
44 ADD_DEFINITIONS("-D_SAMSUNG_MIME_POLICY")
46 #############################################################################
47 #+++++++++++++++++++++++++DA ENGINE+++++++++++++++++++++++++++++++++++++++++++
48 #############################################################################
52 ${SRCS_PATH}/download-agent-debug.c
53 ${SRCS_PATH}/download-agent-interface.c
54 ${SRCS_PATH}/download-agent-client-mgr.c
55 ${SRCS_PATH}/download-agent-dl-mgr.c
56 ${SRCS_PATH}/download-agent-dl-info-util.c
57 ${SRCS_PATH}/download-agent-http-queue.c
58 ${SRCS_PATH}/download-agent-http-misc.c
59 ${SRCS_PATH}/download-agent-http-mgr.c
60 ${SRCS_PATH}/download-agent-http-msg-handler.c
61 ${SRCS_PATH}/download-agent-encoding.c
62 ${SRCS_PATH}/download-agent-utils.c
63 ${SRCS_PATH}/download-agent-utils-dl-id-history.c
64 ${SRCS_PATH}/download-agent-basic.c
65 ${SRCS_PATH}/download-agent-file.c
66 ${SRCS_PATH}/download-agent-plugin-libsoup.c
67 ${SRCS_PATH}/download-agent-plugin-conf.c
68 ${SRCS_PATH}/download-agent-mime-util.c
72 include/download-agent-defs.h
73 include/download-agent-interface.h
76 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS_DA_ENGINE})
77 #TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${subpkgs_LDFLAGS} "-ldl")
78 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${subpkgs_LDFLAGS})
79 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.0.1)
81 #############################################################################
82 #+++++++++++++++++++++++++INSTALLATION++++++++++++++++++++++++++++++++++++++++
83 #############################################################################
85 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries)