Skip to content

Commit 7ed9088

Browse files
committed
[doxygen] Added support for doxygen external search.
llvm-svn: 189507
1 parent 9cc5a45 commit 7ed9088

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

llvm/cmake/config-ix.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,8 @@ if (LLVM_ENABLE_DOXYGEN)
473473
if (LLVM_BUILD_DOCS)
474474
add_custom_target(doxygen ALL)
475475
endif()
476+
option(DOXYGEN_EXTERNAL_SEARCH "Enable doxygen external search." OFF)
477+
set(DOXYGEN_SEARCH_MAPPINGS "" CACHE STRING "Doxygen Search Mappings")
476478
endif()
477479
else()
478480
message(STATUS "Doxygen disabled.")

llvm/docs/CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@ if (LLVM_ENABLE_DOXYGEN)
77
if (HAVE_DOT)
88
set(DOT ${LLVM_PATH_DOT})
99
endif()
10+
11+
if (DOXYGEN_EXTERNAL_SEARCH)
12+
set(SEARCHENGINE "YES")
13+
set(SERVER_BASED_SEARCH "YES")
14+
set(EXTERNAL_SEARCH "YES")
15+
16+
set(EXTRA_SEARCH_MAPPINGS "")
17+
foreach(NameAndValue ${DOXYGEN_SEARCH_MAPPINGS})
18+
# Strip leading spaces
19+
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
20+
# Find variable name
21+
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
22+
# Find the value
23+
string(REPLACE "${Name}=" "" Value ${NameAndValue})
24+
# Set the variable
25+
if (NOT ${Name} EQUALS llvm)
26+
set(EXTRA_SEARCH_MAPPINGS "${EXTRA_SEARCH_MAPPINGS} ${LLVM_BINARY_DIR}/${NameAndValue}")
27+
endif()
28+
endforeach()
29+
else()
30+
set(SEARCHENGINE "NO")
31+
set(SERVER_BASED_SEARCH "NO")
32+
set(EXTERNAL_SEARCH "NO")
33+
set(EXTRA_SEARCH_MAPPINGS "")
34+
endif()
1035

1136
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in
1237
${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY)

llvm/docs/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
1919
-e 's/@abs_top_srcdir@/../g' \
2020
-e 's/@DOT@/dot/g' \
2121
-e 's/@PACKAGE_VERSION@/mainline/' \
22-
-e 's/@abs_top_builddir@/../g' > $@
22+
-e 's/@abs_top_builddir@/../g' \
23+
-e 's/@enable_searchengine@/NO/g' \
24+
-e 's/@enable_server_based_search@/NO/g' \
25+
-e 's/@enable_external_search@/NO/g' \
26+
-e 's/@extra_search_mappings@/NO/g' > $@
2327
endif
2428

2529
include $(LEVEL)/Makefile.common

llvm/docs/doxygen.cfg.in

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# Doxyfile 1.7.1
23

34
# This file describes the settings to be used by the documentation system
@@ -1068,7 +1069,7 @@ FORMULA_TRANSPARENT = YES
10681069
# typically be disabled. For large projects the javascript based search engine
10691070
# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
10701071

1071-
SEARCHENGINE = NO
1072+
SEARCHENGINE = @enable_searchengine@
10721073

10731074
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
10741075
# implemented using a PHP enabled web server instead of at the web client
@@ -1078,7 +1079,13 @@ SEARCHENGINE = NO
10781079
# full text search. The disadvances is that it is more difficult to setup
10791080
# and does not have live searching capabilities.
10801081

1081-
SERVER_BASED_SEARCH = NO
1082+
SERVER_BASED_SEARCH = @enable_server_based_search@
1083+
1084+
EXTERNAL_SEARCH = @enable_external_search@
1085+
1086+
EXTERNAL_SEARCH_ID = llvm
1087+
1088+
EXTRA_SEARCH_MAPPINGS = @extra_search_mappings@
10821089

10831090
#---------------------------------------------------------------------------
10841091
# configuration options related to the LaTeX output

0 commit comments

Comments
 (0)