~ubuntu-branches/ubuntu/raring/simgrid/raring

« back to all changes in this revision

Viewing changes to buildtools/Cmake/Modules/FindNS3.cmake

  • Committer: Package Import Robot
  • Author(s): Martin Quinson
  • Date: 2013-01-31 00:24:51 UTC
  • mfrom: (10.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20130131002451-krejhf7w7h24lpsc
Tags: 3.9~rc1-1
* New upstream release: the "Grasgory" release. Major changes:
  - Gras was completely removed from this version.
  - Documentation reorganization to ease browsing it.
  - New default value for the TCP_gamma parameter: 4MiB

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# If you use NS-3 version 3.14 (prefer used at most 3.13) be sure having do
 
2
# ln -sf libns3.14.1-applications-debug.so libns3-applications.so
 
3
# ln -sf libns3.14.1-internet-debug.so libns3-internet.so
 
4
# ln -sf libns3.14.1-point-to-point-debug.so libns3-point-to-point.so
 
5
# ln -sf libns3.14.1-csma-debug.so libns3-csma.so
 
6
# ln -sf libns3.14.1-core-debug.so libns3-core.so
 
7
 
1
8
find_library(HAVE_NS3_LIB
2
 
    NAME ns3
3
 
    PATH_SUFFIXES lib64 lib ns3/lib
4
 
    PATHS
5
 
    ${ns3_path}
6
 
)
 
9
  NAME ns3
 
10
  PATH_SUFFIXES lib64 lib ns3/lib
 
11
  PATHS
 
12
  ${ns3_path}
 
13
  )
7
14
 
8
15
find_library(HAVE_NS3_CORE_LIB
9
 
    NAME ns3-core
10
 
    PATH_SUFFIXES lib64 lib ns3/lib
11
 
    PATHS
12
 
    ${ns3_path}
13
 
)
 
16
  NAME ns3-core
 
17
  PATH_SUFFIXES lib64 lib ns3/lib
 
18
  PATHS
 
19
  ${ns3_path}
 
20
  )
14
21
 
15
22
find_path(HAVE_CORE_MODULE_H
16
 
        NAME ns3/core-module.h
17
 
    PATH_SUFFIXES include ns3/include
18
 
    PATHS
19
 
    ${ns3_path}
20
 
)
 
23
  NAME ns3/core-module.h
 
24
  PATH_SUFFIXES include ns3/include include/ns3.14.1
 
25
  PATHS
 
26
  ${ns3_path}
 
27
  )
21
28
 
22
29
message(STATUS "Looking for core-module.h")
23
30
if(HAVE_CORE_MODULE_H)
24
 
message(STATUS "Looking for core-module.h - found")
25
 
else(HAVE_CORE_MODULE_H)
26
 
message(STATUS "Looking for core-module.h - not found")
27
 
endif(HAVE_CORE_MODULE_H)
 
31
  message(STATUS "Looking for core-module.h - found")
 
32
else()
 
33
  message(STATUS "Looking for core-module.h - not found")
 
34
endif()
28
35
mark_as_advanced(HAVE_CORE_MODULE_H)
29
36
 
30
37
message(STATUS "Looking for lib ns3")
31
38
if(HAVE_NS3_LIB)
32
 
message(STATUS "Looking for lib ns3 - found")
33
 
else(HAVE_NS3_LIB)
34
 
message(STATUS "Looking for lib ns3 - not found")
35
 
endif(HAVE_NS3_LIB)
 
39
  message(STATUS "Looking for lib ns3 - found")
 
40
else()
 
41
  message(STATUS "Looking for lib ns3 - not found")
 
42
endif()
36
43
mark_as_advanced(HAVE_NS3_LIB)
37
44
 
38
45
message(STATUS "Looking for lib ns3-core")
39
46
if(HAVE_NS3_CORE_LIB)
40
 
message(STATUS "Looking for lib ns3-core - found")
41
 
else(HAVE_NS3_CORE_LIB)
42
 
message(STATUS "Looking for lib ns3-core - not found")
43
 
endif(HAVE_NS3_CORE_LIB)
 
47
  message(STATUS "Looking for lib ns3-core - found")
 
48
else()
 
49
  message(STATUS "Looking for lib ns3-core - not found")
 
50
endif()
 
51
 
44
52
mark_as_advanced(HAVE_NS3_LIB)
45
53
mark_as_advanced(HAVE_NS3_CORE_LIB)
46
54
 
47
55
if(HAVE_CORE_MODULE_H)
48
 
    if(HAVE_NS3_LIB)
