]> granicus.if.org Git - clang/commitdiff
[doxygen] Add a few missing variables to the doxygen.cfg.in for external search and...
authorMichael Gottesman <mgottesman@apple.com>
Wed, 28 Aug 2013 21:55:41 +0000 (21:55 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Wed, 28 Aug 2013 21:55:41 +0000 (21:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189523 91177308-0d34-0410-b5e6-96231b3b80d8

docs/CMakeLists.txt
docs/Makefile
docs/doxygen.cfg.in

index 4e4cf433a18787a5bed03117bd4f901bb7a16f5c..8528c7af584096b48f88b82b9b266a98fcd1880a 100644 (file)
@@ -2,42 +2,37 @@
 if (DOXYGEN_FOUND)
 if (LLVM_ENABLE_DOXYGEN)
   set(abs_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
-  set(abs_builddir ${LLVM_BINARY_DIR})
+  set(abs_builddir ${CMAKE_CURRENT_BINARY_DIR})
 
   if (HAVE_DOT)
     set(DOT ${LLVM_PATH_DOT})
   endif()
 
-  if (DOXYGEN_EXTERNAL_SEARCH)
-    set(SEARCHENGINE "YES")
-    set(SERVER_BASED_SEARCH "YES")
-    set(EXTERNAL_SEARCH "YES")
-
-    set(EXTRA_SEARCH_MAPPINGS "")
-    foreach(NameAndValue ${DOXYGEN_SEARCH_MAPPINGS})
-      # Strip leading spaces
-      string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
-      # Find variable name
-      string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
-      # Find the value
-      string(REPLACE "${Name}=" "" Value ${NameAndValue})
-      # Set the variable
-      if (NOT ${Name} EQUALS clang)
-       set(EXTRA_SEARCH_MAPPINGS "${EXTRA_SEARCH_MAPPINGS} ${LLVM_BINARY_DIR}/${NameAndValue}")
-      endif()
-    endforeach()
+  if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
+    set(enable_searchengine "YES")
+    set(searchengine_url "${LLVM_DOXYGEN_SEARCHENGINE_URL}")
+    set(enable_server_based_search "YES")
+    set(enable_external_search "YES")
+    set(extra_search_mappings "${LLVM_DOXYGEN_SEARCH_MAPPINGS}")
   else()
-    set(SEARCHENGINE "NO")
-    set(SERVER_BASED_SEARCH "NO")
-    set(EXTERNAL_SEARCH "NO")
-    set(EXTRA_SEARCH_MAPPINGS "")
+    set(enable_searchengine "NO")
+    set(searchengine_url "")
+    set(enable_server_based_search "NO")
+    set(enable_external_search "NO")
+    set(extra_search_mappings "")
   endif()
 
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in
     ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY)
-  set(abs_srcdir)
-  set(abs_builddir)
+
+  set(abs_top_srcdir)
+  set(abs_top_builddir)
   set(DOT)
+  set(enable_searchengine)
+  set(searchengine_url)
+  set(enable_server_based_search)
+  set(enable_external_search)
+  set(extra_search_mappings)
 
   add_custom_target(doxygen-clang
     COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
index 0723ac986be1cea61ccaa75b11862c526ee4b359..5e14fac0a9c2d66946bb3eb1732d1100a2e1282f 100644 (file)
@@ -21,9 +21,10 @@ $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
          -e 's/@PACKAGE_VERSION@/mainline/' \
          -e 's/@abs_builddir@/./g' \
          -e 's/@enable_searchengine@/NO/g' \
-          -e 's/@enable_server_based_search@/NO/g' \
+         -e 's/@searchengine_url@//g' \
+         -e 's/@enable_server_based_search@/NO/g' \
          -e 's/@enable_external_search@/NO/g' \
-         -e 's/@extra_search_mappings@/NO/g' > $@
+         -e 's/@extra_search_mappings@//g' > $@
 endif
 
 include $(CLANG_LEVEL)/Makefile
index 497d4bfdf6471ee2b357e0abdea13d117d920cbf..61c0bd847f8a028a6f4f7b3b6020efb2c9000d3d 100644 (file)
@@ -1224,10 +1224,27 @@ DOT_CLEANUP            = YES
 # Configuration::additions related to the search engine   
 #---------------------------------------------------------------------------
 
-# The SEARCHENGINE tag specifies whether or not a search engine should be 
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE           = @enable_server_based_search@
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = @enable_searchengine@
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvances is that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = @enable_server_based_search@
+
+SEARCHENGINE_URL       = @searchengine_url@
 
 EXTERNAL_SEARCH        = @enable_external_search@