Am 17.09.2014 13:54, schrieb Adam Strzelecki:
This silents possible CMP0054 related warnings.
---
 Modules/FindCUDA.cmake          | 14 +++++++-------
 Modules/FindCUDA/run_nvcc.cmake |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 9348aa5..2e2b21c 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -894,15 +894,15 @@ macro(CUDA_GET_SOURCES_AND_OPTIONS _sources
_cmake_options _options)
   set( ${_options} )
   set( _found_options FALSE )
   foreach(arg ${ARGN})
-    if(arg STREQUAL "OPTIONS")
+    if("x${arg}" STREQUAL "xOPTIONS")

[...]

Wait, what? This is actually the opposite of what that policy is for, no? Adam, I don't blame you, just to get that said first. The question is: does this policy warning trigger far too often?

What one actually wants is to write

  if(arg STREQUAL "OPTIONS")

i.e. arg will get expanded, "OPTIONS" not. Changing everything away from that pattern will in fact make things worse, and will not help you if I introduce an xOPTION variable now. So, is this warning too noisy or are we doing something fundamentally wrong?

Eike
--

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/mailman/listinfo/cmake-developers

Reply via email to