MantisBT - CMake
View Issue Details
0007716CMakeModulespublic2008-09-22 03:532008-09-25 16:53
Petr Gotthard 
 
normalfeatureN/A
closedwon't fix 
CMake-2-6 
 
0007716: [New Module] FindRTI module for HLA RTI
As discussed on the list, here is a FindXXX.cmake module that tries to find a Run Time Infrastructure of the Modeling and Simulation High Level Architecture (M&S HLA). It would be great if you add this to CMake.
http://www.cmake.org/pipermail/cmake/2008-September/024140.html [^]
No tags attached.
? FindRTI.cmake (3,501) 2008-09-22 03:53
https://public.kitware.com/Bug/file/1730/FindRTI.cmake
? FindRTI.cmake(2) (3,260) 2008-09-24 12:25
https://public.kitware.com/Bug/file/1737/FindRTI.cmake%282%29
? FindRTI.cmake(3) (3,461) 2008-09-25 05:13
https://public.kitware.com/Bug/file/1739/FindRTI.cmake%283%29
Issue History
2008-09-22 03:53Petr GotthardNew Issue
2008-09-22 03:53Petr GotthardFile Added: FindRTI.cmake
2008-09-23 23:15Philip LowmanNote Added: 0013563
2008-09-23 23:35Philip LowmanNote Added: 0013564
2008-09-24 12:16Petr GotthardNote Added: 0013569
2008-09-24 12:17Petr GotthardNote Edited: 0013569
2008-09-24 12:25Petr GotthardFile Added: FindRTI.cmake(2)
2008-09-25 05:13Petr GotthardFile Added: FindRTI.cmake(3)
2008-09-25 16:53Bill HoffmanStatusnew => closed
2008-09-25 16:53Bill HoffmanNote Added: 0013588
2008-09-25 16:53Bill HoffmanResolutionopen => won't fix

Notes
(0013563)
Philip Lowman   
2008-09-23 23:15   
Petr,

Looks good. I'll point this module out to my coworker for him to try out when he starts messing around with HLA again.

There were a few things I noticed which could use some tweaks before it's checked in.

1. "/usr" and "/usr/local" don't need to be listed in POSSIBLE_DIRS because they will get searched automatically when FIND_LIBRARY gets called (also in the opposite order since the system path on Linux is /usr/local, /usr, /). See the full documentation for FIND_LIBRARY for the gory details on this extremely complex command. =)

2. For the RTI_FOUND, RTI_FIND_REQUIRED stuff, use the FIND_PACKAGE_HANDLE_STANDARD_ARGS helper macro. See any of the CMake modules in 2.6.0 or greater for an example of how to do this.

3. Use RTI_INCLUDE_DIR instead of RTI_INCLUDE (seems to be the going convention)

4. The MARK_AS_ADVANCED() call at the bottom has no effect because you're only marking normal variables as advanced. Only CACHE variables (like RTI_LIBRARY) can be marked as advanced and I would recommend leaving it up to the user of FindRTI if they want to mark RTI_LIBRARY or FEDTIME_LIBRARY as advanced.

5. Is there a reason you're exposing RTI_LIBRARY_DIRS?
(0013564)
Philip Lowman   
2008-09-23 23:35   
Sorry, a few other things I noticed

1. Rename POSSIBLE_DIRS to RTI_POSSIBLE_DIRS to lessen the chance of variable collision.

2. In the same light, rename the MESSAGE_QUIETLY macro to RTI_MESSAGE_QUIETLY to avoid macro name collisions. Anywhere you declare a local variable or macro in your Find module you should at the bare minimum preface it with FOO_ where FOO is your module name.

3. What is the reason you need to manipulate CMAKE_FIND_LIBRARY_PREFIXES (just curious)?
(0013569)
Petr Gotthard   
2008-09-24 12:16   
(edited on: 2008-09-24 12:17)
Thank you, Philip,

1.-4. Fixed.
5. If there was a reason, I don't remember it ;-). Removed.

1.-2. Fixed.
3. Because the prefix under Windows set to "", but the MAK RTI libraries have the "lib" prefix even under Windows.

(0013588)
Bill Hoffman   
2008-09-25 16:53   
Please see here:

http://www.itk.org/Wiki/CMake:Module_Maintainers [^]

and here:

http://www.cmake.org/pipermail/cmake/2007-July/015258.html [^]