Blob Blame History Raw
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3e1c9f..ae867ee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,27 +37,13 @@ SET(VERSION_PATCH "3")
 SET(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
 SET(LICENSE "GPL3")
 SET(PKG_STRING "${PROJECT_NAME} ${VERSION}")
-STRING(REPLACE "\";\"" "\ " PKG_STRING ${PKG_STRING})
-
-IF(DEFINED LIBDIR)
-  SET(LIBDIR ${LIBDIR}/${PROJECT_NAME})
-ELSE(DEFINED LIBDIR)
-  SET(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME})
-ENDIF(DEFINED LIBDIR)
 
-IF(NOT DEFINED SHAREDIR)
-  SET(SHAREDIR ${CMAKE_INSTALL_PREFIX}/share)
-ENDIF(NOT DEFINED SHAREDIR)
+SET(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${PROJECT_NAME})
+SET(SHAREDIR ${CMAKE_INSTALL_PREFIX}/share)
+SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
+SET(INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})
 
-IF(NOT DEFINED LOCALEDIR)
-  SET(LOCALEDIR ${SHAREDIR}/locale)
-ENDIF(NOT DEFINED LOCALEDIR)
-
-IF(DEFINED INCLUDEDIR)
-  SET(INCLUDEDIR ${INCLUDEDIR}/${PROJECT_NAME})
-ELSE(DEFINED INCLUDEDIR)
-  SET(INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})
-ENDIF(DEFINED INCLUDEDIR)
+STRING(REPLACE "\";\"" "\ " PKG_STRING ${PKG_STRING})
 
 OPTION(DISABLE_NCURSES       "Disable Ncurses interface")
 OPTION(ENABLE_GTK            "Enable GTK interface")
@@ -113,10 +99,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 "\${exec_prefix}/lib${LIB_SUFFIX}")
 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 ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig)
 
 # packages
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Fast, light and extensible chat client")
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index 80bcbad..e329c30 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -27,6 +27,8 @@ plugin-config.h plugin-config.c)
 INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
 ADD_LIBRARY(weechat_plugins STATIC ${LIB_PLUGINS_SRC})
 
+SET(PLUGIN_INSTALL_DIR lib${LIB_SUFFIX}/${PROJECT_NAME}/plugins)
+
 INCLUDE(CheckIncludeFiles)
 INCLUDE(CheckFunctionExists)
 INCLUDE(CheckLibraryExists)
diff --git a/src/plugins/alias/CMakeLists.txt b/src/plugins/alias/CMakeLists.txt
index 70bf295..c71cebb 100644
--- a/src/plugins/alias/CMakeLists.txt
+++ b/src/plugins/alias/CMakeLists.txt
@@ -25,4 +25,4 @@ SET_TARGET_PROPERTIES(alias PROPERTIES PREFIX "")
 
 TARGET_LINK_LIBRARIES(alias)
 
