2014-09-02 22:40:31 +02:00
|
|
|
cmake_minimum_required(VERSION 2.8.7)
|
2014-09-02 12:37:00 +02:00
|
|
|
|
2014-09-10 02:45:12 +02:00
|
|
|
project(tox-weechat C)
|
|
|
|
|
|
|
|
option(HOME_FOLDER_INSTALL "Install to ~/.weechat/plugins instead of default location." OFF)
|
|
|
|
if(HOME_FOLDER_INSTALL)
|
|
|
|
set(INSTALL_PATH "~/.weechat/plugins")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT DEFINED INSTALL_PATH OR "${INSTALL_PATH}" STREQUAL "")
|
|
|
|
set(INSTALL_PATH "lib/weechat/plugins")
|
|
|
|
endif()
|
|
|
|
set(INSTALL_PATH "${INSTALL_PATH}" CACHE PATH "Path to install the plugin binary to.")
|
2014-09-02 12:37:00 +02:00
|
|
|
|
2014-09-08 03:22:51 +02:00
|
|
|
add_library(tox MODULE
|
2014-09-02 12:37:00 +02:00
|
|
|
src/tox-weechat.c
|
2014-09-13 06:52:42 +02:00
|
|
|
src/tox-weechat-identities.c
|
2014-09-02 18:47:08 +02:00
|
|
|
src/tox-weechat-chats.c
|
|
|
|
src/tox-weechat-friend-requests.c
|
2014-09-13 06:52:42 +02:00
|
|
|
src/tox-weechat-tox-callbacks.c
|
|
|
|
src/tox-weechat-commands.c
|
|
|
|
src/tox-weechat-gui.c
|
|
|
|
src/tox-weechat-utils.c
|
2014-09-13 12:22:26 +02:00
|
|
|
src/tox-weechat-config.c
|
2014-09-18 17:51:19 +02:00
|
|
|
src/tox-weechat-json.c
|
2014-09-02 12:37:00 +02:00
|
|
|
)
|
2014-09-10 02:45:12 +02:00
|
|
|
|
2014-09-18 08:55:31 +02:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra -Werror-implicit-function-declaration -Wno-unused-parameter")
|
2014-09-08 02:59:50 +02:00
|
|
|
|
2014-09-08 03:28:15 +02:00
|
|
|
target_link_libraries(tox toxcore)
|
2014-09-18 16:05:10 +02:00
|
|
|
target_link_libraries(tox jansson)
|
2014-09-08 03:28:15 +02:00
|
|
|
|
2014-09-08 00:22:49 +02:00
|
|
|
# remove lib prefix (libtox.so -> tox.so)
|
2014-09-02 12:37:00 +02:00
|
|
|
set_target_properties(tox PROPERTIES PREFIX "")
|
|
|
|
|
2014-09-10 02:45:12 +02:00
|
|
|
install(TARGETS tox DESTINATION "${INSTALL_PATH}")
|
|
|
|
|