From da243771d39b3670228438458981821ebf2c300c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Pettersson?= Date: Tue, 2 Sep 2014 21:10:00 +0200 Subject: [PATCH] Added -DPREFIX option to cmake build. --- CMakeLists.txt | 9 +++++++-- README.md | 16 ++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b71cee..3ae4910 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.0) project(tox-weechat) - add_definitions(-std=c11) add_library(tox SHARED @@ -14,9 +13,15 @@ add_library(tox SHARED src/tox-weechat-friend-requests.c ) +if (PREFIX) + set(CMAKE_INSTALL_PREFIX ${PREFIX}) +else() + set(CMAKE_INSTALL_PREFIX /usr/local/lib/weechat) +endif() + # remove lib prefix set_target_properties(tox PROPERTIES PREFIX "") target_link_libraries(tox toxcore) -install(FILES build/tox.so DESTINATION ~/.weechat/plugins) +install(FILES build/tox.so DESTINATION plugins) diff --git a/README.md b/README.md index c29c829..3ac32a5 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,15 @@ Installation Tox-WeeChat requires [libtoxcore][3] to work. After getting it, install Tox-WeeChat like this: - git clone https://github.com/haavardp/tox-weechat.git - cd tox-weechat - mkdir build - cd build + $ git clone https://github.com/haavardp/tox-weechat.git + $ cd tox-weechat + $ mkdir build + $ cd build - cmake .. - make install + $ cmake .. + $ make install -This places `tox.so` in `~/.weechat/plugins`. +This places `tox.so` in `/usr/local/lib/weechat/plugins`. If you don't have root access or otherwise would like to install it locally, replace the cmake command above with this one: `cmake -DPREFIX=$HOME/.weechat ..`. Usage ----- @@ -35,7 +35,7 @@ License Tox-WeeChat is licensed under the MIT license. For more information, see the LICENSE file. -Copyright (C) 2014 Håvard Pettersson . +Copyright (c) 2014 Håvard Pettersson . [1]: http://weechat.org [2]: http://tox.im