-INSTALL(TARGETS alias LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS alias LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/aspell/CMakeLists.txt b/src/plugins/aspell/CMakeLists.txt
index 894fba0..b0a273a 100644
--- a/src/plugins/aspell/CMakeLists.txt
+++ b/src/plugins/aspell/CMakeLists.txt
@@ -29,4 +29,4 @@ IF(ASPELL_FOUND)
   TARGET_LINK_LIBRARIES(aspell ${ASPELL_LIBRARY})
 ENDIF(ASPELL_FOUND)
 
-INSTALL(TARGETS aspell LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS aspell LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/charset/CMakeLists.txt b/src/plugins/charset/CMakeLists.txt
index 64ce12c..f93d142 100644
--- a/src/plugins/charset/CMakeLists.txt
+++ b/src/plugins/charset/CMakeLists.txt
@@ -29,4 +29,4 @@ IF(ICONV_FOUND)
   ENDIF(ICONV_LIBRARY)
 ENDIF(ICONV_FOUND)
 
-INSTALL(TARGETS charset LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS charset LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/demo/CMakeLists.txt b/src/plugins/demo/CMakeLists.txt
index 7658ec3..d1f0534 100644
--- a/src/plugins/demo/CMakeLists.txt
+++ b/src/plugins/demo/CMakeLists.txt
@@ -22,4 +22,4 @@ SET_TARGET_PROPERTIES(demo PROPERTIES PREFIX "")
 
 TARGET_LINK_LIBRARIES(demo)
 
-INSTALL(TARGETS demo LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS demo LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/fifo/CMakeLists.txt b/src/plugins/fifo/CMakeLists.txt
index f41af5a..eec83db 100644
--- a/src/plugins/fifo/CMakeLists.txt
+++ b/src/plugins/fifo/CMakeLists.txt
@@ -24,4 +24,4 @@ SET_TARGET_PROPERTIES(fifo PROPERTIES PREFIX "")
 
 TARGET_LINK_LIBRARIES(fifo)
 
-INSTALL(TARGETS fifo LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS fifo LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/irc/CMakeLists.txt b/src/plugins/irc/CMakeLists.txt
index d751b90..a1c9b11 100644
--- a/src/plugins/irc/CMakeLists.txt
+++ b/src/plugins/irc/CMakeLists.txt
@@ -58,4 +58,4 @@ ENDIF(GCRYPT_FOUND)
 
 TARGET_LINK_LIBRARIES(irc ${LINK_LIBS})
 
-INSTALL(TARGETS irc LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS irc LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/logger/CMakeLists.txt b/src/plugins/logger/CMakeLists.txt
index 6cd9b6c..aa74495 100644
--- a/src/plugins/logger/CMakeLists.txt
+++ b/src/plugins/logger/CMakeLists.txt
@@ -27,4 +27,4 @@ SET_TARGET_PROPERTIES(logger PROPERTIES PREFIX "")
 
 TARGET_LINK_LIBRARIES(logger)
 
-INSTALL(TARGETS logger LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS logger LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/relay/CMakeLists.txt b/src/plugins/relay/CMakeLists.txt
index 9a36b5e..26bd162 100644
--- a/src/plugins/relay/CMakeLists.txt
+++ b/src/plugins/relay/CMakeLists.txt
@@ -33,4 +33,4 @@ SET_TARGET_PROPERTIES(relay PROPERTIES PREFIX "")
 
 TARGET_LINK_LIBRARIES(relay)
 
-INSTALL(TARGETS relay LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS relay LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/scripts/lua/CMakeLists.txt b/src/plugins/scripts/lua/CMakeLists.txt
index 6c050d9..6779052 100644
--- a/src/plugins/scripts/lua/CMakeLists.txt
+++ b/src/plugins/scripts/lua/CMakeLists.txt
@@ -32,4 +32,4 @@ IF(LUA_FOUND)
   ENDIF(LUA_LIBRARY AND LUALIB_LIBRARY)
 ENDIF(LUA_FOUND)
 
-INSTALL(TARGETS lua LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS lua LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/scripts/perl/CMakeLists.txt b/src/plugins/scripts/perl/CMakeLists.txt
index 36ca082..85aa791 100644
--- a/src/plugins/scripts/perl/CMakeLists.txt
+++ b/src/plugins/scripts/perl/CMakeLists.txt
@@ -38,4 +38,4 @@ IF(PERL_FOUND)
   ENDIF(PERL_DYNALOADER)
 ENDIF(PERL_FOUND)
 
-INSTALL(TARGETS perl LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS perl LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/scripts/python/CMakeLists.txt b/src/plugins/scripts/python/CMakeLists.txt
index 4cd7f56..1237251 100644
--- a/src/plugins/scripts/python/CMakeLists.txt
+++ b/src/plugins/scripts/python/CMakeLists.txt
@@ -28,4 +28,4 @@ IF(PYTHON_FOUND)
   TARGET_LINK_LIBRARIES(python ${PYTHON_LIBRARY} weechat_scripts)
 ENDIF(PYTHON_FOUND)
 
-INSTALL(TARGETS python LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS python LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/scripts/ruby/CMakeLists.txt b/src/plugins/scripts/ruby/CMakeLists.txt
index e6b7697..949ba93 100644
--- a/src/plugins/scripts/ruby/CMakeLists.txt
+++ b/src/plugins/scripts/ruby/CMakeLists.txt
@@ -27,4 +27,4 @@ IF(RUBY_FOUND)
   TARGET_LINK_LIBRARIES(ruby ${RUBY_LIBRARY} weechat_scripts)
 ENDIF(RUBY_FOUND)
 
-INSTALL(TARGETS ruby LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS ruby LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/scripts/tcl/CMakeLists.txt b/src/plugins/scripts/tcl/CMakeLists.txt
index 6c5b552..09cec7f 100644
--- a/src/plugins/scripts/tcl/CMakeLists.txt
+++ b/src/plugins/scripts/tcl/CMakeLists.txt
@@ -34,4 +34,4 @@ IF(TCL_FOUND)
 
 ENDIF(TCL_FOUND)
 
-INSTALL(TARGETS tcl LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS tcl LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/xfer/CMakeLists.txt b/src/plugins/xfer/CMakeLists.txt
index 6ec34d3..453f2a2 100644
--- a/src/plugins/xfer/CMakeLists.txt
+++ b/src/plugins/xfer/CMakeLists.txt
@@ -33,4 +33,4 @@ SET_TARGET_PROPERTIES(xfer PROPERTIES PREFIX "")
 
 TARGET_LINK_LIBRARIES(xfer)
 
-INSTALL(TARGETS xfer LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS xfer LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})