title: String regex replace need 6 args but..MinGW , CMake , w7
body: <p>I'm trying to build in w7  an aplication that I use on CentOS 6.5 without problems, but i need to compile for Windows 32 and 64 bits.
  This program is using RTi libs, but Win libs are made for VS2010, I'm tryng to build with MinGW Gcc 4.x.x , CMake 2.8.12 and Maven 3.02. I corrected some data types incompatibilities but i think that may there are some problems with slash and forward slash between MinGW and Windows 7.
  Base program was compiled succesfully, now its time for binaries.
  When i execute cmake -G "MinGW Makefiles" expression, I get this errors.</p>
  
  <pre><code>CMake Error at C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:43 (string):
    string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
    command.
  Call Stack (most recent call first):
    C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:116 (RemoveCXXComments)
    C:/Workspace/trunk/IB/src/make/IB.DDS.cmake:12 (HasInterfaces)
    C:/Workspace/trunk/IB/src/make/IB.DDS.cmake:59 (GetDDSGeneratedFiles)
    CMakeLists.txt:6 (GenerateIDLLibrary)
  
  
   CMake Error at C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:43 (string):
    string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
    command.
  Call Stack (most recent call first):
    C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:65 (RemoveCXXComments)
    C:/Workspace/trunk/IB/src/make/IB.DDS.cmake:74 (FindIncludes)
    CMakeLists.txt:6 (GenerateIDLLibrary)
  
  
  Includes for 'C:/MinGW/msys/1.0/home/blcoalla/trunk/Example/TestProfiles/TestPayload.idl'        are
  CMake Error at C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:43 (string):
    string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
    command.
  Call Stack (most recent call first):
    C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:65 (RemoveCXXComments)
    C:/Workspace/trunk/IB/src/make/IB.DDS.cmake:111 (FindIncludes)
    CMakeLists.txt:6 (GenerateIDLLibrary)
  </code></pre>
  
  <p>Here is an extract from utils.cmake:</p>
  
  <pre><code>Macro to get the content of a file
  
  -----------------------------------------------------------------
  </code></pre>
  
  <p>macro (GetFileContent OutFile)</p>
  
  <pre><code>  #message("Called GetFileContent '${ARGN}'")
    SET(cat_prog cat)
    IF(WIN32)
      IF(NOT UNIX)
        SET(cat_prog type)
      ELSE(NOT UNIX)
        message (FATAL_ERROR "cannot determine the system to call to proper 'cat/type'     method")
      ENDIF(NOT UNIX)
    ENDIF(WIN32)
  
    set (Out)
    set (tmp)
  
    foreach(gfcfile ${ARGN})
  
      if (NOT EXISTS ${gfcfile})
        message(FATAL_ERROR "Cannot find file '${gfcfile}'")
      endif(NOT EXISTS ${gfcfile})
  
      EXECUTE_PROCESS(COMMAND ${cat_prog} ${gfcfile}
                      OUTPUT_VARIABLE tmp)
      set (Out ${Out} ${tmp})
  
    endforeach(gfcfile ${ARGN})
  
    set(${OutFile} ${Out})
    #message("Leaving GetFileContent")
  
  endmacro(GetFileContent)
  #-----------------------------------------------------------------
  
  # Macro to get includes from an IDL file
  #-----------------------------------------------------------------
  macro (RemoveCXXComments Output Input)
  
    #message("RemoveCXXComments Input: '${Input}'")
    # Remove single line comments
    string(REGEX REPLACE "(//[^\n]*\n)" "" ${Output} ${Input})
    #message("RemoveCXXComments without single line: '${${Output}}'")
  
    # Remove several line comments in file
    string(REGEX REPLACE "(/\\*([^*]|[\r\n]|(\\*+([^*/]|[\r\n])))*\\*+/)" "" FileContent         ${FileContent})
    #message("RemoveCXXComments without multi line: '${${Output}}'")
  
  endmacro (RemoveCXXComments)
  #-----------------------------------------------------------------
  
  
  
  
  
  
  from CMakeLists.txt6:
  GenerateIDLLibrary(TestPayload TestPayload.idl)
  
  from IB.DDS.cmake:59:
  # Get expected generated files
  GetDDSGeneratedFiles(DDSCXXGeneratedFiles DDSHGeneratedFiles ${IdlFile})
  # message("CXX Files expected to be generated:     '${DDSCXXGeneratedFiles}'")
  #message("H Files expected to be generated:    '${DDSHGeneratedFiles}'")
  </code></pre>