[Bf-blender-cvs] [15b97e7] master: CMake: Silence messages about unordered map and shared pointer on second run

Sergey Sharybin noreply at git.blender.org
Thu Jan 14 08:59:25 CET 2016


Commit: 15b97e799f66706a642104a9130bfc412fa01063
Author: Sergey Sharybin
Date:   Thu Jan 14 12:57:58 2016 +0500
Branches: master
https://developer.blender.org/rB15b97e799f66706a642104a9130bfc412fa01063

CMake: Silence messages about unordered map and shared pointer on second run

This variables are being cached anyway and can only be changed on first run,
no need to keep reporting them again and again.

===================================================================

M	build_files/cmake/macros.cmake

===================================================================

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index a8e17c3..edc5cf9 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -810,17 +810,24 @@ macro(TEST_STDBOOL_SUPPORT)
 	HAVE_STDBOOL_H)
 endmacro()
 
+# Only print message if running CMake first time
+macro(message_first_run)
+	if(FIRST_RUN)
+		message(${ARGV})
+	endif()
+endmacro()
+
 macro(TEST_UNORDERED_MAP_SUPPORT)
 	# - Detect unordered_map availability
 	# Test if a valid implementation of unordered_map exists
 	# and define the include path
 	# This module defines
 	#  HAVE_UNORDERED_MAP, whether unordered_map implementation was found
-	#  
+	#
 	#  HAVE_STD_UNORDERED_MAP_HEADER, <unordered_map.h> was found
 	#  HAVE_UNORDERED_MAP_IN_STD_NAMESPACE, unordered_map is in namespace std
 	#  HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE, unordered_map is in namespace std::tr1
-	#  
+	#
 	#  UNORDERED_MAP_INCLUDE_PREFIX, include path prefix for unordered_map, if found
 	#  UNORDERED_MAP_NAMESPACE, namespace for unordered_map, if found
 
@@ -844,7 +851,7 @@ macro(TEST_UNORDERED_MAP_SUPPORT)
 		                          }"
 		                          HAVE_UNORDERED_MAP_IN_STD_NAMESPACE)
 		if(HAVE_UNORDERED_MAP_IN_STD_NAMESPACE)
-			message(STATUS "Found unordered_map/set in std namespace.")
+			message_first_run(STATUS "Found unordered_map/set in std namespace.")
 
 			set(HAVE_UNORDERED_MAP "TRUE")
 			set(UNORDERED_MAP_INCLUDE_PREFIX "")
@@ -857,26 +864,26 @@ macro(TEST_UNORDERED_MAP_SUPPORT)
 			                          }"
 			                          HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
 			if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
-				message(STATUS "Found unordered_map/set in std::tr1 namespace.")
+				message_first_run(STATUS "Found unordered_map/set in std::tr1 namespace.")
 
 				set(HAVE_UNORDERED_MAP "TRUE")
 				set(UNORDERED_MAP_INCLUDE_PREFIX "")
 				set(UNORDERED_MAP_NAMESPACE "std::tr1")
 			else()
-				message(STATUS "Found <unordered_map> but cannot find either std::unordered_map "
-				        "or std::tr1::unordered_map.")
+				message_first_run(STATUS "Found <unordered_map> but cannot find either std::unordered_map "
+				                  "or std::tr1::unordered_map.")
 			endif()
 		endif()
 	else()
 		CHECK_INCLUDE_FILE_CXX("tr1/unordered_map" HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
 		if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
-			message(STATUS "Found unordered_map/set in std::tr1 namespace.")
+			message_first_run(STATUS "Found unordered_map/set in std::tr1 namespace.")
 
 			set(HAVE_UNORDERED_MAP "TRUE")
 			set(UNORDERED_MAP_INCLUDE_PREFIX "tr1")
 			set(UNORDERED_MAP_NAMESPACE "std::tr1")
 		else()
-			message(STATUS "Unable to find <unordered_map> or <tr1/unordered_map>. ")
+			message_first_run(STATUS "Unable to find <unordered_map> or <tr1/unordered_map>. ")
 		endif()
 	endif()
 endmacro()
@@ -913,7 +920,7 @@ macro(TEST_SHARED_PTR_SUPPORT)
 		                          HAVE_SHARED_PTR_IN_STD_NAMESPACE)
 
 		if(HAVE_SHARED_PTR_IN_STD_NAMESPACE)
-			message("-- Found shared_ptr in std namespace using <memory> header.")
+			message_first_run("-- Found shared_ptr in std namespace using <memory> header.")
 			set(SHARED_PTR_FOUND TRUE)
 		else()
 			CHECK_CXX_SOURCE_COMPILES("#include <memory>
@@ -923,7 +930,7 @@ macro(TEST_SHARED_PTR_SUPPORT)
 			                           }"
 			                          HAVE_SHARED_PTR_IN_TR1_NAMESPACE)
 			if(HAVE_SHARED_PTR_IN_TR1_NAMESPACE)
-				message("-- Found shared_ptr in std::tr1 namespace using <memory> header.")
+				message_first_run("-- Found shared_ptr in std::tr1 namespace using <memory> header.")
 				set(SHARED_PTR_TR1_NAMESPACE TRUE)
 				set(SHARED_PTR_FOUND TRUE)
 			endif()
@@ -944,7 +951,7 @@ macro(TEST_SHARED_PTR_SUPPORT)
 			                           }"
 			                           HAVE_SHARED_PTR_IN_TR1_NAMESPACE_FROM_TR1_MEMORY_HEADER)
 			if(HAVE_SHARED_PTR_IN_TR1_NAMESPACE_FROM_TR1_MEMORY_HEADER)
-				message("-- Found shared_ptr in std::tr1 namespace using <tr1/memory> header.")
+				message_first_run("-- Found shared_ptr in std::tr1 namespace using <tr1/memory> header.")
 				set(SHARED_PTR_TR1_MEMORY_HEADER TRUE)
 				set(SHARED_PTR_TR1_NAMESPACE TRUE)
 				set(SHARED_PTR_FOUND TRUE)




More information about the Bf-blender-cvs mailing list