Stephen Kelly wrote:
> Aurélien Gâteau wrote:
>
>> Wrap ARGV1 and ARGV2 in quotes to avoid errors when they are empty
>
> The user code has an error and your patch silently hides it.
>
> How is that an improvement?
Thank you for your kind words.
Here is an updated patch.
Aurélien
>From d2038329f673a1933ee4c451a756583468120ca0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= <agat...@kde.org>
Date: Thu, 13 Mar 2014 13:13:27 +0100
Subject: [PATCH] Give an helpful message if VERSION is empty, instead of a
syntax error
---
Modules/CMakeFindDependencyMacro.cmake | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake
index 99ffca8..89420c0 100644
--- a/Modules/CMakeFindDependencyMacro.cmake
+++ b/Modules/CMakeFindDependencyMacro.cmake
@@ -31,14 +31,17 @@ macro(find_dependency dep)
if (NOT ${dep}_FOUND)
set(cmake_fd_version)
if (${ARGC} GREATER 1)
- if (${ARGV1} STREQUAL EXACT)
+ if (NOT "${ARGV1}")
+ message(FATAL_ERROR "Invalid arguments to find_dependency. VERSION is empty")
+ endif()
+ if ("${ARGV1}" STREQUAL EXACT)
message(FATAL_ERROR "Invalid arguments to find_dependency. EXACT may only be specified if a VERSION is specified")
endif()
set(cmake_fd_version ${ARGV1})
endif()
set(cmake_fd_exact_arg)
if(${ARGC} GREATER 2)
- if (NOT ${ARGV2} STREQUAL EXACT)
+ if (NOT "${ARGV2}" STREQUAL EXACT)
message(FATAL_ERROR "Invalid arguments to find_dependency")
endif()
set(cmake_fd_exact_arg EXACT)
--
1.8.3.2
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers