-
Notifications
You must be signed in to change notification settings - Fork 0
/
purple-config.cmake
24 lines (22 loc) · 1.11 KB
/
purple-config.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
cmake_minimum_required(VERSION 3.16...3.24)
set(Purple "purple" CACHE STRING "Purple version to build against.")
set_property(CACHE Purple PROPERTY STRINGS "purple" "purple-3")
# Try pkg-config first (the default on Linux).
# Note: On win32, pkg-config may be provided by MinGW or MSYS.
find_package(PkgConfig QUIET)
if (${PKG_CONFIG_FOUND})
pkg_check_modules(PURPLE ${Purple})
pkg_get_variable(_PURPLE_PLUGIN_DIR ${Purple} plugindir)
pkg_get_variable(_PURPLE_DATA_DIR ${Purple} datarootdir)
endif()
if(WIN32 AND NOT "${PURPLE_FOUND}" AND "${Purple}" STREQUAL "purple")
message(STATUS "Trying win32 auto-configuration...")
include(${CMAKE_CURRENT_LIST_DIR}/win32/purple-fetch.cmake) # Note: This needs cmake 3.18
endif()
if(NOT "${PURPLE_FOUND}")
message(FATAL_ERROR "Purple not found.")
else()
# these are set intermediately so the user can override them
set(PURPLE_PLUGIN_DIR ${_PURPLE_PLUGIN_DIR} CACHE PATH "Where to put the plug-in.")
set(PURPLE_DATA_DIR ${_PURPLE_DATA_DIR} CACHE PATH "Data directory (pixmaps for the protocol icons is a sub-directory).")
endif()