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

Use cmake message WARNING and SEND_ERROR when appropriate #1401

Merged
merged 4 commits into from
Aug 17, 2019

Conversation

scpeters
Copy link
Collaborator

@scpeters scpeters commented Aug 17, 2019

When compiling with colcon, messages to stdout (such as message(STATUS) calls from cmake) are not displayed on the console, while messages to stderr (such as message(WARNING) and message(SEND_ERROR)) are displayed, which makes it much easier to spot configuration issues. I noticed that many places there are message(STATUS) calls notifying when optional dependencies could not be found, so I changed those to message(WARNING). I also noticed one place in DARTFindassimp.cmake (e4ca1a8) that seemed like it should cause the build to fail, so I changed that from message(STATUS) to message(SEND_ERROR).


Before creating a pull request

  • Document new methods and classes
  • Format new code files using clang-format

Before merging a pull request

  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md
  • Add unit test(s) for this change

@scpeters
Copy link
Collaborator Author

I think ASSIMP_VERSION is not being set on windows?

@scpeters
Copy link
Collaborator Author

Yeah, I guess it's only detecting the version with pkg-config, which isn't available on windows. I can revert that change or add an if(NOT WIN32)

@jslee02
Copy link
Member

jslee02 commented Aug 17, 2019

It seems assimp 4.1 installs assimp-config.cmake and AssimpConfigVersion.cmake (on Windows as well). We could use config file on Windows instead of module file provided by DART by changing this line to:

if(WIN32)
  find_package(assimp REQUIRED CONFIG)
else()
  find_package(assimp REQUIRED MODULE)
endif()

I'm not sure if using the version config file would change the version variable name to ASSIMP_PACKAGE_VERSION because of this line. If so DARTFindassimp.cmake should set ASSIMP_VERSION to ASSIMP_PACKAGE_VERSION becuase ASSIMP_VERSION is used in other places.

@jslee02 jslee02 added this to the DART 6.10.0 milestone Aug 17, 2019
@scpeters
Copy link
Collaborator Author

It looks like xenial has assimp 3.2, which has the cmake config files:

@scpeters
Copy link
Collaborator Author

I'll split the assimp change to a separate pull request

cmake/DARTFindassimp.cmake Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 17, 2019

Codecov Report

Merging #1401 into master will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1401      +/-   ##
==========================================
+ Coverage   57.27%   57.28%   +0.01%     
==========================================
  Files         366      366              
  Lines       27432    27483      +51     
==========================================
+ Hits        15711    15743      +32     
- Misses      11721    11740      +19
Impacted Files Coverage Δ
dart/dynamics/IkFast.cpp 59.11% <0%> (-24.1%) ⬇️
dart/constraint/SoftContactConstraint.cpp 0% <0%> (ø) ⬆️
dart/utils/urdf/DartLoader.cpp 78.83% <0%> (+0.74%) ⬆️
dart/constraint/JointConstraint.cpp 9.8% <0%> (+0.87%) ⬆️
dart/constraint/ContactConstraint.cpp 73.05% <0%> (+1.07%) ⬆️
dart/constraint/JointLimitConstraint.cpp 67.68% <0%> (+2%) ⬆️
dart/dynamics/SharedLibraryIkFast.cpp 52.74% <0%> (+3.33%) ⬆️
dart/constraint/JointCoulombFrictionConstraint.cpp 85.32% <0%> (+3.74%) ⬆️
dart/constraint/MimicMotorConstraint.cpp 83.76% <0%> (+4.08%) ⬆️
dart/constraint/ServoMotorConstraint.cpp 82.56% <0%> (+4.3%) ⬆️
... and 1 more

jslee02
jslee02 previously approved these changes Aug 17, 2019
@scpeters
Copy link
Collaborator Author

Sorry I saw an inconsistent warning message, so I updated it in 22a2fc7

@jslee02 jslee02 merged commit e480e2f into dartsim:master Aug 17, 2019
@scpeters scpeters deleted the cmake_message_status branch August 18, 2019 07:48
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.

2 participants