find_program(M2R NAMES m2r m2r-3)
-function(DefaultRstPath MDFILE RSTFILE_VAR)
+function(DefaultRstPath RSTFILE_VAR MDFILE)
string(REGEX REPLACE "\\.md$" ".rst" FILEPATH ${MDFILE})
get_filename_component(FILENAME ${FILEPATH} NAME)
set(${RSTFILE_VAR} "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}" PARENT_SCOPE)
message("-- Checking ChangeLogs, BUGS, etc...")
file(GLOB CHANGELOGS "${CMAKE_SOURCE_DIR}/ChangeLog-*.md")
foreach(CHANGELOG IN LISTS CHANGELOGS)
- DefaultRstPath(${CHANGELOG} RESTFILE)
+ DefaultRstPath(RESTFILE ${CHANGELOG})
UpdateRstFromMd(${RESTFILE} ${CHANGELOG})
endforeach()
UpdateRstFromMd(issues.rst "${CMAKE_SOURCE_DIR}/BUGS.md")