project(QtTelepathy)
cmake_minimum_required(VERSION 2.6.0)
# Uncomment the line below when you want to break cmake 2.4 again ;)
cmake_policy(SET CMP0003 NEW)

# Set install locations:
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
set(EXEC_INSTALL_PREFIX  ${CMAKE_INSTALL_PREFIX}
    CACHE PATH  "Base directory for executables and libraries" FORCE)
set(LIB_INSTALL_DIR   "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}"
    CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)

set(INC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(common_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/Common)

find_package(Qt4 REQUIRED)
if (NOT QT_QTDBUS_FOUND)
   message(FATAL_ERROR  "Telepathy-Qt requires Qt4 with QtDBus module in order to built.")
endif(NOT QT_QTDBUS_FOUND)

SET(VERSION "0.17.7")
SET(SO_VERSION "1707")

# put the include dirs which are in the source or build tree
# before all other include dirs, so the headers in the sources
# are prefered over the already installed ones
# since cmake 2.4.1
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)

if(NOT WIN32)
# Generate pkg-config file
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/QtTelepathyClient.pc.in
               ${CMAKE_CURRENT_BINARY_DIR}/QtTelepathyClient.pc)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtTelepathyClient.pc
        DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
endif(NOT WIN32)

add_subdirectory(src/Client)
add_subdirectory(include/QtTelepathy/Client)

# install the common headers.
# Do not add the Common/src directory: That
# code is already build with Client and Core.
add_subdirectory(include/QtTelepathy/Common)

