Salome HOME
f3ff533239c555d88d1f642c5cba2fbc3658c673
[modules/kernel.git] / salome_adm / cmake_files / deprecated / FindDOXYGEN.cmake
1 # Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 # ------
24
25 MESSAGE(STATUS "Check for doxygen ...")
26
27 # ------
28
29 IF(DOXYGEN_IS_MANDATORY STREQUAL 0)
30   SET(DOXYGEN_IS_MANDATORY 0)
31   SET(DOXYGEN_IS_OPTIONAL 1)
32 ENDIF(DOXYGEN_IS_MANDATORY STREQUAL 0)
33 IF(DOXYGEN_IS_OPTIONAL STREQUAL 0)
34   SET(DOXYGEN_IS_MANDATORY 1)
35   SET(DOXYGEN_IS_OPTIONAL 0)
36 ENDIF(DOXYGEN_IS_OPTIONAL STREQUAL 0)
37 IF(NOT DOXYGEN_IS_MANDATORY AND NOT DOXYGEN_IS_OPTIONAL)
38   SET(DOXYGEN_IS_MANDATORY 0)
39   SET(DOXYGEN_IS_OPTIONAL 1)
40 ENDIF(NOT DOXYGEN_IS_MANDATORY AND NOT DOXYGEN_IS_OPTIONAL)
41
42 # ------
43
44 SET(DOXYGEN_STATUS 1)
45 IF(WITHOUT_DOXYGEN OR WITH_DOXYGEN STREQUAL 0)
46   SET(DOXYGEN_STATUS 0)
47   MESSAGE(STATUS "doxygen disabled from command line.")
48 ENDIF(WITHOUT_DOXYGEN OR WITH_DOXYGEN STREQUAL 0)
49
50 # ------
51
52 IF(DOXYGEN_STATUS)
53   IF(WITH_DOXYGEN)
54     SET(DOXYGEN_ROOT_USER ${WITH_DOXYGEN})
55   ENDIF(WITH_DOXYGEN)
56   IF(NOT DOXYGEN_ROOT_USER)
57     SET(DOXYGEN_ROOT_USER $ENV{DOXYGEN_ROOT})
58   ENDIF(NOT DOXYGEN_ROOT_USER)
59   IF(NOT DOXYGEN_ROOT_USER)
60     SET(DOXYGEN_ROOT_USER $ENV{DOXYGENHOME})
61   ENDIF(NOT DOXYGEN_ROOT_USER)
62 ENDIF(DOXYGEN_STATUS)
63
64 # ------
65
66 IF(DOXYGEN_STATUS)
67   SET(DOXYGEN_EXECUTABLE_TO_FIND doxygen)
68   IF(DOXYGEN_ROOT_USER)
69     FIND_PROGRAM(DOXYGEN_EXECUTABLE ${DOXYGEN_EXECUTABLE_TO_FIND} PATHS ${DOXYGEN_ROOT_USER}/bin NO_DEFAULT_PATH)
70   ELSE(DOXYGEN_ROOT_USER)
71     FIND_PROGRAM(DOXYGEN_EXECUTABLE ${DOXYGEN_EXECUTABLE_TO_FIND})
72   ENDIF(DOXYGEN_ROOT_USER)
73   IF(DOXYGEN_EXECUTABLE)
74     MESSAGE(STATUS "${DOXYGEN_EXECUTABLE_TO_FIND} found: ${DOXYGEN_EXECUTABLE}")
75   ELSE(DOXYGEN_EXECUTABLE)
76     MESSAGE(STATUS "${DOXYGEN_EXECUTABLE_TO_FIND} not found, try to use WITH_DOXYGEN option or DOXYGEN_ROOT (or DOXYGENHOME) environment variable")
77     SET(DOXYGEN_STATUS 0)
78   ENDIF(DOXYGEN_EXECUTABLE)
79 ENDIF(DOXYGEN_STATUS)
80
81 # ----
82
83 IF(DOXYGEN_STATUS)
84   SET(DOXYGEN_IS_OK 1)
85 ELSE(DOXYGEN_STATUS)
86   SET(DOXYGEN_IS_OK 0)
87   IF(DOXYGEN_IS_MANDATORY)
88     MESSAGE(FATAL_ERROR "doxygen not found ... mandatory ... abort")
89   ELSE(DOXYGEN_IS_MANDATORY)
90     MESSAGE(STATUS "doxygen not found ... optional ... disabled")
91   ENDIF(DOXYGEN_IS_MANDATORY)
92 ENDIF(DOXYGEN_STATUS)
93
94 # ----