Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export each CMake component/target as a separate file #786

Merged
merged 21 commits into from
Oct 13, 2016
Merged

Conversation

jslee02
Copy link
Member

@jslee02 jslee02 commented Oct 9, 2016

Since #652, DART is built in several components depending on what the optional dependencies are installed. However, all the exported CMake targets are shipped in a single target file, which is problematic in finding DART components when the DART packages are partially installed. The single target file always attempts to check the binary files of all the component while some components could be not installed, and it returns errors in that case. This PR is to fix the problem.

Main changes

  • Adopted component system of personalrobotics/aikido#107
    • split target files per target (previously single target file was used)
    • Introduced component targets. A component could have multiple targets.
    • Note: Component dart is the default component so we don't need to explicitly have it COMPONENTS variable in find_package. For example, find_package(dart) is identical to find_package(dart COMPONENTS dart).

Subsidiary changes

  • The bullet collision detector is packaged as a separate component collision-bullet (or target dart-collision-bullet). Component utils now depends on collision-bullet because SkelParser needs to parse the bullet collision detector.
  • Introduced CMake option DART_VERBOSE. If it's Off, which is the default, CMake prints minimal messages like:
-- 
-- ============================================
--                 DART 6.1.1
-- ============================================
-- Adding 9 components including the default component 'dart'
-- Adding 33 unittests
-- Adding 25 examples
-- Adding 8 tutorials
-- 
-- Run 'make' to build all the components
-- Run 'make tests' to build all the unittests
-- Run 'make examples' to build all the examples
-- Run 'make tutorials' to build all the tutorials
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/js/dev/dart/components/build/Debug

If it's On, CMake prints the full messages as before.

  • Used CMake property instead of variable to manage global values

Caveat

Edit: Let's stay with using upper case as before and reopen the discussion later if needed.

Adopting the CMake scripts, the CMake package name for DART is now lowercases, dart. Subsequently, the CMake variables use the lowercase prefix such as dart_FOUND and dart_INCLUDE_DIRS.

It wasn't intentional at first, but I'm starting to be inclined to use lower cases for consistency with the library name. Not sure what's the preferred way, though. If we use lower case then the consumer project should find DART as find_package(dart), which breaks the backward compatibility.

So I think we should do either of:

(1) provide both of upper and lower case versions at the same time until the next major release.
(2) just return to the upper case. In this case, I may need to ask help to @mkoval. I tried to tweak Component.cmake and DARTConfig.cmake, but it wasn't clear to me.


This change is Reviewable

@jslee02 jslee02 added this to the DART 6.1.1 milestone Oct 9, 2016
@jslee02 jslee02 changed the title Export CMake component/target files separately Export each CMake component/target as a separate file Oct 10, 2016
@jslee02 jslee02 changed the base branch from master to release-6.1 October 10, 2016 22:40
@jslee02 jslee02 merged commit 458319e into release-6.1 Oct 13, 2016
@jslee02 jslee02 deleted the components branch October 13, 2016 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant