~ubuntu-branches/ubuntu/trusty/mapcache/trusty

« back to all changes in this revision

Viewing changes to cmake/FindAPR.cmake

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2013-09-11 19:16:06 UTC
  • Revision ID: package-import@ubuntu.com-20130911191606-9aydo919w4dgjx9v
Tags: upstream-1.2.0
ImportĀ upstreamĀ versionĀ 1.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Licensed to the Apache Software Foundation (ASF) under one
 
2
# or more contributor license agreements.  See the NOTICE file
 
3
# distributed with this work for additional information
 
4
# regarding copyright ownership.  The ASF licenses this file
 
5
# to you under the Apache License, Version 2.0 (the
 
6
# "License"); you may not use this file except in compliance
 
7
# with the License.  You may obtain a copy of the License at
 
8
 
9
#   http://www.apache.org/licenses/LICENSE-2.0
 
10
 
11
# Unless required by applicable law or agreed to in writing,
 
12
# software distributed under the License is distributed on an
 
13
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 
14
# KIND, either express or implied.  See the License for the
 
15
# specific language governing permissions and limitations
 
16
# under the License.
 
17
 
 
18
# - Find Apache Portable Runtime
 
19
# Find the APR includes and libraries
 
20
# This module defines
 
21
#  APR_INCLUDE_DIR and APRUTIL_INCLUDE_DIR, where to find apr.h, etc.
 
22
#  APR_LIBRARIES and APRUTIL_LIBRARIES, the libraries needed to use APR.
 
23
#  APR_FOUND and APRUTIL_FOUND, If false, do not try to use APR.
 
24
# also defined, but not for general use are
 
25
#  APR_LIBRARY and APRUTIL_LIBRARY, where to find the APR library.
 
26
 
 
27
# APR first.
 
28
 
 
29
FIND_PROGRAM(APR_CONFIG_BIN
 
30
   NAMES apr-config apr-1-config )
 
31
 
 
32
if(APR_CONFIG_BIN)
 
33
   execute_process(
 
34
      COMMAND ${APR_CONFIG_BIN} --includedir
 
35
      OUTPUT_VARIABLE HINT_APR_INCLUDE_DIR
 
36
      OUTPUT_STRIP_TRAILING_WHITESPACE
 
37
   )
 
38
   execute_process(
 
39
      COMMAND ${APR_CONFIG_BIN} --cppflags
 
40
      OUTPUT_VARIABLE APR_CPPFLAGS
 
41
      OUTPUT_STRIP_TRAILING_WHITESPACE
 
42
   )
 
43
endif(APR_CONFIG_BIN)
 
44
 
 
45
FIND_PATH(APR_INCLUDE_DIR
 
46
   NAMES apr.h
 
47
   HINTS ${HINT_APR_INCLUDE_DIR}
 
48
   PATH_SUFFIXES apr-1 apr-1.0 apr 
 
49
)
 
50
 
 
51
FIND_LIBRARY(APR_LIBRARY
 
52
  NAMES apr-1 apr
 
53
  PATH_SUFFIXES apr-1 apr-1.0 apr
 
54
)
 
55
 
 
56
set(APR_INCLUDE_DIRS ${APR_INCLUDE_DIR})
 
57
set(APR_LIBRARIES ${APR_LIBRARY})
 
58
include(FindPackageHandleStandardArgs)
 
59
find_package_handle_standard_args(APR DEFAULT_MSG APR_LIBRARY APR_INCLUDE_DIR)
 
60
mark_as_advanced(APR_LIBRARY APR_INCLUDE_DIR)
 
61
 
 
62
# Next, APRUTIL.
 
63
 
 
64
FIND_PATH(APU_INCLUDE_DIR
 
65
   NAMES apu.h
 
66
   PATH_SUFFIXES apr-1 apr-1.0 apr 
 
67
)
 
68
 
 
69
FIND_LIBRARY(APU_LIBRARY
 
70
  NAMES aprutil-1 aprutil
 
71
  PATH_SUFFIXES apr-1 apr-1.0 apr
 
72
)
 
73
 
 
74
 
 
75
set(APU_INCLUDE_DIRS ${APU_INCLUDE_DIR})
 
76
set(APU_LIBRARIES ${APU_LIBRARY})
 
77
find_package_handle_standard_args(APU DEFAULT_MSG APU_LIBRARY APU_INCLUDE_DIR)
 
78
mark_as_advanced(APU_LIBRARY APU_INCLUDE_DIR)