Skip to content

Commit ca02ad4

Browse files
committed
fix cmake MESSAGE_ONCE macro for multi-line messages
1 parent 6152784 commit ca02ad4

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

cmake/misc.cmake

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
FUNCTION(MESSAGE_ONCE id out)
2-
IF(NOT __msg1_${id} STREQUAL "${out}")
1+
IF ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.8.7")
2+
FUNCTION(MESSAGE_ONCE id out)
33
MESSAGE(STATUS "${out}")
4-
ENDIF()
5-
SET(__msg1_${id} "${out}" CACHE INTERNAL "")
6-
ENDFUNCTION()
4+
ENDFUNCTION()
5+
ELSE()
6+
FUNCTION(MESSAGE_ONCE id out)
7+
STRING(MD5 hash "${out}")
8+
IF(NOT __msg1_${id} STREQUAL "${hash}")
9+
MESSAGE(STATUS "${out}")
10+
ENDIF()
11+
SET(__msg1_${id} ${hash} CACHE INTERNAL "")
12+
ENDFUNCTION()
13+
ENDIF()

0 commit comments

Comments
 (0)