2014-09-18 18:55:52 +02:00
|
|
|
#
|
2018-04-12 23:42:34 +02:00
|
|
|
# Copyright (c) 2018 Håvard Pettersson <mail@haavard.me>.
|
2014-09-18 18:55:52 +02:00
|
|
|
#
|
|
|
|
# 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/>.
|
|
|
|
#
|
|
|
|
|
2017-02-11 04:08:26 +01:00
|
|
|
cmake_minimum_required(VERSION 2.8.12)
|
2014-09-10 02:45:12 +02:00
|
|
|
project(tox-weechat C)
|
|
|
|
|
2024-03-07 03:46:11 +01:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/src/c-toxcore/toxcore -I/var/local/src/c-toxcore/toxav -I/usr/local/src/c-toxcore/toxencryptsave")
|
|
|
|
set(LD_FLAGS "${LD_FLAGS} -I/usr/local/src/c-toxcore/_build")
|
2022-11-11 12:40:14 +01:00
|
|
|
|
2014-09-08 03:22:51 +02:00
|
|
|
add_library(tox MODULE
|
2014-09-28 03:29:34 +02:00
|
|
|
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
|
2022-11-11 12:40:14 +01:00
|
|
|
src/twc-conf-invite.c
|
2014-09-28 03:29:34 +02:00
|
|
|
src/twc-list.c
|
|
|
|
src/twc-message-queue.c
|
|
|
|
src/twc-profile.c
|
|
|
|
src/twc-tox-callbacks.c
|
2018-05-22 13:47:53 +02:00
|
|
|
src/twc-tfer.c
|
2017-02-11 04:08:26 +01:00
|
|
|
src/twc-utils.c)
|
2014-09-10 02:45:12 +02:00
|
|
|
|
2017-02-11 04:08:26 +01:00
|
|
|
set_target_properties(tox PROPERTIES
|
|
|
|
PREFIX "" # remove lib prefix (libtox.so -> tox.so)
|
|
|
|
C_STANDARD 99)
|
|
|
|
target_compile_options(tox PRIVATE -Wall -Wextra -Wno-unused-parameter)
|
2014-09-08 02:59:50 +02:00
|
|
|
|
2017-02-11 04:08:26 +01:00
|
|
|
# find include and shared library locations
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
2019-01-19 14:22:38 +01:00
|
|
|
find_package(WeeChat REQUIRED)
|
2017-02-11 04:08:26 +01:00
|
|
|
find_package(Tox REQUIRED CORE OPTIONAL_COMPONENTS AV ENCRYPTSAVE)
|
2015-09-02 22:34:10 +02:00
|
|
|
|
2017-02-11 04:08:26 +01:00
|
|
|
target_include_directories(tox PRIVATE
|
|
|
|
"${WeeChat_INCLUDE_DIRS}"
|
|
|
|
"${Tox_INCLUDE_DIRS}")
|
|
|
|
target_link_libraries(tox "${Tox_LIBRARIES}")
|
2015-01-30 14:54:25 +01:00
|
|
|
|
2015-09-02 22:34:10 +02:00
|
|
|
if(Tox_AV_FOUND)
|
2017-02-11 04:08:26 +01:00
|
|
|
target_compile_definitions(tox PRIVATE TOXAV_ENABLED)
|
2015-09-02 22:34:10 +02:00
|
|
|
endif()
|
2014-09-08 03:28:15 +02:00
|
|
|
|
2015-09-07 19:44:17 +02:00
|
|
|
if(Tox_ENCRYPTSAVE_FOUND)
|
2017-02-11 04:08:26 +01:00
|
|
|
target_compile_definitions(tox PRIVATE TOXENCRYPTSAVE_ENABLED)
|
2015-09-07 19:44:17 +02:00
|
|
|
endif()
|
|
|
|
|
2017-02-11 04:08:26 +01:00
|
|
|
# install plugin binary
|
|
|
|
set(PLUGIN_PATH "lib/weechat/plugins" CACHE PATH
|
|
|
|
"Path to install the plugin binary to.")
|
2014-10-11 13:11:47 +02:00
|
|
|
install(TARGETS tox DESTINATION "${PLUGIN_PATH}")
|
2014-09-10 02:45:12 +02:00
|
|
|
|