forked from haavard/tox-weechat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
67 lines (54 loc) · 1.83 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Copyright (c) 2015 Håvard Pettersson <mail@haavard.me>.
#
# This file is part of Tox-WeeChat.
#
# Tox-WeeChat is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Tox-WeeChat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Tox-WeeChat. If not, see <http://www.gnu.org/licenses/>.
#
cmake_minimum_required(VERSION 2.8.11)
project(tox-weechat C)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
find_package(WeeChat REQUIRED)
find_package(Tox REQUIRED
COMPONENTS CORE
OPTIONAL_COMPONENTS AV)
set(PLUGIN_PATH "lib/weechat/plugins" CACHE PATH
"Path to install the plugin binary to.")
add_library(tox MODULE
src/twc.c
src/twc-bootstrap.c
src/twc-chat.c
src/twc-commands.c
src/twc-completion.c
src/twc-config.c
src/twc-friend-request.c
src/twc-gui.c
src/twc-group-invite.c
src/twc-list.c
src/twc-message-queue.c
src/twc-profile.c
src/twc-tox-callbacks.c
src/twc-utils.c
)
set(CMAKE_C_FLAGS_DEBUG "-DTWC_DEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra -Wno-unused-parameter")
include_directories(${Tox_INCLUDE_DIRS})
include_directories(${WeeChat_INCLUDE_DIRS})
target_link_libraries(tox ${Tox_LIBRARIES})
if(Tox_AV_FOUND)
add_definitions(-DTOXAV_ENABLED)
endif()
# remove lib prefix (libtox.so -> tox.so)
set_target_properties(tox PROPERTIES PREFIX "")
install(TARGETS tox DESTINATION "${PLUGIN_PATH}")