c3c524fcd71e677270d261803a09eaa173b0a332
[framework/web/wrt-installer.git] / 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 # @file        CMakeLists.txt
16 # @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
17 # @brief
18 #
19
20 ############################# Check minimum CMake version #####################
21
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
23 PROJECT("wrt-installer")
24
25 ############################# cmake packages ##################################
26
27 INCLUDE(FindPkgConfig)
28
29 ############################# build type ######################################
30
31 IF(NOT CMAKE_BUILD_TYPE)
32     SET(CMAKE_BUILD_TYPE "Release")
33 ENDIF(NOT CMAKE_BUILD_TYPE)
34
35 ############################# compilation defines #############################
36
37 # EMPTY
38
39 ############################# compiler flags ##################################
40
41 SET(CMAKE_C_FLAGS_PROFILING    "-O0 -g -pg")
42 SET(CMAKE_CXX_FLAGS_PROFILING  "-O0 -std=c++0x -g -pg")
43 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g")
44 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -std=c++0x -g")
45 SET(CMAKE_C_FLAGS_RELEASE      "-O2 -g")
46 SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -std=c++0x -g")
47 SET(CMAKE_CXX_FLAGS_CCOV       "-O0 -std=c++0x -g --coverage")
48
49 OPTION(DPL_LOG "DPL logs status" ON)
50 IF(DPL_LOG)
51     MESSAGE(STATUS "Logging enabled for DPL")
52     ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
53 ELSE(DPL_LOG)
54     MESSAGE(STATUS "Logging disabled for DPL")
55 ENDIF(DPL_LOG)
56
57 # If supported for the target machine, emit position-independent code,suitable
58 # for dynamic linking and avoiding any limit on the size of the global offset
59 # table. This option makes a difference on the m68k, PowerPC and SPARC.
60 # (BJ: our ARM too?)
61 ADD_DEFINITIONS("-fPIC")
62
63 # Set the default ELF image symbol visibility to hidden - all symbols will be
64 # marked with this unless overridden within the code.
65 #ADD_DEFINITIONS("-fvisibility=hidden")
66
67 # Set compiler warning flags
68 #ADD_DEFINITIONS("-Werror")             # Make all warnings into errors.
69 ADD_DEFINITIONS("-Wall")                # Generate all warnings
70 ADD_DEFINITIONS("-Wextra")              # Generate even more extra warnings
71 ADD_DEFINITIONS("-Wno-variadic-macros") # Inhibit variadic macros warnings (needed for ORM)
72 ADD_DEFINITIONS("-Wno-deprecated")      # No warnings about deprecated features
73 ADD_DEFINITIONS("-std=c++0x")           # No warnings about deprecated features
74 #ADD_DEFINITIONS("-DWRT_SMACK_ENABLED")
75
76 ############################# Targets names ###################################
77
78 SET(TARGET_INSTALLER_STATIC "wrt-installer_static")
79 SET(TARGET_INSTALLER "wrt-installer")
80 SET(TARGET_BACKEND_LIB "wgt")
81
82 ADD_CUSTOM_COMMAND(
83     OUTPUT ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edj
84     COMMAND edje_cc
85     ARGS  ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edc
86           ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edj
87     DEPENDS ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edc
88     )
89 ADD_CUSTOM_TARGET(widget_install_popup ALL DEPENDS
90     ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edj
91     )
92 INSTALL(FILES   ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edj
93     DESTINATION share/edje/wrt
94     )
95
96 ############################# subdirectories ##################################
97 ADD_SUBDIRECTORY(src)
98 ADD_SUBDIRECTORY(etc)