aef18ba9513a3e93a4413a22c6c6fa7dc68ac1cb
[framework/web/wrt-installer.git] / src / wrt-installer / CMakeLists.txt
1 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14 #
15 #
16 # @file     CMakeLists.txt
17 # @author   Lukasz Wrzosek (l.wrzosek@samsung.com)
18 # @version     1.0
19 #
20
21 SET(WRT_INSTALLER_DIR
22     ${INSTALLER_SRC_DIR}/wrt-installer
23     )
24
25 SET(PKG_MANAGER_DIR
26     ${INSTALLER_SRC_DIR}/pkg-manager
27     )
28
29 SET(WRT_INSTALLER_SOURCES
30     ${WRT_INSTALLER_DIR}/wrt_installer.cpp
31     ${WRT_INSTALLER_DIR}/wrt_installer_api.cpp
32     ${WRT_INSTALLER_DIR}/installer_callbacks_translate.cpp
33     ${WRT_INSTALLER_DIR}/plugin_utils.cpp
34     ${WRT_INSTALLER_DIR}/language_subtag_rst_tree.cpp
35     ${WRT_INSTALLER_DIR}/installer_main_thread.cpp
36     ${WRT_INSTALLER_DIR}/option_parser.cpp
37     ${PKG_MANAGER_DIR}/pkgmgr_signal.cpp
38 )
39
40 PKG_CHECK_MODULES(WRT_INSTALLER_DEPS
41     pkgmgr-installer
42     libpcrecpp
43     security-install
44     REQUIRED)
45
46 INCLUDE_DIRECTORIES(
47     ${PKG_MANAGER_DIR}
48     ${WRT_INSTALLER_DEP_INCLUDES}
49     ${WRT_INSTALLER_INCLUDES}
50     ${WRT_INSTALLER_DEPS_INCLUDE_DIRS}
51 )
52
53 ADD_EXECUTABLE(${TARGET_INSTALLER}
54     ${TARGET_INSTALLER_STATIC_SRC}
55     ${WRT_INSTALLER_SOURCES}
56 )
57
58 ADD_DEFINITIONS(${WRT_INSTALLER_DEPS_CFLAGS})
59
60 TARGET_LINK_LIBRARIES(${TARGET_INSTALLER}
61     ${TARGET_INSTALLER_STATIC}
62     ${WRT_INSTALLER_DEPS_LIBRARIES}
63 )
64
65
66 SET_TARGET_PROPERTIES(${TARGET_INSTALLER} PROPERTIES
67     LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
68     BUILD_WITH_INSTALL_RPATH ON
69     INSTALL_RPATH_USE_LINK_PATH ON
70 )
71
72 INSTALL(TARGETS ${TARGET_INSTALLER} DESTINATION bin)