From b0b4b4602fd5f8508d6fcbb9ea3236585e6368e2 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 11 Apr 2014 18:17:46 +0200 Subject: Remove .* expressions from beginning and end of MATCHES regexs All these expressions work the same: "foo" ".*foo.*" "^.*foo.*$" This assumes that the "Intel*" expressions were meant to be "Intel.*". --- CompileFlags.cmake | 6 +++--- Modules/BasicConfigVersion-ExactVersion.cmake.in | 4 ++-- Modules/BundleUtilities.cmake | 4 ++-- Modules/CMakeBackwardCompatibilityCXX.cmake | 4 ++-- Modules/CMakeDetermineCCompiler.cmake | 2 +- Modules/CMakeDetermineCXXCompiler.cmake | 2 +- Modules/CMakeDetermineCompilerABI.cmake | 4 ++-- Modules/CMakeDetermineCompilerId.cmake | 14 +++++++------- Modules/CMakeDetermineFortranCompiler.cmake | 6 +++--- Modules/CPackRPM.cmake | 2 +- Modules/FindBLAS.cmake | 8 ++++---- Modules/FindBoost.cmake | 2 +- Modules/FindCUDA.cmake | 2 +- Modules/FindHDF5.cmake | 2 +- Modules/FindIcotool.cmake | 2 +- Modules/FindLAPACK.cmake | 4 ++-- Modules/FindQt.cmake | 2 +- Modules/FindQt3.cmake | 4 ++-- Modules/FindSquish.cmake | 2 +- Modules/FindThreads.cmake | 4 ++-- Modules/FindZLIB.cmake | 2 +- Modules/FindwxWidgets.cmake | 4 ++-- Modules/Platform/Darwin.cmake | 2 +- Modules/Platform/OSF1.cmake | 4 ++-- Modules/Platform/SunOS.cmake | 2 +- Modules/UseSWIG.cmake | 2 +- Modules/UseVTKConfig40.cmake | 2 +- Tests/CMakeLists.txt | 4 ++-- Tests/Complex/CMakeLists.txt | 2 +- Tests/ComplexOneConfig/CMakeLists.txt | 2 +- Tests/FindPackageModeMakefileTest/CMakeLists.txt | 2 +- Tests/PerConfig/perconfig.cmake | 2 +- 32 files changed, 55 insertions(+), 55 deletions(-) diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 873af8f..a6ff8e0 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -34,20 +34,20 @@ else() endif() #silence duplicate symbol warnings on AIX -if(CMAKE_SYSTEM MATCHES "AIX.*") +if(CMAKE_SYSTEM MATCHES "AIX") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ") endif() endif() -if(CMAKE_SYSTEM MATCHES "IRIX.*") +if(CMAKE_SYSTEM MATCHES "IRIX") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15") endif() endif() -if(CMAKE_SYSTEM MATCHES "OSF1-V.*") +if(CMAKE_SYSTEM MATCHES "OSF1-V") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") endif() diff --git a/Modules/BasicConfigVersion-ExactVersion.cmake.in b/Modules/BasicConfigVersion-ExactVersion.cmake.in index 63f3f03..9fd0136 100644 --- a/Modules/BasicConfigVersion-ExactVersion.cmake.in +++ b/Modules/BasicConfigVersion-ExactVersion.cmake.in @@ -11,13 +11,13 @@ set(PACKAGE_VERSION "@CVF_VERSION@") -if("@CVF_VERSION@" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version +if("@CVF_VERSION@" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version set(CVF_VERSION_NO_TWEAK "${CMAKE_MATCH_1}") else() set(CVF_VERSION_NO_TWEAK "@CVF_VERSION@") endif() -if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version +if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version set(REQUESTED_VERSION_NO_TWEAK "${CMAKE_MATCH_1}") else() set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}") diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index eaddd04..0c733fa 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -247,7 +247,7 @@ function(get_bundle_main_executable bundle result_var) break() endif() - if(line MATCHES "^.*CFBundleExecutable.*$") + if(line MATCHES "CFBundleExecutable") set(line_is_main_executable 1) endif() endforeach() @@ -287,7 +287,7 @@ endfunction() function(get_dotapp_dir exe dotapp_dir_var) set(s "${exe}") - if(s MATCHES "^.*/.*\\.app/.*$") + if(s MATCHES "/.*\\.app/") # If there is a ".app" parent directory, # ascend until we hit it: # (typical of a Mac bundle executable) diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake index 343fdb2..a3da2d6 100644 --- a/Modules/CMakeBackwardCompatibilityCXX.cmake +++ b/Modules/CMakeBackwardCompatibilityCXX.cmake @@ -31,10 +31,10 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) if(NOT CMAKE_COMPILER_IS_GNUCXX) include(TestCXXAcceptsFlag) set(CMAKE_TRY_ANSI_CXX_FLAGS "") - if(CMAKE_SYSTEM MATCHES "IRIX.*") + if(CMAKE_SYSTEM MATCHES "IRIX") set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std") endif() - if(CMAKE_SYSTEM MATCHES "OSF.*") + if(CMAKE_SYSTEM MATCHES "OSF") set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname") endif() # if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index aa4cdc9..ace53ec 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -138,7 +138,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-) elseif(COMPILER_BASENAME MATCHES "qcc(\\.exe)?$") - if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?.*$") + if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?") set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-) endif() endif () diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index ef8445e..7df9f65 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -135,7 +135,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-) elseif(COMPILER_BASENAME MATCHES "QCC(\\.exe)?$") - if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?.*$") + if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?") set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-) endif() endif () diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index a8c89a4..8595b97 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -52,10 +52,10 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) "Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n") file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[") foreach(info ${ABI_STRINGS}) - if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*") + if("${info}" MATCHES "INFO:sizeof_dptr\\[0*([^]]*)\\]") set(ABI_SIZEOF_DPTR "${CMAKE_MATCH_1}") endif() - if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*") + if("${info}" MATCHES "INFO:abi\\[([^]]*)\\]") set(ABI_NAME "${CMAKE_MATCH_1}") endif() endforeach() diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 73cb92a..f109dc4 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -356,30 +356,30 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 6 REGEX "INFO:") set(COMPILER_ID_TWICE) foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS}) - if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") + if("${info}" MATCHES "INFO:compiler\\[([^]\"]*)\\]") if(COMPILER_ID) set(COMPILER_ID_TWICE 1) endif() set(COMPILER_ID "${CMAKE_MATCH_1}") endif() - if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*") + if("${info}" MATCHES "INFO:platform\\[([^]\"]*)\\]") set(PLATFORM_ID "${CMAKE_MATCH_1}") endif() - if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*") + if("${info}" MATCHES "INFO:arch\\[([^]\"]*)\\]") set(ARCHITECTURE_ID "${CMAKE_MATCH_1}") endif() - if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*") + if("${info}" MATCHES "INFO:compiler_version\\[([^]\"]*)\\]") string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}") string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}") endif() - if("${info}" MATCHES ".*INFO:simulate\\[([^]\"]*)\\].*") + if("${info}" MATCHES "INFO:simulate\\[([^]\"]*)\\]") set(SIMULATE_ID "${CMAKE_MATCH_1}") endif() - if("${info}" MATCHES ".*INFO:simulate_version\\[([^]\"]*)\\].*") + if("${info}" MATCHES "INFO:simulate_version\\[([^]\"]*)\\]") string(REGEX REPLACE "^0+([0-9])" "\\1" SIMULATE_VERSION "${CMAKE_MATCH_1}") string(REGEX REPLACE "\\.0+([0-9])" ".\\1" SIMULATE_VERSION "${SIMULATE_VERSION}") endif() - if("${info}" MATCHES ".*INFO:qnxnto") + if("${info}" MATCHES "INFO:qnxnto") set(COMPILER_QNXNTO 1) endif() endforeach() diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index d38bf25..0eb75a2 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -130,7 +130,7 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\"" OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN) if(NOT CMAKE_COMPILER_RETURN) - if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" ) + if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_GNU") set(CMAKE_Fortran_COMPILER_ID "GNU") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran compiler is GNU succeeded with " @@ -141,10 +141,10 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") endif() if(NOT CMAKE_Fortran_PLATFORM_ID) - if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" ) + if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_MINGW") set(CMAKE_Fortran_PLATFORM_ID "MinGW") endif() - if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" ) + if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_CYGWIN") set(CMAKE_Fortran_PLATFORM_ID "Cygwin") endif() endif() diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index ad88e6b..2864b21 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -397,7 +397,7 @@ endif() # to shut down warning about space in buildtree # some recent RPM version should support space in different places. # not checked [yet]. -if(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*") +if(CPACK_TOPLEVEL_DIRECTORY MATCHES " ") message(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.") endif() diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 1cf9124..7a5c259 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -288,7 +288,7 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") endif () #BLAS in acml library? -if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") +if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") if( ((BLA_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR ((BLA_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) OR ((BLA_VENDOR STREQUAL "ACML_GPU") AND (NOT BLAS_ACML_GPU_LIB_DIRS)) @@ -465,7 +465,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") endif () #BLAS in intel mkl 10 library? (em64t 64bit) -if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") +if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") if (NOT WIN32) set(LM "-lm") endif () @@ -532,7 +532,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") "mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide") # mkl >= 10.3 - if (CMAKE_C_COMPILER MATCHES ".+gcc.*") + if (CMAKE_C_COMPILER MATCHES ".+gcc") list(APPEND BLAS_SEARCH_LIBS "mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core gomp") else () @@ -600,7 +600,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") "mkl_intel_lp64 mkl_intel_thread mkl_core guide") # mkl >= 10.3 - if (CMAKE_C_COMPILER MATCHES ".+gcc.*") + if (CMAKE_C_COMPILER MATCHES ".+gcc") list(APPEND BLAS_SEARCH_LIBS "mkl_intel_lp64 mkl_gnu_thread mkl_core gomp") else () diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index e894ba4..dfd4460 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -684,7 +684,7 @@ if(Boost_INCLUDE_DIR) set(_Boost_VERSION_REGEX "([0-9]+)") set(_Boost_LIB_VERSION_REGEX "\"([0-9_]+)\"") foreach(v VERSION LIB_VERSION) - if("${_boost_VERSION_HPP_CONTENTS}" MATCHES ".*#define BOOST_${v} ${_Boost_${v}_REGEX}.*") + if("${_boost_VERSION_HPP_CONTENTS}" MATCHES "#define BOOST_${v} ${_Boost_${v}_REGEX}") set(Boost_${v} "${CMAKE_MATCH_1}") endif() endforeach() diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 94f82f6..c02809d 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1194,7 +1194,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) foreach(file ${ARGN}) # Ignore any file marked as a HEADER_FILE_ONLY get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) - if(${file} MATCHES ".*\\.cu$" AND NOT _is_header) + if(${file} MATCHES "\\.cu$" AND NOT _is_header) # Allow per source file overrides of the format. get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 1aa5dcf..0d58e13 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -253,7 +253,7 @@ if( NOT HDF5_FOUND ) list( APPEND HDF5_DEFINITIONS ${HDF5_${LANGUAGE}_DEFINITIONS} ) # find the HDF5 include directories - if(${LANGUAGE} MATCHES "Fortran.*") + if(${LANGUAGE} MATCHES "Fortran") set(HDF5_INCLUDE_FILENAME hdf5.mod) else() set(HDF5_INCLUDE_FILENAME hdf5.h) diff --git a/Modules/FindIcotool.cmake b/Modules/FindIcotool.cmake index e29fe2e..a7c5a64 100644 --- a/Modules/FindIcotool.cmake +++ b/Modules/FindIcotool.cmake @@ -37,7 +37,7 @@ if(ICOTOOL_EXECUTABLE) ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ) - if("${_icotool_version}" MATCHES "^icotool \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*") + if("${_icotool_version}" MATCHES "^icotool \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)") set( ICOTOOL_VERSION_STRING "${CMAKE_MATCH_1}" ) diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index 33f4f0c..87938c8 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -183,7 +183,7 @@ endif () #acml lapack - if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") + if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") if (BLAS_LIBRARIES MATCHES ".+acml.+") set (LAPACK_LIBRARIES ${BLAS_LIBRARIES}) endif () @@ -233,7 +233,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR endif () endif () #intel lapack -if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") +if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") if (NOT WIN32) set(LM "-lm") endif () diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index e893c7a..98ba43d 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -87,7 +87,7 @@ find_program(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake PATHS "${QT_SEARCH_PATH}/bin if(QT_QMAKE_EXECUTABLE_FINDQT) exec_program(${QT_QMAKE_EXECUTABLE_FINDQT} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION) - if(QTVERSION MATCHES "4.*") + if(QTVERSION MATCHES "4") set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "Qt4 qmake program.") set(QT4_INSTALLED TRUE) endif() diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake index 6cd12c6..4fc6829 100644 --- a/Modules/FindQt3.cmake +++ b/Modules/FindQt3.cmake @@ -295,12 +295,12 @@ if(QT_UIC_EXECUTABLE) endif() set(_QT_UIC_VERSION_3 FALSE) -if("${QTVERSION_UIC}" MATCHES ".* 3..*") +if("${QTVERSION_UIC}" MATCHES " 3.") set(_QT_UIC_VERSION_3 TRUE) endif() set(_QT_MOC_VERSION_3 FALSE) -if("${QTVERSION_MOC}" MATCHES ".* 3..*") +if("${QTVERSION_MOC}" MATCHES " 3.") set(_QT_MOC_VERSION_3 TRUE) endif() diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake index 5cff122..4076521 100644 --- a/Modules/FindSquish.cmake +++ b/Modules/FindSquish.cmake @@ -184,7 +184,7 @@ if(SQUISH_CLIENT_EXECUTABLE) execute_process(COMMAND "${SQUISH_CLIENT_EXECUTABLE}" --version OUTPUT_VARIABLE _squishVersionOutput ERROR_QUIET ) - if("${_squishVersionOutput}" MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+).*$") + if("${_squishVersionOutput}" MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)") set(SQUISH_VERSION_MAJOR "${CMAKE_MATCH_1}") set(SQUISH_VERSION_MINOR "${CMAKE_MATCH_2}") set(SQUISH_VERSION_PATCH "${CMAKE_MATCH_3}") diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 6d1c65d..b5cc67f 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -162,12 +162,12 @@ if(CMAKE_USE_PTHREADS_INIT) set(CMAKE_USE_PTHREADS_INIT 1) endif() - if(CMAKE_SYSTEM MATCHES "OSF1-V*") + if(CMAKE_SYSTEM MATCHES "OSF1-V") set(CMAKE_USE_PTHREADS_INIT 0) set(CMAKE_THREAD_LIBS_INIT ) endif() - if(CMAKE_SYSTEM MATCHES "CYGWIN_NT*") + if(CMAKE_SYSTEM MATCHES "CYGWIN_NT") set(CMAKE_USE_PTHREADS_INIT 1) set(Threads_FOUND TRUE) set(CMAKE_THREAD_LIBS_INIT ) diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index 75b0076..8cc382c 100644 --- a/Modules/FindZLIB.cmake +++ b/Modules/FindZLIB.cmake @@ -85,7 +85,7 @@ if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") # only append a TWEAK version if it exists: set(ZLIB_VERSION_TWEAK "") - if( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$") + if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)") set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}") set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}") endif() diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 3c664e7..45596a0 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -560,7 +560,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") if(WX_LIB_DIR) # If building shared libs, define WXUSINGDLL to use dllimport. - if(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*") + if(WX_LIB_DIR MATCHES "[dD][lL][lL]") set(wxWidgets_DEFINITIONS WXUSINGDLL) DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}") endif() @@ -668,7 +668,7 @@ else() if(_wx_result EQUAL 0) foreach(_opt_name debug static unicode universal) string(TOUPPER ${_opt_name} _upper_opt_name) - if(_wx_selected_config MATCHES ".*${_opt_name}.*") + if(_wx_selected_config MATCHES "${_opt_name}") set(wxWidgets_DEFAULT_${_upper_opt_name} ON) else() set(wxWidgets_DEFAULT_${_upper_opt_name} OFF) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index fc3f87e..df0756b 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -203,7 +203,7 @@ endif() # Make sure the combination of SDK and Deployment Target are allowed if(CMAKE_OSX_DEPLOYMENT_TARGET) - if("${_CMAKE_OSX_SYSROOT_PATH}" MATCHES "^.*/MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk") + if("${_CMAKE_OSX_SYSROOT_PATH}" MATCHES "/MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk") set(_sdk_ver "${CMAKE_MATCH_1}") elseif("${_CMAKE_OSX_SYSROOT_ORIG}" MATCHES "^macosx([0-9]+\\.[0-9]+)$") set(_sdk_ver "${CMAKE_MATCH_1}") diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake index 9c3255e..f2ad612 100644 --- a/Modules/Platform/OSF1.cmake +++ b/Modules/Platform/OSF1.cmake @@ -2,7 +2,7 @@ set(CMAKE_DL_LIBS "") if(CMAKE_SYSTEM MATCHES "OSF1-1.[012]") endif() -if(CMAKE_SYSTEM MATCHES "OSF1-1.*") +if(CMAKE_SYSTEM MATCHES "OSF1-1") # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 set(CMAKE_C_COMPILE_OPTIONS_PIC "-fpic") set(CMAKE_C_COMPILE_OPTIONS_PIE "-fpie") @@ -12,7 +12,7 @@ endif() -if(CMAKE_SYSTEM MATCHES "OSF1-V.*") +if(CMAKE_SYSTEM MATCHES "OSF1-V") set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*") # -shared if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,-rpath,") diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake index da20f97..aaa79c4 100644 --- a/Modules/Platform/SunOS.cmake +++ b/Modules/Platform/SunOS.cmake @@ -1,4 +1,4 @@ -if(CMAKE_SYSTEM MATCHES "SunOS-4.*") +if(CMAKE_SYSTEM MATCHES "SunOS-4") set(CMAKE_C_COMPILE_OPTIONS_PIC "-PIC") set(CMAKE_C_COMPILE_OPTIONS_PIE "-PIE") set(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC") diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index 23bf933..fa11585 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -181,7 +181,7 @@ macro(SWIG_ADD_MODULE name language) set(swig_dot_i_sources) set(swig_other_sources) foreach(it ${ARGN}) - if(${it} MATCHES ".*\\.i$") + if(${it} MATCHES "\\.i$") set(swig_dot_i_sources ${swig_dot_i_sources} "${it}") else() set(swig_other_sources ${swig_other_sources} "${it}") diff --git a/Modules/UseVTKConfig40.cmake b/Modules/UseVTKConfig40.cmake index 554b8c4..c5022e4 100644 --- a/Modules/UseVTKConfig40.cmake +++ b/Modules/UseVTKConfig40.cmake @@ -312,7 +312,7 @@ else() if(CMAKE_ANSI_CFLAGS) set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") endif() - if(CMAKE_SYSTEM MATCHES "OSF1-V.*") + if(CMAKE_SYSTEM MATCHES "OSF1-V") set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -timplicit_local -no_implicit_include") endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 0e60ed1..7d4e8b4 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -798,7 +798,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release set(CTEST_package_X11_TEST ${CTEST_TEST_CPACK}) set(CTEST_RUN_CPackComponentsForAll ${CTEST_TEST_CPACK}) - if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ") find_program(RPMBUILD NAMES rpmbuild) endif() # Do not try to build RPM @@ -899,7 +899,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release if(APPLE) list(APPEND GENLST "DragNDrop") endif() - if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ") list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE) if (NOT ${RPM_ACTIVE} EQUAL -1) list(APPEND GENLST "RPM") diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index fcde44d..001ae56 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -70,7 +70,7 @@ if(NOT 2.4 EQUAL 2.4) message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") endif() -if(CMAKE_SYSTEM MATCHES "OSF1-V.*") +if(CMAKE_SYSTEM MATCHES "OSF1-V") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") endif() diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index a4a0e0e..a908e11 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -70,7 +70,7 @@ if(NOT 2.4 EQUAL 2.4) message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") endif() -if(CMAKE_SYSTEM MATCHES "OSF1-V.*") +if(CMAKE_SYSTEM MATCHES "OSF1-V") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") endif() diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt index 5d1b376..8e21c32 100644 --- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt +++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt @@ -10,7 +10,7 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile") ERROR_QUIET TIMEOUT 10) string(TOUPPER "${makeVersionOutput}" MAKE_VERSION_OUTPUT) - if("${MAKE_VERSION_OUTPUT}" MATCHES ".*GNU MAKE.*") + if("${MAKE_VERSION_OUTPUT}" MATCHES "GNU MAKE") # build a library which we can search during the test add_library(foo STATIC foo.cpp) diff --git a/Tests/PerConfig/perconfig.cmake b/Tests/PerConfig/perconfig.cmake index 6a710ca..0731041 100644 --- a/Tests/PerConfig/perconfig.cmake +++ b/Tests/PerConfig/perconfig.cmake @@ -30,7 +30,7 @@ endif() # Verify that the implementation files are named correctly. foreach(lib pcStatic pcShared) file(STRINGS "${${lib}_file}" info LIMIT_COUNT 1 REGEX "INFO:[^[]*\\[") - if(NOT "${info}" MATCHES ".*INFO:symbol\\[${lib}\\].*") + if(NOT "${info}" MATCHES "INFO:symbol\\[${lib}\\]") message(SEND_ERROR "No INFO:symbol[${lib}] found in:\n ${${lib}_file}") endif() endforeach() -- cgit v0.12