Hi Brad,

Ok, just released a new version of OpenRAVE that uses configuration
files. I'm attaching the final cmake files, can you double check to
make sure there are no problems?

I wasn't really sure what changes are needed to use the new registry
functions you committed. is there a nightly build of cmake somewhere?

Also here's my comments while going through this:

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

if( PACKAGE_FIND_VERSION )
...
else()
  set(PACKAGE_VERSION_COMPATIBLE 1)
endif()

is this correct?

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

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? Or are imported targets declared inside configuration files and
used in conjunction with OpenRAVE_LIBRARIES variables?


EXPORT targets are not working for me as expected.

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.


thanks,
rosen,

2011/4/14 Brad King <[email protected]>:
> On 04/13/2011 11:32 AM, Rosen Diankov wrote:
>> ok, the changes you are proposing sound exciting! perhaps this can be
>> a start for a truly cross platform package management system ;0)
>
> If only ;)
>
>> so is the best approach for now to create a minimal FindOpenRAVE.cmake
>> to give to user, and put FindOpenRAVEConfig.cmake in
>> $installprefix/lib/cmake/?
>
> The name "FindOpenRAVEConfig" makes no sense.  The files are:
>
> - FindOpenRAVE.cmake goes in user applications and contains basically
>
>  find_package(OpenRAVE NO_MODULE PATHS ${REGISTRY_ENTRIES})
>
> - OpenRAVEConfig.cmake goes in the directory
>
>    <prefix>/lib/cmake/OpenRAVE-${VERSION}
>
> - OpenRAVEConfigVersion.cmake goes in next to the config file.
>  http://www.cmake.org/Wiki/CMake/Tutorials/Packaging#Package_Version_Files
>
> -Brad
>
# - Find Open Robotics Automation Virtual Enviornment (OpenRAVE) Installation
# http://www.openrave.org
#
# OpenRAVE provides an environment for testing, developing, and deploying motion planning algorithms
# in real-world robotics applications. The main focus is on simulation and analysis of kinematic and
# geometric information related to motion planning. OpenRAVE’s stand-alone nature allows is to be easily
# integrated into existing robotics systems. An important target application is industrial robotics automation.
#
# Users can set the following variables before calling the module:
#  OpenRAVE_DIR - The preferred installation prefix for searching for OpenRAVE. Set by the user.
#
# OpenRAVE_ROOT_DIR - the root directory where the installation can be found
# OpenRAVE_CXXFLAGS - extra flags
# OpenRAVE_INCLUDE_DIRS - include directories
# OpenRAVE_LIBRARY_DIRS - link directories
# OpenRAVE_LIBRARIES - libraries to link plugins with
# OpenRAVE_CORE_LIBRARIES - libraries to link openrave run-time with
# OpenRAVE_Boost_VERSION - the boost version openrave was compiled with

#==================================================================================
# Copyright (C) 2009-2011 Rosen Diankov
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
#  License text for the above reference.)
#==================================================================================
get_filename_component(_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_PREFIX "${_PREFIX}" PATH)
get_filename_component(_PREFIX "${_PREFIX}" PATH)
get_filename_component(OpenRAVE_ROOT_DIR "${_PREFIX}" PATH)

set( OpenRAVE_CXXFLAGS "-DOPENRAVE_DLL -DOPENRAVE_CORE_DLL" )
if( WIN32 )
  set( OpenRAVE_CXXFLAGS "${OpenRAVE_CXXFLAGS} -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB")
endif()
if( MSVC )
  set( OpenRAVE_CXXFLAGS "${OpenRAVE_CXXFLAGS} /EHc-")
endif()
set( OpenRAVE_LINK_FLAGS "" )
set( OpenRAVE_INCLUDE_DIRS "${OpenRAVE_ROOT_DIR}/include/openrave-0.3")
set( OpenRAVE_LIBRARY_DIRS "${OpenRAVE_ROOT_DIR}/lib")
set( OpenRAVE_LIBRARIES openrave)
set( OpenRAVE_CORE_LIBRARIES openrave-core)
set( OpenRAVE_Boost_VERSION "1.40")

#if( WIN32 )
#  # search for the boost version openrave was compiled with
#  set(Boost_USE_MULTITHREAD ON)
#  set(Boost_USE_STATIC_LIBS OFF)
#  set(Boost_USE_STATIC_RUNTIME OFF)
#  set(Boost_FIND_VERSION_EXACT 1)
#  find_package(Boost ${OpenRAVE_Boost_VERSION} COMPONENTS thread date_time)
#  if(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
#    set(OpenRAVE_FOUND 1)
#    
#    set( OpenRAVE_LINK_FLAGS " ")
#    set( OpenRAVE_INCLUDE_DIRS "${OpenRAVE_ROOT_DIR}/include" ${Boost_INCLUDE_DIRS})
#    set( OpenRAVE_LIBRARY_DIRS "${OpenRAVE_ROOT_DIR}/lib" ${Boost_LIBRARY_DIRS})
#    set( OpenRAVE_LIBRARIES openrave libxml2)
#    set( OpenRAVE_CORE_LIBRARIES ${OpenRAVE_LIBRARIES} openrave-core ${Boost_THREAD_LIBRARY} ${Boost_DATE_TIME_LIBRARY})
#  else(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
#    message(WARNING "Failed to find Boost 1.40 necessary OpenRAVE")
#  endif(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
#endif( WIN32 )

