Added a check for m4 and throw an error if m4 isn't on the path and the generated file isn't present (as it would be in a point release). In support of
@@ -1492,8 +1492,15 @@ ENDIF()
MACRO(GEN_m4 filename)
- IF(HAVE_M4)
+ # If m4 isn't present, and the generated file doesn't exist,
+ # it cannot be generated and an error should be thrown.
+ IF(NOT HAVE_M4)
+ IF(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${filename.c})
+ MESSAGE(FATAL_ERROR "m4 is required to generate ${filename}.c. Please install m4 so that it is on the PATH and try again.")
+ ENDIF()
+ ENDIF(NOT HAVE_M4)
+ IF(HAVE_M4)
# If m4 is available, remove generated file if it exists.
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.c)
FILE(REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.c)
