Skip to content

Commit bbdf5d1

Browse files
committed
Fix Windows doc build MSBuild error MSB6001
When using a MSBuild-based CMake generator like 'Visual Studio 15 2017 Win64', the doc build was failing with the error 'MSB6001: Invalid command line switch for "cmd.exe". Illegal characters in path.' This was due to the dependency on Doxyfile*, which wasn't expanded by CMake. The fix is to expand this glob in CMake before specifying the custom command's dependencies. Partial fix for Tencent#622
1 parent 1e46091 commit bbdf5d1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ ELSE()
1010
CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY)
1111
CONFIGURE_FILE(Doxyfile.zh-cn.in Doxyfile.zh-cn @ONLY)
1212

13+
file(GLOB DOXYFILES ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile*)
14+
1315
add_custom_command(OUTPUT html
1416
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
1517
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.zh-cn
1618
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html
17-
DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile*
19+
DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${DOXYFILES}
1820
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../
1921
)
2022

0 commit comments

Comments
 (0)