1 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 # @file CMakeLists.txt
16 # @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
20 ############################# Check minimum CMake version #####################
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
23 PROJECT("wrt-installer")
25 ############################# cmake packages ##################################
27 INCLUDE(FindPkgConfig)
29 ############################# build type ######################################
31 IF(NOT CMAKE_BUILD_TYPE)
32 SET(CMAKE_BUILD_TYPE "Release")
33 ENDIF(NOT CMAKE_BUILD_TYPE)
35 ############################# compilation defines #############################
37 OPTION(DPL_LOG "DPL logs status" ON)
38 SET(LOG_TAG "WRT_INSTALLER")
39 OPTION(WITH_TESTS "Build tests" OFF)
41 OPTION(MULTIPROCESS_SERVICE_SUPPORT "Process per service" OFF)
42 OPTION(MULTIPROCESS_SERVICE_SUPPORT_INLINE "Process per service - inline mode support" OFF)
43 OPTION(SCHEMA_VALIDATION_SUPPORT "Support for XML schema validation" OFF)
44 OPTION(NFC_APP_CONTROL_EXCEPTION "Enable exception handling for NFC app-control" ON)
45 OPTION(AMBIENT_FEATURE_SUPPORT "Support for ambient" OFF)
46 OPTION(WEB_PROVIDER_SUPPORT "Support for Web Provider" OFF)
48 IF(DEVICE_PROFILE STREQUAL "WEARABLE")
49 MESSAGE(STATUS "Device Profile: WEARABLE")
50 ADD_DEFINITIONS("-DDEVICE_PROFILE_WEARABLE")
51 SET(AMBIENT_FEATURE_SUPPORT ON)
52 ELSEIF(DEVICE_PROFILE STREQUAL "MOBILE")
53 MESSAGE(STATUS "Device Profile: MOBILE")
54 ADD_DEFINITIONS("-DDEVICE_PROFILE_MOBILE")
55 ELSEIF(DEVICE_PROFILE STREQUAL "TV")
56 MESSAGE(STATUS "Device Profile: TV")
57 ADD_DEFINITIONS("-DDEVICE_PROFILE_TV")
60 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build")
63 ############################# compiler flags ##################################
65 SET(CMAKE_C_FLAGS_PROFILING "-O2")
66 SET(CMAKE_CXX_FLAGS_PROFILING "-O2 -std=c++0x")
67 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
68 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g")
69 SET(CMAKE_C_FLAGS_RELEASE "-O2 -g")
70 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x -g -fvisibility-inlines-hidden")
71 SET(CMAKE_CXX_FLAGS_CCOV "-O0 -std=c++0x -g --coverage")
73 IF(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
74 MESSAGE(STATUS "Logging enabled for DPL")
75 ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
76 ELSE(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
77 MESSAGE(STATUS "Logging disabled for DPL")
78 ENDIF(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
79 MESSAGE(STATUS "WITH_TESTS: " ${WITH_TESTS})
80 IF(MULTIPROCESS_SERVICE_SUPPORT)
81 ADD_DEFINITIONS("-DMULTIPROCESS_SERVICE_SUPPORT")
82 IF (MULTIPROCESS_SERVICE_SUPPORT_INLINE)
83 ADD_DEFINITIONS("-DMULTIPROCESS_SERVICE_SUPPORT_INLINE")
84 ENDIF(MULTIPROCESS_SERVICE_SUPPORT_INLINE)
85 ENDIF(MULTIPROCESS_SERVICE_SUPPORT)
86 IF(SCHEMA_VALIDATION_SUPPORT)
87 MESSAGE(STATUS "XML Schema validation of installed app enabled")
88 ADD_DEFINITIONS("-DSCHEMA_VALIDATION_ENABLED")
89 ENDIF(SCHEMA_VALIDATION_SUPPORT)
90 IF(NFC_APP_CONTROL_EXCEPTION)
91 MESSAGE(STATUS "Exception handling for NFC app-control is enabled")
92 ADD_DEFINITIONS("-DNFC_EXCEPTION_HANDLING_FOR_TIZEN_2_2_ONLY")
93 ENDIF(NFC_APP_CONTROL_EXCEPTION)
94 IF(AMBIENT_FEATURE_SUPPORT)
95 ADD_DEFINITIONS("-DAMBIENT_ENABLED")
96 ENDIF(AMBIENT_FEATURE_SUPPORT)
98 SET(Boost_USE_STATIC_LIBS OFF)
99 SET(Boost_USE_MULTITHREADED ON)
100 SET(Boost_USE_STATIC_RUNTIME OFF)
102 FIND_PACKAGE(Boost 1.51.0 REQUIRED filesystem system)
105 ADD_DEFINITIONS("-DTIZEN_VERSION=\"${TIZEN_VERSION}\"")
107 message(FATAL_ERROR "TIZEN_VERSION MUST BE declared on build flag.")
110 # If supported for the target machine, emit position-independent code,suitable
111 # for dynamic linking and avoiding any limit on the size of the global offset
112 # table. This option makes a difference on the m68k, PowerPC and SPARC.
114 ADD_DEFINITIONS("-fPIC")
116 # Set the default ELF image symbol visibility to hidden - all symbols will be
117 # marked with this unless overridden within the code.
118 #ADD_DEFINITIONS("-fvisibility=hidden")
120 # Set compiler warning flags
121 #ADD_DEFINITIONS("-Werror") # Make all warnings into errors.
122 ADD_DEFINITIONS("-Wall") # Generate all warnings
123 ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings
124 ADD_DEFINITIONS("-Wno-variadic-macros") # Inhibit variadic macros warnings (needed for ORM)
125 ADD_DEFINITIONS("-Wno-deprecated") # No warnings about deprecated features
126 ADD_DEFINITIONS("-std=c++0x") # accept C++11x standard
127 ADD_DEFINITIONS("-DIME_ENABLED") # enable Ime features
128 ADD_DEFINITIONS("-DSERVICE_ENABLED") # enable Service features
130 ############################# Targets names ###################################
132 SET(TARGET_INSTALLER_STATIC "wrt-installer_static")
133 SET(TARGET_INSTALLER "wrt-installer")
134 SET(TARGET_BACKEND_LIB "wgt")
136 ############################# subdirectories ##################################
137 ADD_SUBDIRECTORY(src)
138 ADD_SUBDIRECTORY(configuration)
141 ADD_SUBDIRECTORY(tests)