-
Notifications
You must be signed in to change notification settings - Fork 2
/
FindMCSS.cmake
65 lines (54 loc) · 2.08 KB
/
FindMCSS.cmake
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
################################################################################
#
# \file FindMCSS.cmake
# \copyright 2012-2015 J. Bakosi,
# 2016-2018 Los Alamos National Security, LLC.,
# 2019-2021 Triad National Security, LLC.
# All rights reserved. See the LICENSE file for details.
# \brief Find m.css
#
################################################################################
# m.css: http://mcss.mosra.cz
#
# MCSS_FOUND - System has numdiff
# MCSS_DOX2HTML5 - The dox2html5 python script
#
# Usage:
#
# set(MCSS_ROOT "/path/to/custom/mcss") # prefer over system
# find_package(MCSS)
if(MCSS_DOX2HTML5 AND PYTHONINTERP_FOUND AND PYGMENTS_FOUND AND JINJA2_FOUND AND LATEX_FOUND)
# Already in cache, be silent
set (MCSS_FIND_QUIETLY TRUE)
endif()
if (PYTHONINTERP_FOUND)
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import pygments"
ERROR_VARIABLE PYGMENTS_STDERR)
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import jinja2"
ERROR_VARIABLE JINJA2_STDERR)
if (PYGMENTS_STDERR)
set(PYGMENTS_FOUND "false")
message(STATUS "Could NOT find Python module Pygments")
#message("${PYGMENTS_STDERR}")
else()
set(PYGMENTS_FOUND "true")
message(STATUS "Found Python module Pygments")
endif()
if (JINJA2_STDERR)
set(JINJA2_FOUND "false")
message(STATUS "Could NOT find Python module Jinja2")
#message("${JINJA2_STDERR}")
else()
set(JINJA2_FOUND "true")
message(STATUS "Found Python module Jinja2")
endif()
endif()
find_package(LATEX)
FIND_PROGRAM(MCSS_DOX2HTML5 NAMES dox2html5.py
PATHS ${MCSS_ROOT} $ENV{MCSS_ROOT}
PATH_SUFFIXES m.css/doxygen)
# Handle the QUIETLY and REQUIRED arguments and set MCSS_FOUND to TRUE if
# all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MCSS DEFAULT_MSG MCSS_DOX2HTML5 PYTHONINTERP_FOUND PYGMENTS_FOUND JINJA2_FOUND LATEX_FOUND)
MARK_AS_ADVANCED(MCSS_DOX2HTML5 PYTHONINTERP_FOUND PYGMENTS_FOUND JINJA2_FOUND LATEX_FOUND)