Update wrt-installer_0.0.54
[framework/web/wrt-installer.git] / src / pkg-manager / CMakeLists.txt
1 #
2 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 #
4 #    Licensed under the Apache License, Version 2.0 (the "License");
5 #    you may not use this file except in compliance with the License.
6 #    You may obtain a copy of the License at
7 #
8 #        http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #    Unless required by applicable law or agreed to in writing, software
11 #    distributed under the License is distributed on an "AS IS" BASIS,
12 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #    See the License for the specific language governing permissions and
14 #    limitations under the License.
15 #
16
17 SET(BACKLIB_SRCS
18     backendlib.cpp
19 )
20
21 PKG_CHECK_MODULES(WRT_BACKLIB_PKGS
22     dpl-efl
23     dpl-wrt-dao-ro
24     dpl-wrt-dao-rw
25     dpl-utils-efl
26     pkgmgr-installer
27     pkgmgr-types
28     dlog
29     REQUIRED)
30
31 INCLUDE_DIRECTORIES(
32     ${WRT_BACKLIB_PKGS_INCLUDE_DIRS}
33 )
34
35 ADD_LIBRARY(${TARGET_BACKEND_LIB} SHARED
36     ${BACKLIB_SRCS}
37 )
38
39 TARGET_LINK_LIBRARIES(${TARGET_BACKEND_LIB}
40     ${WRT_BACKLIB_PKGS_LIBRARIES}
41 )
42
43 SET_TARGET_PROPERTIES(${TARGET_BACKEND_LIB} PROPERTIES
44     LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both -Wl"
45 )
46
47 INSTALL(TARGETS ${TARGET_BACKEND_LIB}
48     DESTINATION etc/package-manager/backendlib
49     PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
50 )
51
52 #SYMLINK
53 set(SYMLINK_USE OFF)
54 set(SYMLINK_DEST "${CMAKE_INSTALL_PREFIX}/etc/package-manager")
55
56 IF(SYMLINK_USE)
57     ADD_CUSTOM_COMMAND(OUTPUT ${SYMLINK_DEST}/backend/wgt
58         COMMAND mkdir
59         ARGS -p ${SYMLINK_DEST}/backend
60         COMMAND ln
61         ARGS -sf ${CMAKE_INSTALL_PREFIX}/bin/${BACKEND} ${SYMLINK_DEST}/backend/wgt
62         DEPENDS ${BACKEND}
63         )
64     ADD_CUSTOM_TARGET(test_symlinks ALL
65         DEPENDS ${SYMLINK_DEST}/backend/wgt
66         )
67 ENDIF(SYMLINK_USE)