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

Build: use ign cmake #747

Closed
wants to merge 30 commits into from
Closed

Conversation

koonpeng
Copy link

@koonpeng koonpeng commented Nov 11, 2021

🎉 New feature

closes #181

Summary

Migrates the build scripts to use macros from ign-cmake as much as possible, this is dependent on a number of PRs

Caveats

  • headers are installed to include/ignition/sdf. This shouldn't matter as long as the user is using cmake or pkgconfig to find sdformat.
  • the config header is installed to include/ignition/sdf/config.hh instead of include/sdf/sdf_config.h.
    • A redirection header is added so that the old path still works.
  • the master header is installed to include/ignition/sdformat.hh instead of include/sdf/sdf.hh.
    • A redirection header is added so that the old path still works.
  • docs are not using the standard ign_create_docs macro, I'm not sure if they are compatible enough to switch over.

Test it

git clone [email protected]:ignitionrobotics/ign-cmake.git src/ign-cmake
colcon build

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

Teo Koon Peng added 18 commits November 9, 2021 17:23
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
@koonpeng koonpeng marked this pull request as draft November 11, 2021 09:13
Teo Koon Peng added 2 commits November 12, 2021 09:41
Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a few comments

I'd recommend not deprecating the old headers in this pull request to reduce the noise in the diff. If we decide to do that, we can do it at a later time

include/sdf/sdf.hh Outdated Show resolved Hide resolved
include/sdf/config.hh.in Show resolved Hide resolved
include/sdf/CMakeLists.txt Outdated Show resolved Hide resolved

sdf_install_includes("" ${headers}
${CMAKE_CURRENT_BINARY_DIR}/sdf.hh)
ign_install_all_headers(EXCLUDE_FILES sdf.hh sdf_config.h)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you exclude these header files, they will not be installed. do they need to be excluded?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in cbdc0de

@koonpeng koonpeng marked this pull request as ready for review December 1, 2021 02:28
Teo Koon Peng added 2 commits December 1, 2021 10:34
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is failing this should fix it

src/cmd/CMakeLists.txt Outdated Show resolved Hide resolved
conf/CMakeLists.txt Outdated Show resolved Hide resolved
@koonpeng koonpeng changed the title WIP: Build: use ign cmake Build: use ign cmake Dec 2, 2021
@koonpeng
Copy link
Author

koonpeng commented Dec 2, 2021

I think the CI is failing because it is using an "old" version of ignition-cmake, we need the recent prs which allow to remove the ignition prefix.

It's trying to look for src/cmd/cmdignition-sdformat.rb.in, but it should be looking for src/cmd/cmdsdformat.rb.in instead.

@ahcorde ahcorde added the needs upstream release Blocked by a release of an upstream library label Dec 2, 2021
@scpeters
Copy link
Member

scpeters commented Dec 6, 2021

I think the CI is failing because it is using an "old" version of ignition-cmake, we need the recent prs which allow to remove the ignition prefix.

It's trying to look for src/cmd/cmdignition-sdformat.rb.in, but it should be looking for src/cmd/cmdsdformat.rb.in instead.

the Ubuntu CI is using a nightly build of ignition-cmake2; you need to follow @ahcorde's suggestions above to fix the configuration

@@ -15,7 +15,7 @@
*
*/
#include <iostream>
#include <sdf/sdf.hh>
#include <ignition/sdformat.hh>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be reverted

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done d1144d4

Teo Koon Peng and others added 3 commits December 7, 2021 09:17
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
@koonpeng
Copy link
Author

koonpeng commented Dec 7, 2021

the Ubuntu CI is using a nightly build of ignition-cmake2; you need to follow @ahcorde's suggestions above to fix the configuration

I committed the suggested changes but still getting the same errors.

@scpeters
Copy link
Member

scpeters commented Dec 8, 2021

the Ubuntu CI is using a nightly build of ignition-cmake2; you need to follow @ahcorde's suggestions above to fix the configuration

I committed the suggested changes but still getting the same errors.

my apologies, I forgot that gazebo-tooling/gzdev#44 would be needed

@scpeters
Copy link
Member

scpeters commented Dec 9, 2021

I'll make an ign-cmake2 prerelease when gazebosim/gz-cmake#195 is approved

@scpeters
Copy link
Member

scpeters commented Dec 9, 2021

I've opened an draft pull request in #780 that targets sdf10 that borrows heavily from your work here

@chapulina chapulina added the 🌱 garden Ignition Garden label Dec 30, 2021
@adlarkin
Copy link
Contributor

adlarkin commented Jan 4, 2022

Should we close this PR, since #780 was merged?

@scpeters
Copy link
Member

scpeters commented Jan 5, 2022

alternative approach merged to sdf10 in #780 and merged forward to main in #813

@scpeters scpeters closed this Jan 5, 2022
@koonpeng koonpeng deleted the build/use-ign-cmake branch January 5, 2022 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden needs upstream release Blocked by a release of an upstream library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants