Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'mc' into mc++
[simgrid.git] / buildtools / Cmake / Modules / FindNS3.cmake
index 04e568c..2e0afbd 100644 (file)
@@ -13,7 +13,7 @@ find_library(HAVE_NS3_LIB
   )
 
 find_library(HAVE_NS3_CORE_LIB
-  NAME ns3-core
+  NAME ns3-core ns3.14-core ns3.17-core
   PATH_SUFFIXES lib64 lib ns3/lib
   PATHS
   ${ns3_path}
@@ -21,7 +21,7 @@ find_library(HAVE_NS3_CORE_LIB
 
 find_path(HAVE_CORE_MODULE_H
   NAME ns3/core-module.h
-  PATH_SUFFIXES include ns3/include include/ns3.14.1
+  PATH_SUFFIXES include ns3/include include/ns3.14.1 include/ns3.17
   PATHS
   ${ns3_path}
   )
@@ -56,14 +56,14 @@ if(HAVE_CORE_MODULE_H)
   if(HAVE_NS3_LIB)
     message(STATUS "Warning: NS-3 version <= 3.10")
     set(HAVE_NS3 1)
-    set(NS3_VERSION 310)
-    string(REPLACE "/libns3.${LIB_EXE}" ""  HAVE_NS3_LIB "${HAVE_NS3_LIB}")
+    set(NS3_VERSION_MINOR 10)
+    string(REPLACE "/libns3.${LIB_EXE}" "" HAVE_NS3_LIB "${HAVE_NS3_LIB}")
   endif()
   if(HAVE_NS3_CORE_LIB)
     message(STATUS "NS-3 version > 3.10")
+    string(REGEX REPLACE ".*ns3.([0-9]+)-core.*" "\\1" NS3_VERSION_MINOR "${HAVE_NS3_CORE_LIB}")
     set(HAVE_NS3 1)
-    set(NS3_VERSION 312)
-    string(REPLACE "/libns3-core.${LIB_EXE}" ""  HAVE_NS3_LIB "${HAVE_NS3_CORE_LIB}")
+    string(REPLACE "/libns3-core.${LIB_EXE}" "" HAVE_NS3_LIB "${HAVE_NS3_CORE_LIB}")
   endif()
 endif()
 
@@ -84,11 +84,8 @@ if(HAVE_NS3)
     endif()
 
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-I${HAVE_CORE_MODULE_H} -L${HAVE_NS3_LIB} ")
+    message(STATUS "TEST: ${CMAKE_CXX_FLAGS}")
   endif()
 else()
   message(STATUS "Warning: To use NS-3 Please install ns3 at least version 3.10 (http://www.nsnam.org/releases/)")
 endif()
-
-if(HAVE_NS3 AND enable_supernovae)
-  set(enable_supernovae OFF)
-endif()