]> SALOME platform Git repositories - modules/kernel.git/blob - salome_adm/cmake_files/FindDOXYGEN.cmake
Salome HOME
*** empty log message ***
[modules/kernel.git] / salome_adm / cmake_files / FindDOXYGEN.cmake
1 #  Copyright (C) 2007-2008  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.
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 MESSAGE(STATUS "Check for doxygen ...")
25
26 # ------
27
28 IF(DOXYGEN_IS_MANDATORY STREQUAL 0)
29   SET(DOXYGEN_IS_MANDATORY 0)
30   SET(DOXYGEN_IS_OPTIONAL 1)
31 ENDIF(DOXYGEN_IS_MANDATORY STREQUAL 0)
32 IF(DOXYGEN_IS_OPTIONAL STREQUAL 0)
33   SET(DOXYGEN_IS_MANDATORY 1)
34   SET(DOXYGEN_IS_OPTIONAL 0)
35 ENDIF(DOXYGEN_IS_OPTIONAL STREQUAL 0)
36 IF(NOT DOXYGEN_IS_MANDATORY AND NOT DOXYGEN_IS_OPTIONAL)
37   SET(DOXYGEN_IS_MANDATORY 0)
38   SET(DOXYGEN_IS_OPTIONAL 1)
39 ENDIF(NOT DOXYGEN_IS_MANDATORY AND NOT DOXYGEN_IS_OPTIONAL)
40
41 # ------
42
43 SET(DOXYGEN_STATUS 1)
44 IF(WITHOUT_DOXYGEN OR WITH_DOXYGEN STREQUAL 0)
45   SET(DOXYGEN_STATUS 0)
46   MESSAGE(STATUS "doxygen disabled from command line.")
47 ENDIF(WITHOUT_DOXYGEN OR WITH_DOXYGEN STREQUAL 0)
48
49 # ------
50
51 IF(DOXYGEN_STATUS)
52   IF(WITH_DOXYGEN)
53     SET(DOXYGEN_ROOT_USER ${WITH_DOXYGEN})
54   ENDIF(WITH_DOXYGEN)
55   IF(NOT DOXYGEN_ROOT_USER)
56     SET(DOXYGEN_ROOT_USER $ENV{DOXYGEN_ROOT})
57   ENDIF(NOT DOXYGEN_ROOT_USER)
58   IF(NOT DOXYGEN_ROOT_USER)
59     SET(DOXYGEN_ROOT_USER $ENV{DOXYGENHOME})
60   ENDIF(NOT DOXYGEN_ROOT_USER)
61 ENDIF(DOXYGEN_STATUS)
62
63 # ------
64
65 IF(DOXYGEN_STATUS)
66   SET(DOXYGEN_EXECUTABLE_TO_FIND doxygen)
67   IF(DOXYGEN_ROOT_USER)
68     FIND_PROGRAM(DOXYGEN_EXECUTABLE ${DOXYGEN_EXECUTABLE_TO_FIND} PATHS ${DOXYGEN_ROOT_USER}/bin NO_DEFAULT_PATH)
69   ELSE(DOXYGEN_ROOT_USER)
70     FIND_PROGRAM(DOXYGEN_EXECUTABLE ${DOXYGEN_EXECUTABLE_TO_FIND})
71   ENDIF(DOXYGEN_ROOT_USER)
72   IF(DOXYGEN_EXECUTABLE)
73     MESSAGE(STATUS "${DOXYGEN_EXECUTABLE_TO_FIND} found: ${DOXYGEN_EXECUTABLE}")
74   ELSE(DOXYGEN_EXECUTABLE)
75     MESSAGE(STATUS "${DOXYGEN_EXECUTABLE_TO_FIND} not found, try to use WITH_DOXYGEN option or DOXYGEN_ROOT (or DOXYGENHOME) environment variable")
76     SET(DOXYGEN_STATUS 0)
77   ENDIF(DOXYGEN_EXECUTABLE)
78 ENDIF(DOXYGEN_STATUS)
79
80 # ----
81
82 IF(DOXYGEN_STATUS)
83   SET(DOXYGEN_IS_OK 1)
84 ELSE(DOXYGEN_STATUS)
85   SET(DOXYGEN_IS_OK 0)
86   IF(DOXYGEN_IS_MANDATORY)
87     MESSAGE(FATAL_ERROR "doxygen not found ... mandatory ... abort")
88   ELSE(DOXYGEN_IS_MANDATORY)
89     MESSAGE(STATUS "doxygen not found ... optional ... disabled")
90   ENDIF(DOXYGEN_IS_MANDATORY)
91 ENDIF(DOXYGEN_STATUS)
92
93 # ----