| 1 | project(newosd) |
|---|
| 2 | cmake_minimum_required(VERSION 2.4.2) |
|---|
| 3 | |
|---|
| 4 | # Plugin version |
|---|
| 5 | set(VERSION_MAJOR 1) |
|---|
| 6 | set(VERSION_MINOR 3) |
|---|
| 7 | set(VERSION_RELEASE 5) |
|---|
| 8 | |
|---|
| 9 | # Install dirs |
|---|
| 10 | set(INSTALL_LIB_DIR lib CACHE PATH |
|---|
| 11 | "Directory to install the plugin to. A relative path is relative to CMAKE_INSTALL_PREFIX.") |
|---|
| 12 | mark_as_advanced(INSTALL_LIB_DIR) |
|---|
| 13 | |
|---|
| 14 | # Licq headers (see cmake --help-command find_path |
|---|
| 15 | # for the reason why we call find_path twice here) |
|---|
| 16 | find_path(LICQ_INCLUDE_DIR NAMES licq_icqd.h |
|---|
| 17 | PATHS ${CMAKE_SOURCE_DIR}/../../include |
|---|
| 18 | ${CMAKE_SOURCE_DIR}/../licq/include |
|---|
| 19 | NO_DEFAULT_PATHS) |
|---|
| 20 | find_path(LICQ_INCLUDE_DIR NAMES licq_icqd.h) |
|---|
| 21 | |
|---|
| 22 | if (NOT LICQ_INCLUDE_DIR) |
|---|
| 23 | message(FATAL_ERROR "Licq header files not found. Please specify the location with -DLICQ_INCLUDE_DIR") |
|---|
| 24 | endif (NOT LICQ_INCLUDE_DIR) |
|---|
| 25 | |
|---|
| 26 | message(STATUS "Found Licq include dir: ${LICQ_INCLUDE_DIR}") |
|---|
| 27 | include_directories(${LICQ_INCLUDE_DIR}) |
|---|
| 28 | |
|---|
| 29 | # Holds all libraries we should link to |
|---|
| 30 | set(LIBRARIES) |
|---|
| 31 | |
|---|
| 32 | # use pkg-config to find libaosd stuff |
|---|
| 33 | include(FindPkgConfig) |
|---|
| 34 | |
|---|
| 35 | if (NOT PKG_CONFIG_FOUND) |
|---|
| 36 | message(FATAL_ERROR "pkg-config could not be found on your system, unable to continue.") |
|---|
| 37 | endif (NOT PKG_CONFIG_FOUND) |
|---|
| 38 | |
|---|
| 39 | pkg_search_module(AOSD REQUIRED libaosd-text) |
|---|
| 40 | |
|---|
| 41 | if (AOSD_FOUND) |
|---|
| 42 | set(LIBRARIES ${LIBRARIES} ${AOSD_LIBRARIES}) |
|---|
| 43 | include_directories(${AOSD_INCLUDE_DIRS}) |
|---|
| 44 | add_definitions(${AOSD_CFLAGS}) |
|---|
| 45 | else (AOSD_FOUND) |
|---|
| 46 | message(FATAL_ERROR "libaosd-text wasn't found...") |
|---|
| 47 | endif (AOSD_FOUND) |
|---|
| 48 | |
|---|
| 49 | # To find config.h |
|---|
| 50 | include_directories(${CMAKE_BINARY_DIR}) |
|---|
| 51 | |
|---|
| 52 | # Generate config.h |
|---|
| 53 | configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) |
|---|
| 54 | |
|---|
| 55 | add_subdirectory(src) |
|---|