Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to fix number of '\' escapes in cmake regexps.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 3 Jul 2022 13:40:25 +0000 (15:40 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 3 Jul 2022 13:42:20 +0000 (15:42 +0200)
tools/cmake/MakeLib.cmake
tools/cmake/Modules/FindNS3.cmake

index b0b8837..c50bd88 100644 (file)
@@ -133,7 +133,7 @@ if(enable_smpi)
        if ("${CMAKE_SYSTEM_VERSION}" STRGREATER_EQUAL "12")
             set(SIMGRID_DEP "${SIMGRID_DEP} -lpgmath")
         endif()
-        if ("${CMAKE_SYSTEM_VERSION}" MATCHES "12\.1")
+        if ("${CMAKE_SYSTEM_VERSION}" MATCHES "12\\.1")
             set(SIMGRID_DEP "${SIMGRID_DEP} -lomp")
         endif()
       endif()
index 4338dbd..b97e235 100644 (file)
@@ -29,10 +29,10 @@ if(NS3_FOUND) # Starting from 3.36, ns3 provides a working pkg-config file, maki
   endforeach()
 
   set(NS3_VERSION "${NS3_ns3-core_VERSION}")
-  string(REGEX REPLACE "3.([.0-9\-a-z]+)" "\\1" NS3_MINOR_VERSION "${NS3_VERSION}")
-  if(NS3_MINOR_VERSION MATCHES ".")
-    string(REGEX REPLACE "^[0-9]*\.([0-9]+$)" "\\1" NS3_PATCH_VERSION "${NS3_MINOR_VERSION}")
-    string(REGEX REPLACE "^([0-9]+)\.[0-9]*$" "\\1" NS3_MINOR_VERSION "${NS3_MINOR_VERSION}")
+  string(REGEX REPLACE "3\\.([-.0-9a-z]+)" "\\1" NS3_MINOR_VERSION "${NS3_VERSION}")
+  if(NS3_MINOR_VERSION MATCHES "\\.")
+    string(REGEX REPLACE "^[0-9]*\\.([0-9]+$)" "\\1" NS3_PATCH_VERSION "${NS3_MINOR_VERSION}")
+    string(REGEX REPLACE "^([0-9]+)\\.[0-9]*$" "\\1" NS3_MINOR_VERSION "${NS3_MINOR_VERSION}")
   else()
     set(NS3_PATCH_VERSION "0")
   endif()
@@ -94,13 +94,13 @@ else()
       endif()
       message(STATUS "ns-3 found ${NS3_LIBRARIES}")
       string(REGEX REPLACE ".*libns(.*)-core.*" "\\1" NS3_VERSION "${NS3_LIBRARIES}")
-      string(REGEX REPLACE "3.([.0-9\-a-z]+)" "\\1" NS3_MINOR_VERSION "${NS3_VERSION}")
+      string(REGEX REPLACE "3\\.([-.0-9a-z]+)" "\\1" NS3_MINOR_VERSION "${NS3_VERSION}")
       if(NS3_MINOR_VERSION MATCHES "dev")
         set(NS3_MINOR_VERSION "99")
       endif()
-      if(NS3_MINOR_VERSION MATCHES ".")
-        string(REGEX REPLACE "^[0-9]*\.([0-9]+$)" "\\1" NS3_PATCH_VERSION "${NS3_MINOR_VERSION}")
-        string(REGEX REPLACE "^([0-9]+)\.[0-9]*$" "\\1" NS3_MINOR_VERSION "${NS3_MINOR_VERSION}")
+      if(NS3_MINOR_VERSION MATCHES "\\.")
+        string(REGEX REPLACE "^[0-9]*\\.([0-9]+$)" "\\1" NS3_PATCH_VERSION "${NS3_MINOR_VERSION}")
+        string(REGEX REPLACE "^([0-9]+)\\.[0-9]*$" "\\1" NS3_MINOR_VERSION "${NS3_MINOR_VERSION}")
       else()
         set(NS3_PATCH_VERSION "0")
       endif()