1
# - Try to find the BTCore library
2
# Once done this will define
4
# BTCORE_FOUND - system has BTCore
5
# BTCORE_INCLUDE_DIR - the BTCore include directory
6
# BTCORE_LIBRARIES - Link these to use BTCore
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)
11
# Redistribution and use is allowed according to the terms of the BSD license.
12
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14
if(BTCORE_INCLUDE_DIR AND BTCORE_LIBRARIES)
17
set(BTCORE_FOUND TRUE)
19
else(BTCORE_INCLUDE_DIR AND BTCORE_LIBRARIES)
21
FIND_PATH(BTCORE_INCLUDE_DIR
25
${KDE4_INCLUDE_DIR}/libbtcore
26
${INCLUDE_INSTALL_DIR}/libbtcore
29
FIND_LIBRARY(BTCORE_LIBRARIES
36
if(BTCORE_INCLUDE_DIR AND BTCORE_LIBRARIES)
37
set(BTCORE_FOUND TRUE)
38
endif(BTCORE_INCLUDE_DIR AND BTCORE_LIBRARIES)
41
FIND_LIBRARY(BTCORE_LIBRARIES_DEBUG
48
if(NOT BTCORE_LIBRARIES_DEBUG)
49
set(BTCORE_FOUND FALSE)
50
endif(NOT BTCORE_LIBRARIES_DEBUG)
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)
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)
67
if(NOT BTCORE_FIND_QUIETLY)
68
message(STATUS "Found BTCore: ${BTCORE_LIBRARIES} ")
69
endif(NOT BTCORE_FIND_QUIETLY)
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)
88
endif(BTCORE_INCLUDE_DIR AND BTCORE_LIBRARIES)