summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 4fa0c31ffcebd31f778bf139ec182f1d59235a03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Copyright (c) 2003-2008 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

PROJECT(weechat)

SET(CMAKE_VERBOSE_MAKEFILE OFF)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
SET(CMAKE_SKIP_RPATH ON)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W")
IF(PREFIX)
  SET(CMAKE_INSTALL_PREFIX ${PREFIX} CACHE PATH "Install path prefix" FORCE)
ENDIF(PREFIX)

SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "2")
SET(VERSION_PATCH "7-dev")
SET(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
SET(PKG_STRING "${PROJECT_NAME} ${VERSION}")
SET(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/weechat)
SET(SHAREDIR ${CMAKE_INSTALL_PREFIX}/share/weechat)
SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
STRING(REPLACE "\";\"" "\ " PKG_STRING ${PKG_STRING})

OPTION(DISABLE_NCURSES       "Disable Ncurses interface")
OPTION(ENABLE_GTK            "Enable GTK interface")
OPTION(DISABLE_NLS           "Disable Native Language Support")
OPTION(DISABLE_GNUTLS        "Disable SSLv3/TLS connection support")
OPTION(DISABLE_ALIAS         "Disable Alias plugin")
OPTION(DISABLE_ASPELL        "Disable Aspell plugin")
OPTION(DISABLE_CHARSET       "Disable Charset plugin")
OPTION(DISABLE_DEBUG         "Disable Debug plugin")
OPTION(ENABLE_DEMO           "Enable Demo plugin")
OPTION(DISABLE_FIFO          "Disable FIFO plugin")
OPTION(DISABLE_IRC           "Disable IRC plugin")
OPTION(DISABLE_LOGGER        "Disable Logger plugin")
OPTION(DISABLE_SCRIPTS       "Disable script plugins")
OPTION(DISABLE_PERL          "Disable Perl scripting language")
OPTION(DISABLE_PYTHON        "Disable Python scripting language")
OPTION(DISABLE_RUBY          "Disable Ruby scripting language")
OPTION(DISABLE_LUA           "Disable Lua scripting language")
OPTION(DISABLE_TRIGGER       "Disable Trigger plugin")
OPTION(DISABLE_XFER          "Disable Xfer (file transfert) plugin")
OPTION(DISABLE_DOC           "Disable Doc")
OPTION(DISABLE_COMPILE_DEBUG "Disable debug info in object files")

IF(NOT DISABLE_COMPILE_DEBUG)
  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
ENDIF(NOT DISABLE_COMPILE_DEBUG)

ADD_SUBDIRECTORY( po )
ADD_SUBDIRECTORY( src )
IF(NOT DISABLE_DOC)
  ADD_SUBDIRECTORY( doc )
ENDIF(NOT DISABLE_DOC)

CONFIGURE_FILE(config.h.cmake config.h @ONLY)

CONFIGURE_FILE(
  "${CMAKE_CURRENT_SOURCE_DIR}/cmake/makedist.sh.in"
  "${CMAKE_CURRENT_BINARY_DIR}/makedist.sh" IMMEDIATE
  @ONLY)

CONFIGURE_FILE(
  "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  IMMEDIATE @ONLY)

ADD_CUSTOM_TARGET(uninstall
  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")

ADD_CUSTOM_TARGET(dist
  "${CMAKE_BINARY_DIR}/makedist.sh"
  DEPENDS doc
  WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

# packages
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Fast, light and extensible chat client")
SET(CPACK_PACKAGE_VENDOR "FlashCode")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})

# binary package
SET(CPACK_GENERATOR "STGZ;TGZ;TBZ2")
SET(CPACK_PACKAGE_FILE_NAME weechat-binary-${VERSION})

# source package
SET(CPACK_SOURCE_GENERATOR "TGZ;TBZ2")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME weechat-${VERSION})
SET(CPACK_SOURCE_IGNORE_FILES "/\\\\.git" "/build/" "/m4/"
  "/autom4te\\\\.cache/" "/ABOUT-NLS$" "/config\\\\.guess$" "/config\\\\.h$"
  "/config\\\\.h.in$" "/config\\\\.log$" "/config\\\\.rpath$"
  "/config\\\\.status$" "/config\\\\.sub$" "/configure$" "/depcomp$"
  "/install-sh$" "/missing$" "/intl/" "/libtool$" "/\\\\.libs/"
  "/ltmain\\\\.sh$" "/\\\\.deps/" "/date\\\\.xml$" "/html/" "/html1/"
  "\\\\.pdf$" "/Makefile$" "/Makefile\\\\.in$" "stamp" "/po/.*\\\\.header$"
  "\\\\.gmo$" "~$" "\\\\.o$" "\\\\.lo$" "\\\\.a$" "\\\\.la$" "\\\\.lai$"
  "\\\\.Plo$" "/weechat-curses$" "/weechat-gtk$"
)

INCLUDE(CPack)