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 ############################# compilation defines #############################
33 ############################# compiler flags ##################################
35 SET(CMAKE_C_FLAGS_PROFILING "-O0 -g -pg")
36 SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -std=c++0x -g -pg")
37 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
38 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g")
39 SET(CMAKE_C_FLAGS_RELEASE "-O2 -g")
40 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x -g")
42 OPTION(DPL_LOG "DPL logs status" ON)
44 MESSAGE(STATUS "Logging enabled for DPL")
45 ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
47 MESSAGE(STATUS "Logging disabled for DPL")
50 # If supported for the target machine, emit position-independent code,suitable
51 # for dynamic linking and avoiding any limit on the size of the global offset
52 # table. This option makes a difference on the m68k, PowerPC and SPARC.
54 ADD_DEFINITIONS("-fPIC")
55 ADD_DEFINITIONS("-DSEPARATED_SINGLETON_IMPLEMENTATION")
57 # Set the default ELF image symbol visibility to hidden - all symbols will be
58 # marked with this unless overridden within the code.
59 #ADD_DEFINITIONS("-fvisibility=hidden")
61 # Set compiler warning flags
62 #ADD_DEFINITIONS("-Werror") # Make all warnings into errors.
63 ADD_DEFINITIONS("-Wall") # Generate all warnings
64 ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings
65 ADD_DEFINITIONS("-Wno-variadic-macros") # Inhibit variadic macros warnings (needed for ORM)
66 ADD_DEFINITIONS("-Wno-deprecated") # No warnings about deprecated features
67 ADD_DEFINITIONS("-std=c++0x") # No warnings about deprecated features
68 #ADD_DEFINITIONS("-DWRT_SMACK_ENABLED")
70 ############################# Targets names ###################################
72 SET(TARGET_INSTALLER_STATIC "wrt-installer_static")
73 SET(TARGET_INSTALLER "wrt-installer")
74 SET(TARGET_BACKEND_LIB "wgt")
75 SET(TARGET_CONFIG_GEN_LIB "wrt-config-generator")
77 ############################# subdirectories ##################################
80 ADD_SUBDIRECTORY(tests)