[cmake-developers] Adding the OpenRAVE library module

Brad King brad.king at kitware.com
Fri Apr 15 08:23:00 EDT 2011


On 04/15/2011 06:06 AM, Rosen Diankov wrote:
> I wasn't really sure what changes are needed to use the new registry
> functions you committed.

No changes are needed to your config file or find module.  The command
will look at the system package registry automatically.  It is up to
your installer to set the registry value though.

> is there a nightly build of cmake somewhere?

http://www.cmake.org/files/dev/?C=M;O=D

> in the -version.cmake file, PACKAGE_FIND_VERSION is not set when just
> using find_package(OpenRAVE), therefore i had to enclose everything
> with:

It loads the file so that it can read the PACKAGE_VERSION to know what
version has been found even if no specific version was requested.  You
do not need to set PACKAGE_VERSION_COMPATIBLE or PACKAGE_VERSION_EXACT
if no PACKAGE_FIND_VERSION is set on input because if no version is
requested CMake does not check them.  Therefore you do not need the
if/else/endif pattern.

Also, the code

  if( "${PACKAGE_FIND_VERSION}" EQUAL "0.3.0" )

does not make sense because EQUAL only works with numerical values.
It can compare individual integers but not 3-component versions.
Use VERSION_LESS, VERSION_GREATER, or VERSION_EQUAL for that.

> the wiki says to set foo_LIBRARY, where the cmake readme says _LIBRARY
> is deprecated, _LIBRARIES should be used. which one is it?

Nothing says that _LIBRARY id deprecated.  Where did you see that?
The readme says that it should not be used as an *output* of the find
module in the calling CMakeLists.txt file.  The individual _LIBRARY
variables are for storing the results of find_library calls in the
cache.  The mention of it on the wiki is only talking about how to
report the result from a FindXXX module as an imported target.  That
has nothing to do with package configuration files.

> I read all the documentation on imported/exported targets, but there's
> one thing i don't understand. Is this a replacement for configuration
> files?

They are complementary.  The config file in the install tree should
load the targets file generated by install(EXPORT).  The config file
in the build tree (if you support that) should load the targets file
created by the export() command.

http://www.cmake.org/Wiki/CMake/Tutorials/Packaging#Packaging_and_Exporting

> Or are imported targets declared inside configuration files and
> used in conjunction with OpenRAVE_LIBRARIES variables?

Yes.  See above.

> the libopenrave library links to static libraries, which will never be
> exported from openrave, but i get the following message:
> 
> CMake Error: INSTALL(EXPORT "openrave-targets" ...) includes target
> "libopenrave" which requires target "crlibm" that is not in the export
> set.

CMake follows transitive link dependencies by default.  You can hide
implementation details of a shared library by setting the property
"LINK_INTERFACE_LIBRARIES" on it.

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:LINK_INTERFACE_LIBRARIES

-Brad



More information about the cmake-developers mailing list