FindRTI.cmake 3.6 KB

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