2009-06-02 13:11:16 +02:00
|
|
|
#
|
2021-01-02 21:34:16 +01:00
|
|
|
# Copyright (C) 2003-2021 Sébastien Helleu <flashcode@flashtux.org>
|
2010-06-22 19:46:28 +02:00
|
|
|
#
|
|
|
|
# This file is part of WeeChat, the extensible chat client.
|
|
|
|
#
|
|
|
|
# WeeChat is free software; you can redistribute it and/or modify
|
2009-06-02 13:11:16 +02:00
|
|
|
# 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.
|
|
|
|
#
|
2010-06-22 19:46:28 +02:00
|
|
|
# WeeChat is distributed in the hope that it will be useful,
|
2009-06-02 13:11:16 +02:00
|
|
|
# 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
|
2018-11-29 23:16:07 +01:00
|
|
|
# along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
|
2009-06-02 13:11:16 +02:00
|
|
|
#
|
|
|
|
|
2016-05-03 21:31:55 +02:00
|
|
|
# - Find Asciidoctor
|
2016-05-13 08:04:14 +02:00
|
|
|
# This module finds if asciidoctor (version 1.5.4 or newer) is installed.
|
2009-06-02 13:11:16 +02:00
|
|
|
|
2016-05-03 21:31:55 +02:00
|
|
|
if(ASCIIDOCTOR_FOUND)
|
2009-06-02 13:11:16 +02:00
|
|
|
# Already in cache, be silent
|
2016-05-03 21:31:55 +02:00
|
|
|
set(ASCIIDOCTOR_FIND_QUIETLY TRUE)
|
2014-04-12 18:00:27 +02:00
|
|
|
endif()
|
2009-06-02 13:11:16 +02:00
|
|
|
|
2014-04-12 18:00:27 +02:00
|
|
|
find_program(
|
2016-05-03 21:31:55 +02:00
|
|
|
ASCIIDOCTOR_EXECUTABLE asciidoctor
|
2009-06-02 13:11:16 +02:00
|
|
|
PATHS /bin /usr/bin /usr/local/bin /usr/pkg/bin
|
|
|
|
)
|
|
|
|
|
2016-05-03 21:31:55 +02:00
|
|
|
if(ASCIIDOCTOR_EXECUTABLE)
|
2014-04-12 18:00:27 +02:00
|
|
|
execute_process(
|
2016-05-03 21:31:55 +02:00
|
|
|
COMMAND ${ASCIIDOCTOR_EXECUTABLE} --version
|
|
|
|
OUTPUT_VARIABLE ASCIIDOCTOR_VERSION
|
2019-09-28 20:37:38 +02:00
|
|
|
)
|
2011-10-26 20:37:03 +02:00
|
|
|
|
2016-05-03 21:31:55 +02:00
|
|
|
string(REGEX REPLACE "^Asciidoctor ([^ ]+) .*" "\\1" ASCIIDOCTOR_VERSION "${ASCIIDOCTOR_VERSION}")
|
2015-01-12 21:53:34 +01:00
|
|
|
|
2016-05-13 08:04:14 +02:00
|
|
|
if(ASCIIDOCTOR_VERSION VERSION_EQUAL "1.5.4" OR ASCIIDOCTOR_VERSION VERSION_GREATER "1.5.4")
|
2016-05-03 21:31:55 +02:00
|
|
|
set(ASCIIDOCTOR_FOUND TRUE)
|
2014-04-12 18:00:27 +02:00
|
|
|
endif()
|
2011-10-26 20:37:03 +02:00
|
|
|
|
2014-04-12 18:00:27 +02:00
|
|
|
mark_as_advanced(
|
2016-05-03 21:31:55 +02:00
|
|
|
ASCIIDOCTOR_EXECUTABLE
|
|
|
|
ASCIIDOCTOR_VERSION
|
2019-09-28 20:37:38 +02:00
|
|
|
)
|
2014-04-12 18:00:27 +02:00
|
|
|
endif()
|