Skip to content

Commit

Permalink
Pull up module path tweaks to main config file
Browse files Browse the repository at this point in the history
This is a follow up to robotology#1733 for non-static YARP builds, which
were prone to cause similar errors in downstreams (see robotology#1736) due
to internal dependencies (e.g. TinyXML) not being found.
  • Loading branch information
PeterBowman committed Jun 13, 2018
1 parent 74a526f commit 026aa5b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 8 additions & 0 deletions cmake/template/YARPConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ if (CMAKE_VERSION VERSION_LESS 3.9)
endif()
endif()

# Provide YARP's own module search paths for internal use by find_package()
set(_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH})

# Include YARPTargets.cmake file (that includes for now, targets without a
# specific destination
if(NOT TARGET YARP::yarpidl_thrift)
Expand Down Expand Up @@ -164,6 +168,10 @@ foreach(_yarp_module ${YARP_FIND_COMPONENTS})
list(APPEND YARP_LIBRARIES YARP::YARP_${_yarp_module})
endforeach()

# Restore the original situation
set(CMAKE_MODULE_PATH ${_CMAKE_MODULE_PATH})
unset(_CMAKE_MODULE_PATH)

# Ensure that all requested modules are available
check_required_components(YARP)

Expand Down
6 changes: 0 additions & 6 deletions cmake/template/YARPTargetsStatic.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ if(NOT "${_expected_targets}" STREQUAL "")
list(REMOVE_DUPLICATES _expected_targets)
endif()

# Provide YARP's own module search paths for use by find_package()
set(_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH})

# Properly find the dependencies. This will force to include all the
# dependencies also for packages in other exports
foreach(_target ${_targets})
Expand All @@ -56,8 +52,6 @@ foreach(_target ${_targets})
endforeach()

# Restore the original situation
set(CMAKE_MODULE_PATH ${_CMAKE_MODULE_PATH})
unset(_CMAKE_MODULE_PATH)
unset(YARP_static_hack_FOUND)
unset(YARP_static_hack_NOT_FOUND_MESSAGE)
set(CMAKE_FIND_PACKAGE_NAME ${_CMAKE_FIND_PACKAGE_NAME})
Expand Down
1 change: 1 addition & 0 deletions doc/release/v3_0_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Bug Fixes
### Build System

* Fixed issue with vtk config files when looking for the `pcl` component
* Fixed issue with internal YARP component dependencies not being found.


### Libraries
Expand Down

0 comments on commit 026aa5b

Please sign in to comment.