~ubuntu-branches/ubuntu/lucid/ktorrent/lucid

« back to all changes in this revision

Viewing changes to cmake/modules/FindBTCore.cmake

  • Committer: Bazaar Package Importer
  • Author(s): Richard Birnie
  • Date: 2008-06-03 20:32:46 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20080603203246-dfyemn010uhsf433
Tags: 3.1~rc1+dfsg.1-1ubuntu1
* New upstream development release      
 - Dropped 01_support_external_libbtcore.diffm,
   97_fix_target_link_libraries.diff,
   99_libbtcore_scramble_soname.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# - Try to find the BTCore library
 
2
# Once done this will define
 
3
#
 
4
#  BTCORE_FOUND - system has BTCore
 
5
#  BTCORE_INCLUDE_DIR - the BTCore include directory
 
6
#  BTCORE_LIBRARIES - Link these to use BTCore
 
7
 
 
8
# Copyright (c) 2007 Joris Guisson <joris.guisson@gmail.com>
 
9
# Copyright (c) 2007 Charles Connell <charles@connells.org> (This was based upon FindKopete.cmake)
 
10
#
 
11
# Redistribution and use is allowed according to the terms of the BSD license.
 
12
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
13
 
 
14
if(BTCORE_INCLUDE_DIR AND BTCORE_LIBRARIES)
 
15
 
 
16
  # read from cache
 
17
  set(BTCORE_FOUND TRUE)
 
18
 
 
19
else(BTCORE_INCLUDE_DIR AND BTCORE_LIBRARIES)
 
20
 
 
21
  FIND_PATH(BTCORE_INCLUDE_DIR 
 
22
    NAMES
 
23
    btcore_export.h
 
24
    PATHS 
 
25
    ${KDE4_INCLUDE_DIR}/libbtcore
 
26
    ${INCLUDE_INSTALL_DIR}/libbtcore
 
27
    )
 
28
  
 
29
  FIND_LIBRARY(BTCORE_LIBRARIES 
 
30
    NAMES
 
31
    btcore
 
32
    PATHS
 
33
    ${KDE4_LIB_DIR}
 
34
    ${LIB_INSTALL_DIR}
 
35
    )
 
36
  if(BTCORE_INCLUDE_DIR AND BTCORE_LIBRARIES)
 
37
    set(BTCORE_FOUND TRUE)
 
38
  endif(BTCORE_INCLUDE_DIR AND BTCORE_LIBRARIES)
 
39
 
 
40
  if(MSVC)
 
41
    FIND_LIBRARY(BTCORE_LIBRARIES_DEBUG 
 
42
      NAMES
 
43
      kopeted
 
44
      PATHS
 
45
      ${KDE4_LIB_DIR}
 
46
      ${LIB_INSTALL_DIR}
 
47
      )
 
48
    if(NOT BTCORE_LIBRARIES_DEBUG)
 
49
      set(BTCORE_FOUND FALSE)
 
50
    endif(NOT BTCORE_LIBRARIES_DEBUG)
 
51
    
 
52
    if(MSVC_IDE)
 
53
      if( NOT BTCORE_LIBRARIES_DEBUG OR NOT BTCORE_LIBRARIES)
 
54
        message(FATAL_ERROR "\nCould NOT find the debug AND release version of the BTCore library.\nYou need to have both to use MSVC projects.\nPlease build and install both BTCore libraries first.\n")
 
55
      endif( NOT BTCORE_LIBRARIES_DEBUG OR NOT BTCORE_LIBRARIES)
 
56
    else(MSVC_IDE)
 
57
      string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
 
58
      if(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
 
59
        set(BTCORE_LIBRARIES ${BTCORE_LIBRARIES_DEBUG})
 
60
      else(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
 
61
        set(BTCORE_LIBRARIES ${BTCORE_LIBRARIES})
 
62
      endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
 
63
    endif(MSVC_IDE)
 
64
  endif(MSVC)
 
65
 
 
66
  if(BTCORE_FOUND)
 
67
    if(NOT BTCORE_FIND_QUIETLY)
 
68
      message(STATUS "Found BTCore: ${BTCORE_LIBRARIES} ")
 
69
    endif(NOT BTCORE_FIND_QUIETLY)
 
70
  else(BTCORE_FOUND)
 
71
    if(BTCORE_FIND_REQUIRED)
 
72
      if(NOT BTCORE_INCLUDE_DIR)
 
73
        message(FATAL_ERROR "Could not find BTCore includes.")
 
74
      endif(NOT BTCORE_INCLUDE_DIR)
 
75
      if(NOT BTCORE_LIBRARIES)
 
76
        message(FATAL_ERROR "Could not find BTCore library.")
 
77
      endif(NOT BTCORE_LIBRARIES)
 
78
    else(BTCORE_FIND_REQUIRED)
 
79
      if(NOT BTCORE_INCLUDE_DIR)
 
80
        message(STATUS "Could not find BTCore includes.")
 
81
      endif(NOT BTCORE_INCLUDE_DIR)
 
82
      if(NOT BTCORE_LIBRARIES)
 
83
        message(STATUS "Could not find BTCore library.")
 
84
      endif(NOT BTCORE_LIBRARIES)
 
85
    endif(BTCORE_FIND_REQUIRED)
 
86
  endif(BTCORE_FOUND)
 
87
 
 
88
endif(BTCORE_INCLUDE_DIR AND BTCORE_LIBRARIES)