summaryrefslogtreecommitdiff
path: root/src/plugins/CMakeLists.txt
blob: b34acd92e237dca84d09b03b8ff0c598beff227a (plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#
# Copyright (C) 2003-2013 Sebastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2009 Emmanuel Bouthenot <kolter@openics.org>
#
# This file is part of WeeChat, the extensible chat client.
#
# 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.
#
# 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 WeeChat.  If not, see <http://www.gnu.org/licenses/>.
#

SET(LIB_PLUGINS_SRC
weechat-plugin.h
plugin.c plugin.h
plugin-api.c plugin-api.h
plugin-config.h plugin-config.c)

SET(LIB_PLUGINS_SCRIPTS_SRC
plugin-script.c plugin-script.h
plugin-script-api.c plugin-script-api.h
plugin-script-callback.c plugin-script-callback.h)

INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
ADD_LIBRARY(weechat_plugins STATIC ${LIB_PLUGINS_SRC})

ADD_DEFINITIONS(${CMAKE_SHARED_LIBRARY_C_FLAGS})
ADD_LIBRARY(weechat_plugins_scripts STATIC ${LIB_PLUGINS_SCRIPTS_SRC})

INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckLibraryExists)

IF(ENABLE_ALIAS)
  ADD_SUBDIRECTORY( alias )
ENDIF(ENABLE_ALIAS)

IF(ENABLE_ASPELL)
  # Check for aspell libraries
  FIND_PACKAGE(Aspell)
  IF(ASPELL_FOUND)
    ADD_SUBDIRECTORY( aspell )
  ENDIF(ASPELL_FOUND)
ENDIF(ENABLE_ASPELL)

IF(ENABLE_CHARSET)
  # Check for iconv support.
  IF(ICONV_FOUND)
    ADD_SUBDIRECTORY( charset )
  ENDIF(ICONV_FOUND)
ENDIF(ENABLE_CHARSET)

IF(ENABLE_DEMO)
  ADD_SUBDIRECTORY( demo )
ENDIF(ENABLE_DEMO)

IF(ENABLE_FIFO)
  ADD_SUBDIRECTORY( fifo )
ENDIF(ENABLE_FIFO)

IF(ENABLE_IRC)
  ADD_SUBDIRECTORY( irc )
ENDIF(ENABLE_IRC)

IF(ENABLE_LOGGER)
  ADD_SUBDIRECTORY( logger )
ENDIF(ENABLE_LOGGER)

IF(ENABLE_RELAY)
  ADD_SUBDIRECTORY( relay )
ENDIF(ENABLE_RELAY)

IF(ENABLE_RMODIFIER)
  ADD_SUBDIRECTORY( rmodifier )
ENDIF(ENABLE_RMODIFIER)

IF(ENABLE_SCRIPT)
  ADD_SUBDIRECTORY( script )
ENDIF(ENABLE_SCRIPT)

IF(ENABLE_XFER)
  ADD_SUBDIRECTORY( xfer )
ENDIF(ENABLE_XFER)

IF(ENABLE_SCRIPTS AND ENABLE_PERL)
  FIND_PACKAGE(Perl)
  IF(PERL_FOUND)
    ADD_SUBDIRECTORY( perl )
  ENDIF(PERL_FOUND)
ENDIF(ENABLE_SCRIPTS AND ENABLE_PERL)

IF(ENABLE_SCRIPTS AND ENABLE_PYTHON)
  FIND_PACKAGE(Python)
  IF(PYTHON_FOUND)
    ADD_SUBDIRECTORY( python )
  ENDIF(PYTHON_FOUND)
ENDIF(ENABLE_SCRIPTS AND ENABLE_PYTHON)

IF(ENABLE_SCRIPTS AND ENABLE_RUBY)
  FIND_PACKAGE(Ruby)
  IF(RUBY_FOUND)
    ADD_SUBDIRECTORY( ruby )
  ENDIF(RUBY_FOUND)
ENDIF(ENABLE_SCRIPTS AND ENABLE_RUBY)

IF(ENABLE_SCRIPTS AND ENABLE_LUA)
  FIND_PACKAGE(Lua)
  IF(LUA_FOUND)
    ADD_SUBDIRECTORY( lua )
  ENDIF(LUA_FOUND)
ENDIF(ENABLE_SCRIPTS AND ENABLE_LUA)

IF(ENABLE_SCRIPTS AND ENABLE_TCL)
  FIND_PACKAGE(TCL)
  IF(TCL_FOUND)
    ADD_SUBDIRECTORY( tcl )
  ENDIF(TCL_FOUND)
ENDIF(ENABLE_SCRIPTS AND ENABLE_TCL)

IF(ENABLE_SCRIPTS AND ENABLE_GUILE)
  FIND_PACKAGE(Guile)
  IF(GUILE_FOUND)
    ADD_SUBDIRECTORY( guile )
  ENDIF(GUILE_FOUND)
ENDIF(ENABLE_SCRIPTS AND ENABLE_GUILE)

INSTALL(FILES weechat-plugin.h DESTINATION ${INCLUDEDIR})