ADD_DEFINITIONS("-DVERSION=\\\"${VERSION}\\\"")
ADD_DEFINITIONS("-DMUTTLOCALEDIR=\\\"${DATADIR}/locale\\\"")
-OPTION(WITH_MAILPATH "Where new mail is spooled")
+SET(MAILPATH CACHE STRING "Where new mail is spooled")
OPTION(WITH_GPGME "Use GPGME [default: on]" ON)
OPTION(WITH_NNTP "Build NNTP support [default: off]")
OPTION(WITH_IDN "Use GNU libidn for domain names [default: off]")
OPTION(USE_FCNTL "Use fcntl to lock files [default: on]" ON)
OPTION(USE_HCACHE "Enable headers caching [default: off]")
-FIND_FILE(GPERF gperf)
-FIND_FILE(SENDMAIL sendmail PATHS /usr/sbin /sbin /usr/lib)
-FIND_FILE(MIXMASTER mixmaster)
-
-IF(WITH_MAILPATH)
- SET(MAILPATH ${WITH_MAILPATH})
-ELSEIF(EXISTS /var/mail)
- SET(MAILPATH "/var/mail")
-ELSEIF(EXISTS /var/spool/mail)
- SET(MAILPATH "/var/spool/mail")
-ELSEIF(EXISTS /usr/spool/mail)
- SET(MAILPATH "/usr/spool/mail")
-ELSEIF(EXISTS /usr/mail)
- SET(MAILPATH "/usr/mail")
-ENDIF(WITH_MAILPATH)
+FIND_FILE(SENDMAIL sendmail
+ PATHS /usr/sbin /sbin /usr/lib
+ DOC "path to sendmail executable"
+)
+FIND_FILE(MIXMASTER mixmaster DOC "path to mixmaster")
+IF(NOT MIXMASTER)
+ SET(MIXMASTER "mixmaster")
+ENDIF(NOT MIXMASTER)
+
+IF(NOT MAILPATH)
+ IF(EXISTS /var/mail)
+ SET(MAILPATH "/var/mail")
+ ELSEIF(EXISTS /var/spool/mail)
+ SET(MAILPATH "/var/spool/mail")
+ ELSEIF(EXISTS /usr/spool/mail)
+ SET(MAILPATH "/usr/spool/mail")
+ ELSEIF(EXISTS /usr/mail)
+ SET(MAILPATH "/usr/mail")
+ ELSE(EXISTS /var/mail)
+ MESSAGE(FATAL_ERROR "Unable to determine MAILPATH")
+ ENDIF(EXISTS /var/mail)
+ENDIF(NOT MAILPATH)
# headers {{{
INCLUDE(CheckIncludeFile)
SET(MUTTLIBS "${MUTTLIBS} -lesmtp")
ENDIF(WITH_LIBESMTP)
-IF(WITH_NNTP)
+IF(WITH_NNTP AND NOT USE_NNTP)
SET(USE_NNTP 1)
MESSAGE(STATUS "building NNTP support")
-ENDIF(WITH_NNTP)
+ENDIF(WITH_NNTP AND NOT USE_NNTP)
# }}}
# C flags {{{
-#./autogen.sh
-#./configure -C --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
-# --with-sharedir=/usr/share/mutt-ng --with-docdir=/usr/share/doc/mutt-ng \
-# --with-mailpath=/var/mail --enable-fcntl --with-idn --with-curses --enable-nntp \
-# --with-libesmtp --enable-gpgme --enable-hcache --enable-doc
-
-cmake -D WITH_NNTP=1 -D WITH_IDN=1 -D USE_HCACHE=1 -D WITH_LIBESMTP=1 .
+cmake -D WITH_NNTP=1 -D WITH_IDN=1 -D USE_HCACHE=1 -D WITH_LIBESMTP=1 --with-prefix=/usr $(dirname $0)