[Commits] a09224b: cmake: message_once

serg at mariadb.org serg at mariadb.org
Mon Nov 23 11:01:47 EET 2015


revision-id: a09224bde4fe974d56fec9ab8b7349f42623566a (mariadb-10.1.8-60-ga09224b)
parent(s): 8633ab7081af4268a744c628c3fa8d42c595f53f
committer: Sergei Golubchik
timestamp: 2015-11-22 18:35:59 +0100
message:

cmake: message_once

---
 CMakeLists.txt      |  1 +
 cmake/misc.cmake    |  6 ++++++
 cmake/ssl.cmake     | 14 +++++++-------
 cmake/systemd.cmake |  4 ++--
 4 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ef1040..faff175 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -134,6 +134,7 @@ IF (NOT CPACK_GENERATOR)
   ENDIF(WIN32) 
 ENDIF(NOT CPACK_GENERATOR)
 
+INCLUDE(misc)
 INCLUDE(mysql_version)
 INCLUDE(cpack_source_ignore_files)
 INCLUDE(install_layout)
diff --git a/cmake/misc.cmake b/cmake/misc.cmake
new file mode 100644
index 0000000..c87fc41
--- /dev/null
+++ b/cmake/misc.cmake
@@ -0,0 +1,6 @@
+FUNCTION(MESSAGE_ONCE id out)
+  IF(NOT __msg1_${id} STREQUAL "${out}")
+    MESSAGE(STATUS "${out}")
+  ENDIF()
+  SET(__msg1_${id} "${out}" CACHE INTERNAL "")
+ENDFUNCTION()
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index 802cc2c..97fafc7 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -69,6 +69,7 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
     SET(SSL_SOURCES ${SSL_SOURCES}
       ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/${file})
   ENDFOREACH()
+  MESSAGE_ONCE(SSL_LIBRARIES "SSL_LIBRARIES = ${SSL_LIBRARIES}")
 ENDMACRO()
 
 # MYSQL_CHECK_SSL
@@ -139,7 +140,7 @@ MACRO (MYSQL_CHECK_SSL)
         NAMES openssl/applink.c
         HINTS ${OPENSSL_ROOT_DIR}/include
       )
-      MESSAGE(STATUS "OPENSSL_APPLINK_C ${OPENSSL_APPLINK_C}")
+      MESSAGE_ONCE(OPENSSL_APPLINK_C "OPENSSL_APPLINK_C ${OPENSSL_APPLINK_C}")
     ENDIF()
 
     # On mac this list is <.dylib;.so;.a>
@@ -186,12 +187,11 @@ MACRO (MYSQL_CHECK_SSL)
         "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1"
         OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}"
       )
-
-      MESSAGE(STATUS "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}")
-      MESSAGE(STATUS "OPENSSL_LIBRARIES = ${OPENSSL_LIBRARIES}")
-      MESSAGE(STATUS "CRYPTO_LIBRARY = ${CRYPTO_LIBRARY}")
-      MESSAGE(STATUS "OPENSSL_MAJOR_VERSION = ${OPENSSL_MAJOR_VERSION}")
-      MESSAGE(STATUS "SSL_LIBRARIES = ${SSL_LIBRARIES}")
+      MESSAGE_ONCE(OPENSSL_INCLUDE_DIR "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}")
+      MESSAGE_ONCE(OPENSSL_LIBRARIES "OPENSSL_LIBRARIES = ${OPENSSL_LIBRARIES}")
+      MESSAGE_ONCE(CRYPTO_LIBRARY "CRYPTO_LIBRARY = ${CRYPTO_LIBRARY}")
+      MESSAGE_ONCE(OPENSSL_MAJOR_VERSION "OPENSSL_MAJOR_VERSION = ${OPENSSL_MAJOR_VERSION}")
+      MESSAGE_ONCE(SSL_LIBRARIES "SSL_LIBRARIES = ${SSL_LIBRARIES}")
       SET(SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
       SET(SSL_INTERNAL_INCLUDE_DIRS "")
       SET(SSL_DEFINES "-DHAVE_OPENSSL")
diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake
index b0161cf..e6094c7 100644
--- a/cmake/systemd.cmake
+++ b/cmake/systemd.cmake
@@ -65,7 +65,7 @@ MACRO(CHECK_SYSTEMD)
           SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld")
           SET(SYSTEMD_EXECSTARTPOST "ExecStartPost=/etc/mysql/debian-start")
         ENDIF()
-        MESSAGE(STATUS "Systemd features enabled")
+        MESSAGE_ONCE(systemd "Systemd features enabled")
       ELSE()
         UNSET(LIBSYSTEMD)
         UNSET(HAVE_SYSTEMD)
@@ -73,7 +73,7 @@ MACRO(CHECK_SYSTEMD)
         UNSET(HAVE_SYSTEMD_SD_LISTEN_FDS)
         UNSET(HAVE_SYSTEMD_SD_NOTIFY)
         UNSET(HAVE_SYSTEMD_SD_NOTIFYF)
-        MESSAGE(STATUS "Systemd features not enabled")
+        MESSAGE_ONCE(systemd "Systemd features not enabled")
         IF(WITH_SYSTEMD STREQUAL "yes")
           MESSAGE(FATAL_ERROR "Requested WITH_SYSTEMD=YES however no dependencies installed/found")
         ENDIF()


More information about the commits mailing list