Improved build process and instructions.

This commit is contained in:
Håvard Pettersson 2014-09-10 02:45:12 +02:00
parent 353188a798
commit 285903351b
2 changed files with 19 additions and 7 deletions

View file

@ -1,6 +1,16 @@
cmake_minimum_required(VERSION 2.8.7)
project(tox-weechat)
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.")
add_library(tox MODULE
src/tox-weechat.c
@ -11,6 +21,7 @@ add_library(tox MODULE
src/tox-weechat-chats.c
src/tox-weechat-friend-requests.c
)
add_definitions(-D_GNU_SOURCE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -Werror-implicit-function-declaration -Wno-unused-parameter")
@ -19,4 +30,5 @@ target_link_libraries(tox toxcore)
# remove lib prefix (libtox.so -> tox.so)
set_target_properties(tox PROPERTIES PREFIX "")
install(TARGETS tox DESTINATION lib/weechat/plugins)
install(TARGETS tox DESTINATION "${INSTALL_PATH}")