FindRTI.cmake 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. FindRTI
  5. -------
  6. Try to find M&S HLA RTI libraries
  7. This module finds if any HLA RTI is installed and locates the standard
  8. RTI include files and libraries.
  9. RTI is a simulation infrastructure standardized by IEEE and SISO. It
  10. has a well defined C++ API that assures that simulation applications
  11. are independent on a particular RTI implementation.
  12. ::
  13. http://en.wikipedia.org/wiki/Run-Time_Infrastructure_(simulation)
  14. This code sets the following variables:
  15. ::
  16. RTI_INCLUDE_DIR = the directory where RTI includes file are found
  17. RTI_LIBRARIES = The libraries to link against to use RTI
  18. RTI_DEFINITIONS = -DRTI_USES_STD_FSTREAM
  19. RTI_FOUND = Set to FALSE if any HLA RTI was not found
  20. Report problems to <certi-devel@nongnu.org>
  21. #]=======================================================================]
  22. macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
  23. if(NOT ${QUIET})
  24. message(${TYPE} "${MSG}")
  25. endif()
  26. endmacro()
  27. set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
  28. # Detect the CERTI installation, http://www.cert.fr/CERTI
  29. # Detect the MAK Technologies RTI installation, http://www.mak.com/products/rti.php
  30. # note: the following list is ordered to find the most recent version first
  31. set(RTI_POSSIBLE_DIRS
  32. ENV CERTI_HOME
  33. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 3.2 MSVC++ 8.0;Location]"
  34. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 3.2-win32-msvc++8.0;InstallLocation]"
  35. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 2.2;Location]"
  36. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 2.2;InstallLocation]")
  37. set(RTI_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
  38. # The MAK RTI has the "lib" prefix even on Windows.
  39. set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
  40. find_library(RTI_LIBRARY
  41. NAMES RTI RTI-NG
  42. PATHS ${RTI_POSSIBLE_DIRS}
  43. PATH_SUFFIXES lib
  44. DOC "The RTI Library")
  45. if (RTI_LIBRARY)
  46. set(RTI_LIBRARIES ${RTI_LIBRARY})
  47. RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library found: ${RTI_LIBRARY}")
  48. else ()
  49. RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library NOT found")
  50. endif ()
  51. find_library(RTI_FEDTIME_LIBRARY
  52. NAMES FedTime
  53. PATHS ${RTI_POSSIBLE_DIRS}
  54. PATH_SUFFIXES lib
  55. DOC "The FedTime Library")
  56. if (RTI_FEDTIME_LIBRARY)
  57. set(RTI_LIBRARIES ${RTI_LIBRARIES} ${RTI_FEDTIME_LIBRARY})
  58. RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI FedTime found: ${RTI_FEDTIME_LIBRARY}")
  59. endif ()
  60. find_path(RTI_INCLUDE_DIR
  61. NAMES RTI.hh
  62. PATHS ${RTI_POSSIBLE_DIRS}
  63. PATH_SUFFIXES include
  64. DOC "The RTI Include Files")
  65. if (RTI_INCLUDE_DIR)
  66. RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers found: ${RTI_INCLUDE_DIR}")
  67. else ()
  68. RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers NOT found")
  69. endif ()
  70. # Set the modified system variables back to the original value.
  71. set(CMAKE_FIND_LIBRARY_PREFIXES "${RTI_OLD_FIND_LIBRARY_PREFIXES}")
  72. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  73. FIND_PACKAGE_HANDLE_STANDARD_ARGS(RTI DEFAULT_MSG
  74. RTI_LIBRARY RTI_INCLUDE_DIR)
  75. # $Id$