[cmake-developers] [PATCH] Don't log over 9000 warnings when CMAKE_TOOLCHAIN_FILE is an empty string

Andrey Pokrovskiy wonder.mice at gmail.com
Wed Apr 22 16:01:49 EDT 2015


If CMAKE_TOOLCHAIN_FILE is an empty string cmake will generate a lot of
warnings:

CMake Warning (dev) at CMakeSystem.cmake:6 (include):
  include() given empty file name (ignored).

---
 Modules/CMakeDetermineSystem.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/CMakeDetermineSystem.cmake
b/Modules/CMakeDetermineSystem.cmake
index fe292ea..fa14641 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -179,7 +179,7 @@ if(CMAKE_BINARY_DIR)
   # if a toolchain file is used, it needs to be included in the
configured file,
   # so settings done there are also available if they don't go in the
cache and in try_compile()
   set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
-  if(DEFINED CMAKE_TOOLCHAIN_FILE)
+  if(CMAKE_TOOLCHAIN_FILE)
     set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED
"include(\"${CMAKE_TOOLCHAIN_FILE}\")")
   endif()

-- 
2.3.2 (Apple Git-55)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Don-t-log-over-9000-warnings-when-CMAKE_TOOLCHAIN_FI.patch
Type: application/octet-stream
Size: 1181 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150422/63faecbf/attachment.obj>


More information about the cmake-developers mailing list