MARK_AS_ADVANCED(
  OpenRAVE_ROOT_DIR
  OpenRAVE_CXXFLAGS
  OpenRAVE_LINK_FLAGS
  OpenRAVE_INCLUDE_DIRS
  OpenRAVE_LIBRARIES
  OpenRAVE_CORE_LIBRARIES
  OpenRAVE_Boost_VERSION
)

#add_library(openrave SHARED IMPORTED)
#if( MSVC )
#  set_property(TARGET openrave PROPERTY IMPORTED_LOCATION c:/path/to/bar.dll IMPORTED_IMPLIB c:/path/to/bar.lib)
#endif()

#if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" GREATER 2.6.1)
#  find_library(FOO_LIBRARY NAMES foo)
#  add_library(foo UNKNOWN IMPORTED)
#  set_property(TARGET foo PROPERTY IMPORTED_LOCATION "${FOO_LIBRARY}")
#endif()
set( PACKAGE_VERSION "0.3.0" )
if( PACKAGE_FIND_VERSION )
  if( "${PACKAGE_FIND_VERSION}" EQUAL "0.3.0")
    set(PACKAGE_VERSION_EXACT 1)
  endif()
  if( "${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "0" )
    if( "${PACKAGE_FIND_VERSION_MINOR}" LESS 3 )
      set(PACKAGE_VERSION_UNSUITABLE 1)
    elseif( "${PACKAGE_FIND_VERSION_MINOR}" EQUAL 3 )
      set(PACKAGE_VERSION_COMPATIBLE 1)
    endif()
  endif()
else( PACKAGE_FIND_VERSION )
  set(PACKAGE_VERSION_COMPATIBLE 1)
endif( PACKAGE_FIND_VERSION )
# - Find Open Robotics Automation Virtual Enviornment (OpenRAVE) Installation
# http://www.openrave.org
#
# OpenRAVE provides an environment for testing, developing, and deploying motion planning algorithms
# in real-world robotics applications. The main focus is on simulation and analysis of kinematic and
# geometric information related to motion planning. OpenRAVE’s stand-alone nature allows is to be easily
# integrated into existing robotics systems. An important target application is industrial robotics automation.

#==================================================================================
# Copyright (C) 2009-2011 Rosen Diankov
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
#  License text for the above reference.)
#==================================================================================

set(_OpenRAVE_PATHS)
if(NOT OpenRAVE_DIR)
  if( WIN32 )
    # search in the registry
    set(_OpenRAVE_CONFIG_NAME "openrave-config.exe")
    get_filename_component(OpenRAVE_VERSION_STRING "[HKEY_LOCAL_MACHINE\\SOFTWARE\\OpenRAVE;]" NAME)
    message(STATUS "OpenRAVE ${OpenRAVE_VERSION_STRING} found in registry")
    if( OpenRAVE_VERSION_STRING )
      get_filename_component(_OpenRAVE_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\OpenRAVE\\${OpenRAVE_VERSION_STRING};InstallRoot]" ABSOLUTE)
      set(_OpenRAVE_PATHS ${_OpenRAVE_PATHS} ${_OpenRAVE_PATH})
    endif( OpenRAVE_VERSION_STRING )
  else(WIN32)
    set(_OpenRAVE_CONFIG_NAME "openrave-config")
  endif(WIN32)
  # search for the config path
  find_program(_OpenRAVE_CONFIG_EXECUTABLE NAMES ${_OpenRAVE_CONFIG_NAME} DOC "openrave executable")
  if( _OpenRAVE_CONFIG_EXECUTABLE )
    get_filename_component(_OpenRAVE_PATH "${_OpenRAVE_CONFIG_EXECUTABLE}" PATH) # bin
    get_filename_component(_OpenRAVE_PATH "${_OpenRAVE_PATH}" PATH)
    set(_OpenRAVE_PATHS ${_OpenRAVE_PATHS} ${_OpenRAVE_PATH})
  endif( _OpenRAVE_CONFIG_EXECUTABLE )
endif(NOT OpenRAVE_DIR)

find_package(OpenRAVE NO_MODULE PATHS ${_OpenRAVE_PATHS})
_______________________________________________
cmake-developers mailing list
[email protected]
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to