Skip to content

Commit 406525d

Browse files
committed
[doxygen] Use correct variable names for external variable configuration and make EXTRA_SEARCH_MAPPINGS a "dumb" variable.
I do not think the massaging that I was doing for EXTRA_SEARCH_MAPPINGS was truly necessary. llvm-svn: 189522
1 parent 501ecf9 commit 406525d

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

llvm/cmake/config-ix.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,12 @@ 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")
476+
477+
option(LLVM_DOXYGEN_EXTERNAL_SEARCH "Enable doxygen external search." OFF)
478+
if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
479+
set(LLVM_DOXYGEN_SEARCHENGINE_URL "" CACHE STRING "URL to use for external searhc.")
480+
set(LLVM_DOXYGEN_SEARCH_MAPPINGS "" CACHE STRING "Doxygen Search Mappings")
481+
endif()
478482
endif()
479483
else()
480484
message(STATUS "Doxygen disabled.")

llvm/docs/CMakeLists.txt

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,31 @@ if (LLVM_ENABLE_DOXYGEN)
88
set(DOT ${LLVM_PATH_DOT})
99
endif()
1010

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()
11+
if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
12+
set(enable_searchengine "YES")
13+
set(searchengine_url "${LLVM_DOXYGEN_SEARCHENGINE_URL}")
14+
set(enable_server_based_search "YES")
15+
set(enable_external_search "YES")
16+
set(extra_search_mappings "${LLVM_DOXYGEN_SEARCH_MAPPINGS}")
2917
else()
30-
set(SEARCHENGINE "NO")
31-
set(SERVER_BASED_SEARCH "NO")
32-
set(EXTERNAL_SEARCH "NO")
33-
set(EXTRA_SEARCH_MAPPINGS "")
18+
set(enable_searchengine "NO")
19+
set(searchengine_url "")
20+
set(enable_server_based_search "NO")
21+
set(enable_external_search "NO")
22+
set(extra_search_mappings "")
3423
endif()
3524

3625
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in
3726
${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY)
27+
3828
set(abs_top_srcdir)
3929
set(abs_top_builddir)
4030
set(DOT)
31+
set(enable_searchengine)
32+
set(searchengine_url)
33+
set(enable_server_based_search)
34+
set(enable_external_search)
35+
set(extra_search_mappings)
4136

4237
add_custom_target(doxygen-llvm
4338
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg

llvm/docs/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
2121
-e 's/@PACKAGE_VERSION@/mainline/' \
2222
-e 's/@abs_top_builddir@/../g' \
2323
-e 's/@enable_searchengine@/NO/g' \
24-
-e 's/@enable_server_based_search@/NO/g' \
24+
-e 's/@searchengine_url@//g' \
25+
-e 's/@enable_server_based_search@/NO/g' \
2526
-e 's/@enable_external_search@/NO/g' \
26-
-e 's/@extra_search_mappings@/NO/g' > $@
27+
-e 's/@extra_search_mappings@//g' > $@
2728
endif
2829

2930
include $(LEVEL)/Makefile.common

llvm/docs/doxygen.cfg.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,8 @@ SEARCHENGINE = @enable_searchengine@
10811081

10821082
SERVER_BASED_SEARCH = @enable_server_based_search@
10831083

1084+
SEARCHENGINE_URL = @searchengine_url@
1085+
10841086
EXTERNAL_SEARCH = @enable_external_search@
10851087

10861088
EXTERNAL_SEARCH_ID = llvm

0 commit comments

Comments
 (0)