CMake: Create a DocBook stamp file for Visual Studio.

Create user-guide.xml-stamp and developer-guide.xml-stamp when building
under Visual Studio. Fixes

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5): warning MSB8064: Custom build for item "C:\buildbot\builders\wireshark-master-32\windows-2019-x86\build\cmbuild\CMakeFiles\8721ce5c0a51a8e0d8e35fd55fbe2e6e\user-guide.hhp.rule" succeeded, but specified dependency "c:\buildbot\builders\wireshark-master-32\windows-2019-x86\build\cmbuild\docbook\user-guide.xml-stamp" does not exist. This may cause incremental build to work incorrectly. [C:\buildbot\builders\wireshark-master-32\windows-2019-x86\build\cmbuild\docbook\user_guide_chm.vcxproj]

when building the user_guide_chm target.

Change-Id: Ia224823841b4d3def3436f9f3a48b759694ffb37
Reviewed-on: https://code.wireshark.org/review/35509
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Gerald Combs 2019-12-19 11:55:47 -08:00 committed by Anders Broman
parent 1129114c55
commit 6094e9d392
1 changed files with 11 additions and 1 deletions

View File

@ -64,7 +64,17 @@ if(ASCIIDOCTOR_EXECUTABLE)
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${ARGN}
)
add_custom_target(generate_${_output_xml} DEPENDS ${_output_xml})
if(CMAKE_GENERATOR MATCHES "Visual Studio")
add_custom_command(
OUTPUT
${_output_xml}-stamp
COMMAND ${CMAKE_COMMAND} -E touch ${_output_xml}-stamp
DEPENDS ${_output_xml}
)
add_custom_target(generate_${_output_xml} DEPENDS ${_output_xml}-stamp)
else()
add_custom_target(generate_${_output_xml} DEPENDS ${_output_xml})
endif()
set_asciidoctor_target_properties(generate_${_output_xml})
unset(_output_xml)
ENDMACRO()