Commit 7eacbaed authored by Rolf Eike Beer's avatar Rolf Eike Beer

Replace MATCHES ".+" tests with NOT STREQUAL ""

parent 3a71d34c
......@@ -39,7 +39,7 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
endif()
# if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
# if the compiler accepts it
if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
if(NOT CMAKE_TRY_ANSI_CXX_FLAGS STREQUAL "")
CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
# if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
# to the flag
......
......@@ -18,7 +18,7 @@ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
# prefer the environment variable ASM
if($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
if(NOT $ENV{ASM${ASM_DIALECT}} STREQUAL "")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
endif()
......
......@@ -48,7 +48,7 @@ else()
set(CMAKE_C_COMPILER_INIT NOTFOUND)
# prefer the environment variable CC
if($ENV{CC} MATCHES ".+")
if(NOT $ENV{CC} STREQUAL "")
get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
if(CMAKE_C_FLAGS_ENV_INIT)
set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
......
......@@ -47,7 +47,7 @@ else()
set(CMAKE_CXX_COMPILER_INIT NOTFOUND)
# prefer the environment variable CXX
if($ENV{CXX} MATCHES ".+")
if(NOT $ENV{CXX} STREQUAL "")
get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
if(CMAKE_CXX_FLAGS_ENV_INIT)
set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
......
......@@ -32,7 +32,7 @@ elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
else()
if(NOT CMAKE_Fortran_COMPILER)
# prefer the environment variable CC
if($ENV{FC} MATCHES ".+")
if(NOT $ENV{FC} STREQUAL "")
get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
if(CMAKE_Fortran_FLAGS_ENV_INIT)
set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
......
......@@ -18,7 +18,7 @@
if(NOT CMAKE_Java_COMPILER)
# prefer the environment variable CC
if($ENV{JAVA_COMPILER} MATCHES ".+")
if(NOT $ENV{JAVA_COMPILER} STREQUAL "")
get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(CMAKE_Java_FLAGS_ENV_INIT)
set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
......@@ -28,14 +28,14 @@ if(NOT CMAKE_Java_COMPILER)
endif()
endif()
if($ENV{JAVA_RUNTIME} MATCHES ".+")
if(NOT $ENV{JAVA_RUNTIME} STREQUAL "")
get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
endif()
endif()
if($ENV{JAVA_ARCHIVE} MATCHES ".+")
if(NOT $ENV{JAVA_ARCHIVE} STREQUAL "")
get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
......
......@@ -20,7 +20,7 @@
# as a default compiler
if(NOT CMAKE_RC_COMPILER)
# prefer the environment variable RC
if($ENV{RC} MATCHES ".+")
if(NOT $ENV{RC} STREQUAL "")
get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
if(CMAKE_RC_FLAGS_ENV_INIT)
set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
......
......@@ -27,7 +27,7 @@ endif()
# loaded by another project using CMAKE_IMPORT_BUILD_SETTINGS. Now it
# creates a file that refuses to load (with comment explaining why).
macro(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
if(${SETTINGS_FILE} MATCHES ".+")
if(NOT ${SETTINGS_FILE} STREQUAL "")
configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
${SETTINGS_FILE} @ONLY)
else()
......
......@@ -17,8 +17,7 @@
# This macro used to load build settings from another project that
# stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro.
macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
if(${SETTINGS_FILE} MATCHES ".+")
else()
if("${SETTINGS_FILE}" STREQUAL "")
message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
endif()
endmacro()
......@@ -546,10 +546,10 @@ function(SET_PACKAGE_INFO _name _desc)
set(_url "${ARGV2}")
set(_purpose "${ARGV3}")
set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
if(_url MATCHES ".+")
if(NOT _url STREQUAL "")
set_property(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_url}" )
endif()
if(_purpose MATCHES ".+")
if(NOT _purpose STREQUAL "")
set_property(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" )
endif()
endfunction()
......
......@@ -150,7 +150,7 @@ endmacro()
set(BLAS_LINKER_FLAGS)
set(BLAS_LIBRARIES)
set(BLAS95_LIBRARIES)
if ($ENV{BLA_VENDOR} MATCHES ".+")
if (NOT $ENV{BLA_VENDOR} STREQUAL "")
set(BLA_VENDOR $ENV{BLA_VENDOR})
else ()
if(NOT BLA_VENDOR)
......
......@@ -37,7 +37,7 @@
file(READ ${input_file} depend_text)
if (${depend_text} MATCHES ".+")
if (NOT "${depend_text}" STREQUAL "")
# message("FOUND DEPENDS")
......
......@@ -37,7 +37,7 @@
file(READ ${input_file} file_text)
if (${file_text} MATCHES ".+")
if (NOT "${file_text}" STREQUAL "")
string(REPLACE ";" "\\;" file_text ${file_text})
string(REPLACE "\ncode" ";code" file_text ${file_text})
......
......@@ -159,7 +159,7 @@ endif()
if(BLAS_FOUND)
set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
if ($ENV{BLA_VENDOR} MATCHES ".+")
if (NOT $ENV{BLA_VENDOR} STREQUAL "")
set(BLA_VENDOR $ENV{BLA_VENDOR})
else ()
if(NOT BLA_VENDOR)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment