FindRTI.cmake 3.22 KB
Newer Older
1 2 3
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#[=======================================================================[.rst:
FindRTI
-------

Try to find M&S HLA RTI libraries

This module finds if any HLA RTI is installed and locates the standard
RTI include files and libraries.

RTI is a simulation infrastructure standardized by IEEE and SISO.  It
has a well defined C++ API that assures that simulation applications
are independent on a particular RTI implementation.

::

  http://en.wikipedia.org/wiki/Run-Time_Infrastructure_(simulation)



This code sets the following variables:

::

  RTI_INCLUDE_DIR = the directory where RTI includes file are found
  RTI_LIBRARIES = The libraries to link against to use RTI
  RTI_DEFINITIONS = -DRTI_USES_STD_FSTREAM
  RTI_FOUND = Set to FALSE if any HLA RTI was not found



Report problems to <certi-devel@nongnu.org>
#]=======================================================================]
36

37 38 39
macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
  if(NOT ${QUIET})
    message(${TYPE} "${MSG}")
40 41
  endif()
endmacro()
42

43
set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
44

45
# Detect the CERTI installation, http://www.cert.fr/CERTI
46 47
# Detect the MAK Technologies RTI installation, http://www.mak.com/products/rti.php
# note: the following list is ordered to find the most recent version first
48
set(RTI_POSSIBLE_DIRS
49
  ENV CERTI_HOME
50 51 52 53 54
  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 3.2 MSVC++ 8.0;Location]"
  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 3.2-win32-msvc++8.0;InstallLocation]"
  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 2.2;Location]"
  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 2.2;InstallLocation]")

55
set(RTI_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
56
# The MAK RTI has the "lib" prefix even on Windows.
57
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
58

59
find_library(RTI_LIBRARY
60 61 62 63 64
  NAMES RTI RTI-NG
  PATHS ${RTI_POSSIBLE_DIRS}
  PATH_SUFFIXES lib
  DOC "The RTI Library")

65 66
if (RTI_LIBRARY)
  set(RTI_LIBRARIES ${RTI_LIBRARY})
67
  RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library found: ${RTI_LIBRARY}")
68
else ()
69
  RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library NOT found")
70
endif ()
71

72
find_library(RTI_FEDTIME_LIBRARY
73 74 75 76 77
  NAMES FedTime
  PATHS ${RTI_POSSIBLE_DIRS}
  PATH_SUFFIXES lib
  DOC "The FedTime Library")

78 79
if (RTI_FEDTIME_LIBRARY)
  set(RTI_LIBRARIES ${RTI_LIBRARIES} ${RTI_FEDTIME_LIBRARY})
80
  RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI FedTime found: ${RTI_FEDTIME_LIBRARY}")
81
endif ()
82

83
find_path(RTI_INCLUDE_DIR
84 85 86 87 88
  NAMES RTI.hh
  PATHS ${RTI_POSSIBLE_DIRS}
  PATH_SUFFIXES include
  DOC "The RTI Include Files")

89
if (RTI_INCLUDE_DIR)
90
  RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers found: ${RTI_INCLUDE_DIR}")
91
else ()
92
  RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers NOT found")
93
endif ()
94 95

# Set the modified system variables back to the original value.
96
set(CMAKE_FIND_LIBRARY_PREFIXES "${RTI_OLD_FIND_LIBRARY_PREFIXES}")
97

98
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
99 100 101 102
FIND_PACKAGE_HANDLE_STANDARD_ARGS(RTI DEFAULT_MSG
  RTI_LIBRARY RTI_INCLUDE_DIR)

# $Id$