FindRTI.cmake 3.6 KB

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