diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2019-05-01 08:29:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-01 08:29:59 +0200 |
commit | 1102f8ccf02933b888e5f200688e3ad7b2846163 (patch) | |
tree | 2eb38ead752e9b44c61f9083bade0a085302c0d2 | |
parent | 38535686f841c107cb95ff618f7b152af98a8ff4 (diff) | |
parent | 8df3ad3d2613cb0dd3f034c3f1767d3f7eba056b (diff) | |
download | weechat-1102f8ccf02933b888e5f200688e3ad7b2846163.zip |
Merge pull request #1342 from ryan-farley/libdir_fix
cmake: allow custom libdir (fix #1341)
-rw-r--r-- | CMakeLists.txt | 14 | ||||
-rw-r--r-- | config.h.cmake | 2 | ||||
-rw-r--r-- | src/plugins/alias/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/buflist/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/charset/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/exec/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/fifo/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/fset/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/guile/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/irc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/javascript/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/logger/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/lua/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/perl/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/php/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/python/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/relay/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/ruby/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/script/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/spell/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/tcl/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/trigger/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/xfer/CMakeLists.txt | 2 |
23 files changed, 30 insertions, 28 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f5aac0e0a..42fd20a9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,10 +58,12 @@ endif() set(PKG_STRING "${PROJECT_NAME} ${VERSION}") string(REPLACE "\";\"" "\ " PKG_STRING ${PKG_STRING}) -if(DEFINED LIBDIR) - set(LIBDIR ${LIBDIR}/${PROJECT_NAME}) -else() - set(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}) +if(NOT DEFINED LIBDIR) + set(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) +endif() + +if(NOT DEFINED WEECHAT_LIBDIR) + set(WEECHAT_LIBDIR ${LIBDIR}/${PROJECT_NAME}) endif() if(NOT DEFINED SHAREDIR) @@ -261,10 +263,10 @@ add_custom_target(dist set(PACKAGE "${PROJECT_NAME}") set(prefix "${CMAKE_INSTALL_PREFIX}") set(exec_prefix "\${prefix}") -set(libdir "\${exec_prefix}/lib") +set(libdir "${LIBDIR}") set(includedir "\${prefix}/include") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/weechat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/weechat.pc @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat.pc DESTINATION ${LIBDIR}/../pkgconfig) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat.pc DESTINATION ${LIBDIR}/pkgconfig) # cygport file (used to build Cygwin packages) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/weechat.cygport.in ${CMAKE_CURRENT_BINARY_DIR}/weechat-${VERSION}-1.cygport @ONLY) diff --git a/config.h.cmake b/config.h.cmake index 82be05c6e..e160f0c6c 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -13,7 +13,7 @@ #define PACKAGE "@PROJECT_NAME@" #define PACKAGE_NAME "@PROJECT_NAME@" #define PACKAGE_STRING "@PKG_STRING@" -#define WEECHAT_LIBDIR "@LIBDIR@" +#define WEECHAT_LIBDIR "@WEECHAT_LIBDIR@" #define WEECHAT_SHAREDIR "@SHAREDIR@" #define LOCALEDIR "@LOCALEDIR@" #define WEECHAT_HOME "@WEECHAT_HOME@" diff --git a/src/plugins/alias/CMakeLists.txt b/src/plugins/alias/CMakeLists.txt index ef01f319f..6aa2302da 100644 --- a/src/plugins/alias/CMakeLists.txt +++ b/src/plugins/alias/CMakeLists.txt @@ -27,4 +27,4 @@ set_target_properties(alias PROPERTIES PREFIX "") target_link_libraries(alias coverage_config) -install(TARGETS alias LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS alias LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/buflist/CMakeLists.txt b/src/plugins/buflist/CMakeLists.txt index e6bfe92f9..c92d635fb 100644 --- a/src/plugins/buflist/CMakeLists.txt +++ b/src/plugins/buflist/CMakeLists.txt @@ -27,4 +27,4 @@ set_target_properties(buflist PROPERTIES PREFIX "") target_link_libraries(buflist coverage_config) -install(TARGETS buflist LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS buflist LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/charset/CMakeLists.txt b/src/plugins/charset/CMakeLists.txt index 50851b49f..6a775f4be 100644 --- a/src/plugins/charset/CMakeLists.txt +++ b/src/plugins/charset/CMakeLists.txt @@ -29,4 +29,4 @@ if(ICONV_FOUND) endif() endif() -install(TARGETS charset LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS charset LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/exec/CMakeLists.txt b/src/plugins/exec/CMakeLists.txt index 84fa71ded..44cd38dd3 100644 --- a/src/plugins/exec/CMakeLists.txt +++ b/src/plugins/exec/CMakeLists.txt @@ -27,4 +27,4 @@ set_target_properties(exec PROPERTIES PREFIX "") target_link_libraries(exec coverage_config) -install(TARGETS exec LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS exec LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/fifo/CMakeLists.txt b/src/plugins/fifo/CMakeLists.txt index 2885e095e..f63bb6462 100644 --- a/src/plugins/fifo/CMakeLists.txt +++ b/src/plugins/fifo/CMakeLists.txt @@ -26,4 +26,4 @@ set_target_properties(fifo PROPERTIES PREFIX "") target_link_libraries(fifo coverage_config) -install(TARGETS fifo LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS fifo LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/fset/CMakeLists.txt b/src/plugins/fset/CMakeLists.txt index c7b4098ca..773f3bcc4 100644 --- a/src/plugins/fset/CMakeLists.txt +++ b/src/plugins/fset/CMakeLists.txt @@ -31,4 +31,4 @@ set_target_properties(fset PROPERTIES PREFIX "") target_link_libraries(fset coverage_config) -install(TARGETS fset LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS fset LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/guile/CMakeLists.txt b/src/plugins/guile/CMakeLists.txt index aee626837..e8ddabc72 100644 --- a/src/plugins/guile/CMakeLists.txt +++ b/src/plugins/guile/CMakeLists.txt @@ -29,4 +29,4 @@ if(GUILE_FOUND) target_link_libraries(guile ${LINK_LIBS} weechat_plugins_scripts coverage_config) endif() -install(TARGETS guile LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS guile LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/irc/CMakeLists.txt b/src/plugins/irc/CMakeLists.txt index 92609edf7..7c6cef73e 100644 --- a/src/plugins/irc/CMakeLists.txt +++ b/src/plugins/irc/CMakeLists.txt @@ -61,4 +61,4 @@ endif() target_link_libraries(irc ${LINK_LIBS} coverage_config) -install(TARGETS irc LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS irc LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/javascript/CMakeLists.txt b/src/plugins/javascript/CMakeLists.txt index ceb5a99f5..37ebad3d5 100644 --- a/src/plugins/javascript/CMakeLists.txt +++ b/src/plugins/javascript/CMakeLists.txt @@ -30,4 +30,4 @@ if(V8_FOUND) target_link_libraries(javascript ${V8_LIBRARY} weechat_plugins_scripts coverage_config) endif() -install(TARGETS javascript LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS javascript LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/logger/CMakeLists.txt b/src/plugins/logger/CMakeLists.txt index ecd25d2bd..0bce4d5bc 100644 --- a/src/plugins/logger/CMakeLists.txt +++ b/src/plugins/logger/CMakeLists.txt @@ -28,4 +28,4 @@ set_target_properties(logger PROPERTIES PREFIX "") target_link_libraries(logger coverage_config) -install(TARGETS logger LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS logger LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/lua/CMakeLists.txt b/src/plugins/lua/CMakeLists.txt index d28a716fb..40dd0d216 100644 --- a/src/plugins/lua/CMakeLists.txt +++ b/src/plugins/lua/CMakeLists.txt @@ -28,4 +28,4 @@ if(LUA_FOUND) target_link_libraries(lua ${LUA_LDFLAGS} weechat_plugins_scripts coverage_config) endif() -install(TARGETS lua LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS lua LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/perl/CMakeLists.txt b/src/plugins/perl/CMakeLists.txt index 234f3e70c..78d8569c5 100644 --- a/src/plugins/perl/CMakeLists.txt +++ b/src/plugins/perl/CMakeLists.txt @@ -43,4 +43,4 @@ if(PERL_FOUND) endif() endif() -install(TARGETS perl LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS perl LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/php/CMakeLists.txt b/src/plugins/php/CMakeLists.txt index 1c04ac0c7..47f7564bb 100644 --- a/src/plugins/php/CMakeLists.txt +++ b/src/plugins/php/CMakeLists.txt @@ -28,4 +28,4 @@ if(PHP_FOUND) target_link_libraries(php ${PHP_LIB} weechat_plugins_scripts coverage_config) endif() -install(TARGETS php LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS php LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/python/CMakeLists.txt b/src/plugins/python/CMakeLists.txt index a6ca8d2b5..5fcd59226 100644 --- a/src/plugins/python/CMakeLists.txt +++ b/src/plugins/python/CMakeLists.txt @@ -28,4 +28,4 @@ if(PYTHON_FOUND) target_link_libraries(python ${PYTHON_LIBRARY} weechat_plugins_scripts coverage_config) endif() -install(TARGETS python LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS python LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/relay/CMakeLists.txt b/src/plugins/relay/CMakeLists.txt index a33df99ac..a98545c79 100644 --- a/src/plugins/relay/CMakeLists.txt +++ b/src/plugins/relay/CMakeLists.txt @@ -49,4 +49,4 @@ endif() target_link_libraries(relay ${LINK_LIBS} coverage_config) -install(TARGETS relay LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS relay LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/ruby/CMakeLists.txt b/src/plugins/ruby/CMakeLists.txt index 1f14dbcfa..b17c36802 100644 --- a/src/plugins/ruby/CMakeLists.txt +++ b/src/plugins/ruby/CMakeLists.txt @@ -29,4 +29,4 @@ if(RUBY_FOUND) target_link_libraries(ruby ${LINK_LIBS} ${RUBY_LIB} weechat_plugins_scripts coverage_config) endif(RUBY_FOUND) -install(TARGETS ruby LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS ruby LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/script/CMakeLists.txt b/src/plugins/script/CMakeLists.txt index 8235dbddb..6b5701acd 100644 --- a/src/plugins/script/CMakeLists.txt +++ b/src/plugins/script/CMakeLists.txt @@ -36,4 +36,4 @@ list(APPEND LINK_LIBS ${GCRYPT_LDFLAGS}) target_link_libraries(script ${LINK_LIBS} coverage_config) -install(TARGETS script LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS script LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/spell/CMakeLists.txt b/src/plugins/spell/CMakeLists.txt index e6e674796..700aeb290 100644 --- a/src/plugins/spell/CMakeLists.txt +++ b/src/plugins/spell/CMakeLists.txt @@ -39,4 +39,4 @@ else() endif() endif() -install(TARGETS spell LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS spell LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/tcl/CMakeLists.txt b/src/plugins/tcl/CMakeLists.txt index f7aeca3b3..c39e2106d 100644 --- a/src/plugins/tcl/CMakeLists.txt +++ b/src/plugins/tcl/CMakeLists.txt @@ -32,4 +32,4 @@ if(TCL_FOUND) target_link_libraries(tcl ${TCL_LIBRARY} weechat_plugins_scripts coverage_config) endif() -install(TARGETS tcl LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS tcl LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/trigger/CMakeLists.txt b/src/plugins/trigger/CMakeLists.txt index c0e9bb05b..cda979e7a 100644 --- a/src/plugins/trigger/CMakeLists.txt +++ b/src/plugins/trigger/CMakeLists.txt @@ -28,4 +28,4 @@ set_target_properties(trigger PROPERTIES PREFIX "") target_link_libraries(trigger coverage_config) -install(TARGETS trigger LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS trigger LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/xfer/CMakeLists.txt b/src/plugins/xfer/CMakeLists.txt index 74f2c456b..6619a93ab 100644 --- a/src/plugins/xfer/CMakeLists.txt +++ b/src/plugins/xfer/CMakeLists.txt @@ -42,4 +42,4 @@ endif() target_link_libraries(xfer ${LINK_LIBS} coverage_config) -install(TARGETS xfer LIBRARY DESTINATION ${LIBDIR}/plugins) +install(TARGETS xfer LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) |