49
 
        message(STATUS "Warning: NS-3 version <= 3.10")
50
 
        set(HAVE_NS3 1)
51
 
        set(NS3_VERSION 310)
52
 
        string(REPLACE "/libns3.${LIB_EXE}" ""  HAVE_NS3_LIB "${HAVE_NS3_LIB}")
53
 
    endif(HAVE_NS3_LIB)
54
 
    if(HAVE_NS3_CORE_LIB)
55
 
        message(STATUS "NS-3 version > 3.10")
56
 
        set(HAVE_NS3 1)
57
 
        set(NS3_VERSION 312)
58
 
        string(REPLACE "/libns3-core.${LIB_EXE}" ""  HAVE_NS3_LIB "${HAVE_NS3_CORE_LIB}")
59
 
    endif(HAVE_NS3_CORE_LIB)
60
 
endif(HAVE_CORE_MODULE_H)
 
56
  if(HAVE_NS3_LIB)
 
57
    message(STATUS "Warning: NS-3 version <= 3.10")
 
58
    set(HAVE_NS3 1)
 
59
    set(NS3_VERSION 310)
 
60
    string(REPLACE "/libns3.${LIB_EXE}" ""  HAVE_NS3_LIB "${HAVE_NS3_LIB}")
 
61
  endif()
 
62
  if(HAVE_NS3_CORE_LIB)
 
63
    message(STATUS "NS-3 version > 3.10")
 
64
    set(HAVE_NS3 1)
 
65
    set(NS3_VERSION 312)
 
66
    string(REPLACE "/libns3-core.${LIB_EXE}" ""  HAVE_NS3_LIB "${HAVE_NS3_CORE_LIB}")
 
67
  endif()
 
68
endif()
61
69
 
62
70
if(HAVE_NS3)
63
 
        string(REGEX MATCH "${HAVE_NS3_LIB}" operation "$ENV{LD_LIBRARY_PATH}")
64
 
        if(NOT operation)
65
 
                message(STATUS "Warning: To use NS-3 don't forget to set LD_LIBRARY_PATH with:  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HAVE_NS3_LIB}")
66
 
        else(NOT operation)
67
 
        
68
 
                string(REGEX MATCH "-L${HAVE_NS3_LIB} " operation1 "${CMAKE_C_FLAGS}")
69
 
                if(NOT operation1)
70
 
                        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${HAVE_NS3_LIB} ")
71
 
                endif(NOT operation1)
72
 
                
73
 
                string(REGEX MATCH "-I${HAVE_CORE_MODULE_H} " operation1 "${CMAKE_C_FLAGS}")
74
 
                if(NOT operation1)
75
 
                        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${HAVE_CORE_MODULE_H} ")
76
 
                endif(NOT operation1)
77
 
        
78
 
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-I${HAVE_CORE_MODULE_H} -L${HAVE_NS3_LIB} ")
79
 
        endif(NOT operation)            
80
 
else(HAVE_NS3)
81
 
    message(STATUS "Warning: To use NS-3 Please install ns3 at least version 3.10 (http://www.nsnam.org/releases/)")
82
 
endif(HAVE_NS3)
 
71
  string(REGEX MATCH "${HAVE_NS3_LIB}" operation "$ENV{LD_LIBRARY_PATH}")
 
72
  if(NOT operation)
 
73
    message(STATUS "Warning: To use NS-3 don't forget to set LD_LIBRARY_PATH with:      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HAVE_NS3_LIB}")
 
74
  else()
 
75
 
 
76
    string(REGEX MATCH "-L${HAVE_NS3_LIB} " operation1 "${CMAKE_C_FLAGS}")
 
77
    if(NOT operation1)
 
78
      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${HAVE_NS3_LIB} ")
 
79
    endif()
 
80
 
 
81
    string(REGEX MATCH "-I${HAVE_CORE_MODULE_H} " operation1 "${CMAKE_C_FLAGS}")
 
82
    if(NOT operation1)
 
83
      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${HAVE_CORE_MODULE_H} ")
 
84
    endif()
 
85
 
 
86
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-I${HAVE_CORE_MODULE_H} -L${HAVE_NS3_LIB} ")
 
87
  endif()
 
88
else()
 
89
  message(STATUS "Warning: To use NS-3 Please install ns3 at least version 3.10 (http://www.nsnam.org/releases/)")
 
90
endif()
83
91
 
84
92
if(HAVE_NS3 AND enable_supernovae)
85
 
    set(enable_supernovae OFF)
86
 
endif(HAVE_NS3 AND enable_supernovae)
 
93
  set(enable_supernovae OFF)
 
94
endif()