0027321: Configuration, CMake - check for doxygen during the first configuration...
authoribs <ibs@opencascade.com>
Wed, 30 Mar 2016 12:55:59 +0000 (15:55 +0300)
committerbugmaster <bugmaster@opencascade.com>
Mon, 11 Apr 2016 07:46:18 +0000 (10:46 +0300)
CMakeLists.txt
adm/cmake/doxygen.cmake

index a628ff9..29a6306 100644 (file)
@@ -316,7 +316,17 @@ if (ANDROID AND BUILD_MODULE_Draw)
 endif()
 
 # Overview
-set (BUILD_DOC_Overview OFF CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
+if (NOT DEFINED BUILD_DOC_Overview)
+  set (DO_ONLY_CHECK_FOR_DOXYGEN ON)
+  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen")
+  set (DO_ONLY_CHECK_FOR_DOXYGEN OFF)
+  
+  if (CAN_DOXYGEN_BE_USED)
+    message (STATUS "Info. Overview building is turned on")
+  endif()
+
+  set (BUILD_DOC_Overview ${CAN_DOXYGEN_BE_USED} CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
+endif()
 
 if (NOT USE_D3D)
   list (REMOVE_ITEM Visualization_TOOLKITS TKD3DHost)
index dabeb50..78966d7 100644 (file)
@@ -1,45 +1,57 @@
 # doxygen
 
-set (3RDPARTY_DOT_EXECUTABLE_DESCR       "The path to the 'dot' tool producing layered drawings of directed graphs.\nThis tool used by doxygen")
-set (3RDPARTY_DOXYGEN_EXECUTABLE_DESCR   "The path to the doxygen command")
-
-if (NOT DEFINED 3RDPARTY_DOXYGEN_EXECUTABLE)
-  set (3RDPARTY_DOXYGEN_EXECUTABLE "" CACHE FILEPATH "${3RDPARTY_DOXYGEN_EXECUTABLE_DESCR}")
-endif()
+if (DO_ONLY_CHECK_FOR_DOXYGEN)
+  message (STATUS "Info. Detecting doxygen")
+  set (DOXYGEN_SKIP_DOT ON)
+  find_package (Doxygen)
 
-if (NOT DEFINED 3RDPARTY_DOT_EXECUTABLE)
-  set (3RDPARTY_DOT_EXECUTABLE "" CACHE FILEPATH "${3RDPARTY_DOT_EXECUTABLE_DESCR}")
-endif()
+  set (CAN_DOXYGEN_BE_USED OFF)
+  if (DOXYGEN_EXECUTABLE)
+    set (CAN_DOXYGEN_BE_USED ON)
+    message (STATUS "Info. Doxygen is found and can be used")
+  endif()
+else()
+  set (3RDPARTY_DOT_EXECUTABLE_DESCR       "The path to the 'dot' tool producing layered drawings of directed graphs.\nThis tool used by doxygen")
+  set (3RDPARTY_DOXYGEN_EXECUTABLE_DESCR   "The path to the doxygen command")
 
-if (NOT DEFINED 3RDPARTY_SKIP_DOT_EXECUTABLE)
-  set (3RDPARTY_SKIP_DOT_EXECUTABLE OFF CACHE BOOL "Skip trying to find Dot")
-endif()
+  if (NOT DEFINED 3RDPARTY_DOXYGEN_EXECUTABLE)
+    set (3RDPARTY_DOXYGEN_EXECUTABLE "" CACHE FILEPATH "${3RDPARTY_DOXYGEN_EXECUTABLE_DESCR}")
+  endif()
 
-if (3RDPARTY_SKIP_DOT_EXECUTABLE)
-  OCCT_CHECK_AND_UNSET (3RDPARTY_DOT_EXECUTABLE)
-endif()
+  if (NOT DEFINED 3RDPARTY_DOT_EXECUTABLE)
+    set (3RDPARTY_DOT_EXECUTABLE "" CACHE FILEPATH "${3RDPARTY_DOT_EXECUTABLE_DESCR}")
+  endif()
 
-if (NOT 3RDPARTY_DOXYGEN_EXECUTABLE OR (NOT 3RDPARTY_SKIP_DOT_EXECUTABLE AND NOT 3RDPARTY_DOT_EXECUTABLE))
+  if (NOT DEFINED 3RDPARTY_SKIP_DOT_EXECUTABLE)
+    set (3RDPARTY_SKIP_DOT_EXECUTABLE ON CACHE BOOL "Skip trying to find Dot")
+  endif()
 
-  set (DOXYGEN_SKIP_DOT ${3RDPARTY_SKIP_DOT_EXECUTABLE})
-  find_package (Doxygen)
-  
-  if (NOT 3RDPARTY_DOXYGEN_EXECUTABLE AND DOXYGEN_EXECUTABLE)
-    set (3RDPARTY_DOXYGEN_EXECUTABLE "${DOXYGEN_EXECUTABLE}" CACHE FILEPATH "${3RDPARTY_DOXYGEN_EXECUTABLE_DESCR}" FORCE)
+  if (3RDPARTY_SKIP_DOT_EXECUTABLE)
+    OCCT_CHECK_AND_UNSET (3RDPARTY_DOT_EXECUTABLE)
   endif()
-  
-  if (NOT 3RDPARTY_SKIP_DOT_EXECUTABLE AND NOT 3RDPARTY_DOT_EXECUTABLE AND DOXYGEN_DOT_EXECUTABLE)
-    set (3RDPARTY_DOT_EXECUTABLE "${DOXYGEN_DOT_EXECUTABLE}" CACHE FILEPATH "${3RDPARTY_DOT_EXECUTABLE_DESCR}" FORCE)
+
+  if (NOT 3RDPARTY_DOXYGEN_EXECUTABLE OR (NOT 3RDPARTY_SKIP_DOT_EXECUTABLE AND NOT 3RDPARTY_DOT_EXECUTABLE))
+
+    set (DOXYGEN_SKIP_DOT ${3RDPARTY_SKIP_DOT_EXECUTABLE})
+    find_package (Doxygen)
+    
+    if (NOT 3RDPARTY_DOXYGEN_EXECUTABLE AND DOXYGEN_EXECUTABLE)
+      set (3RDPARTY_DOXYGEN_EXECUTABLE "${DOXYGEN_EXECUTABLE}" CACHE FILEPATH "${3RDPARTY_DOXYGEN_EXECUTABLE_DESCR}" FORCE)
+    endif()
+    
+    if (NOT 3RDPARTY_SKIP_DOT_EXECUTABLE AND NOT 3RDPARTY_DOT_EXECUTABLE AND DOXYGEN_DOT_EXECUTABLE)
+      set (3RDPARTY_DOT_EXECUTABLE "${DOXYGEN_DOT_EXECUTABLE}" CACHE FILEPATH "${3RDPARTY_DOT_EXECUTABLE_DESCR}" FORCE)
+    endif()
   endif()
-endif()
 
-if (NOT 3RDPARTY_DOXYGEN_EXECUTABLE OR NOT EXISTS "${3RDPARTY_DOXYGEN_EXECUTABLE}")
-  list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_DOXYGEN_EXECUTABLE)
-endif()
+  if (NOT 3RDPARTY_DOXYGEN_EXECUTABLE OR NOT EXISTS "${3RDPARTY_DOXYGEN_EXECUTABLE}")
+    list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_DOXYGEN_EXECUTABLE)
+  endif()
 
-if (NOT 3RDPARTY_SKIP_DOT_EXECUTABLE)
-  if (NOT 3RDPARTY_DOT_EXECUTABLE OR NOT EXISTS "${3RDPARTY_DOT_EXECUTABLE}")
-    list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_DOT_EXECUTABLE)
+  if (NOT 3RDPARTY_SKIP_DOT_EXECUTABLE)
+    if (NOT 3RDPARTY_DOT_EXECUTABLE OR NOT EXISTS "${3RDPARTY_DOT_EXECUTABLE}")
+      list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_DOT_EXECUTABLE)
+    endif()
   endif()
 endif()