Fix CMP0054 cmake 3.1.0 warnings
authorRoland Schulz <roland@utk.edu>
Tue, 28 Oct 2014 21:49:08 +0000 (17:49 -0400)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sun, 9 Nov 2014 07:21:01 +0000 (08:21 +0100)
Change-Id: I5d91289a543240fa6f493b7f7738522f3c268c07

cmake/gmxCustomCommandUtilities.cmake
cmake/gmxOptionUtilities.cmake

index 3a13396e628fe1f496b5707967c3c254c1d2bea4..ae3279a8317d9e5a9d8048d0356adde3589fd2b4 100644 (file)
@@ -179,7 +179,7 @@ function (gmx_add_custom_output_target targetname)
         elseif ("x${_arg}" MATCHES "^x(COMMAND|COMMENT|WORKING_DIRECTORY)$")
             set(_option "PASS")
             list(APPEND _command_args "${_arg}")
-        elseif ("${_option}" STREQUAL "DEPENDS")
+        elseif ("x${_option}" STREQUAL "xDEPENDS")
             list(APPEND _deps "${_arg}")
             # If the dependency is a target created with this command, also add
             # the output file as a dependency.
@@ -190,15 +190,15 @@ function (gmx_add_custom_output_target targetname)
                     list(APPEND _deps ${_target_output})
                 endif()
             endif()
-        elseif ("${_option}" STREQUAL "PASS")
+        elseif ("x${_option}" STREQUAL "xPASS")
             list(APPEND _command_args "${_arg}")
-        elseif ("${_option}" STREQUAL "DEPENDS_FILE_LIST")
+        elseif ("x${_option}" STREQUAL "xDEPENDS_FILE_LIST")
             list(APPEND _deps ${${_arg}})
-        elseif ("${_option}" STREQUAL "OUTPUT")
+        elseif ("x${_option}" STREQUAL "xOUTPUT")
             if (_output)
                 message(FATAL_ERROR "Multiple OUTPUTs not supported")
             endif()
-            if ("${_arg}" STREQUAL "STAMP")
+            if ("x${_arg}" STREQUAL "xSTAMP")
                 gmx_get_stamp_filename(_output ${targetname})
                 set(_stamp ON)
             else()
index 603f3c5cfd4b61dbc347b6f4d61a34b5474a11c8..ca1fac39a095cdaeca3df74188a1314694d193f5 100644 (file)
@@ -107,7 +107,7 @@ function(GMX_OPTION_TRIVALUE NAME DESCRIPTION DEFAULT)
     set(${NAME}_AUTO OFF)
     set(${NAME}_FORCE OFF)
     string(TOUPPER "${${NAME}}" ${NAME})
-    if ("${NAME}" STREQUAL "AUTO")
+    if ("${${NAME}}" STREQUAL "AUTO")
         set(${NAME}_AUTO ON)
     elseif (${NAME})
         set(${NAME}_FORCE ON)
@@ -199,7 +199,7 @@ endmacro()
 function(GMX_CHECK_IF_CHANGED RESULT)
     set(_result FALSE)
     foreach (_var ${ARGN})
-        if (NOT "${_var}" STREQUAL "${_var}_PREVIOUS_VALUE")
+        if (NOT "${${_var}}" STREQUAL "${${_var}_PREVIOUS_VALUE}")
             set(_result TRUE)
         endif()
         set(${_var}_PREVIOUS_VALUE "${${_var}}" CACHE INTERNAL