| | 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 | # Holds all libraries we should link to |
| | 15 | set(LIBRARIES) |
| | 16 | |
| | 17 | # use pkg-config to find libaosd |
| | 18 | include(UsePkgConfig) |
| | 19 | |
| | 20 | pkgconfig(libaosd AOSD_INCLUDE_DIR AOSD_LINK_DIR AOSD_LINK_FLAGS AOSD_CFLAGS) |
| | 21 | |
| | 22 | if (AOSD_LINK_FLAGS) |
| | 23 | message(STATUS "Found aosd library dir: ${AOSD_LINK_DIR}") |
| | 24 | set(LIBRARIES ${LIBRARIES} ${AOSD_LINK_FLAGS}) |
| | 25 | include_directories(${AOSD_INCLUDE_DIR}) |
| | 26 | else (AOSD_LINK_FLAGS) |
| | 27 | message(FATAL_ERROR "libaosd wasn't found...") |
| | 28 | endif (AOSD_LINK_FLAGS) |
| | 29 | |
| | 30 | # Licq headers (see cmake --help-command find_path |
| | 31 | # for the reason we call find_path twice) |
| | 32 | find_path(LICQ_INCLUDE_DIR NAMES licq_icqd.h |
| | 33 | PATHS ${CMAKE_SOURCE_DIR}/../../include |
| | 34 | ${CMAKE_SOURCE_DIR}/../licq/include |
| | 35 | NO_DEFAULT_PATHS) |
| | 36 | find_path(LICQ_INCLUDE_DIR NAMES licq_icqd.h) |
| | 37 | |
| | 38 | if (NOT LICQ_INCLUDE_DIR) |
| | 39 | message(FATAL_ERROR "Licq header files not found. Please specify the location with -DLICQ_INCLUDE_DIR") |
| | 40 | endif (NOT LICQ_INCLUDE_DIR) |
| | 41 | |
| | 42 | message(STATUS "Found Licq include dir: ${LICQ_INCLUDE_DIR}") |
| | 43 | include_directories(${LICQ_INCLUDE_DIR}) |
| | 44 | |
| | 45 | add_subdirectory(src) |