~ci-train-bot/url-dispatcher/url-dispatcher-ubuntu-zesty-2174

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: CI bot
  • Author(s): Jussi Pakkanen
  • Date: 2014-10-31 15:50:49 UTC
  • mfrom: (74.1.8 url-dispatcher)
  • Revision ID: ps-jenkins@lists.canonical.com-20141031155049-m4fu0cnmriksccmp
General cleanups 
Approved by: Ted Gould, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
project(url-dispatcher C CXX)
2
2
cmake_minimum_required(VERSION 2.8.9)
3
3
 
 
4
string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) # Build types should always be lowercase but sometimes they are not.
 
5
 
 
6
if (${cmake_build_type_lower} STREQUAL debug)
 
7
  option (werror "Treat warnings as errors." FALSE)
 
8
else()
 
9
  option (werror "Treat warnings as errors." TRUE)
 
10
endif()
 
11
 
4
12
option (enable_tests "Build tests" ON)
5
13
option (enable_lcov "Generate Coverage Reports" ON)
6
14
 
27
35
  set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}")
28
36
endif()
29
37
 
30
 
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
 
38
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
 
39
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
 
40
 
 
41
# https://bugzilla.gnome.org/show_bug.cgi?id=669355
 
42
# Since gdbus-codegen does not produce warning-free code
 
43
# and we use -Werror, only enable these warnings for debug
 
44
# builds. Drop this once the issue has been fixed and landed.
 
45
if (${cmake_build_type_lower} STREQUAL debug)
 
46
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic")# -Wextra")
 
47
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic -Wextra")
 
48
endif()
 
49
 
 
50
if (${werror})
 
51
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
 
52
  set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
 
53
endif() 
31
54
 
32
55
pkg_check_modules(UBUNTU_APP_LAUNCH REQUIRED ubuntu-app-launch-2)
33
56
include_directories(${UBUNTU_APP_LAUNCH_INCLUDE_DIRS})
71
94
include_directories(${CMAKE_CURRENT_BINARY_DIR})
72
95
 
73
96
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -fPIC")
 
97
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC")
74
98
 
75
99
add_subdirectory(data)
76
100
add_subdirectory(service)