Skip to content

Commit

Permalink
fix cmake MESSAGE_ONCE macro for multi-line messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Sep 12, 2016
1 parent 6152784 commit ca02ad4
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions cmake/misc.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
FUNCTION(MESSAGE_ONCE id out)
IF(NOT __msg1_${id} STREQUAL "${out}")
IF ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.8.7")
FUNCTION(MESSAGE_ONCE id out)
MESSAGE(STATUS "${out}")
ENDIF()
SET(__msg1_${id} "${out}" CACHE INTERNAL "")
ENDFUNCTION()
ENDFUNCTION()
ELSE()
FUNCTION(MESSAGE_ONCE id out)
STRING(MD5 hash "${out}")
IF(NOT __msg1_${id} STREQUAL "${hash}")
MESSAGE(STATUS "${out}")
ENDIF()
SET(__msg1_${id} ${hash} CACHE INTERNAL "")
ENDFUNCTION()
ENDIF()

0 comments on commit ca02ad4

Please sign in to comment.