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

CMake: Include libenet.pc in installation #233

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

h3xx
Copy link

@h3xx h3xx commented Dec 4, 2023

  • Include libenet.pc in installation
  • Add missing project version as far as CMake is concerned; One would need to bump the version in CMakeLists.txt when releasing
  • Use GNUInstallDirs to determine install paths
  • Fix missing shared library symlinks (Prior PR)
  • Don't default to building static libenet (Use -DBUILD_SHARED_LIBS=(ON|OFF) to control whether to build shared-only (ON) or static-only (OFF) libraries.) (Prior PR)

Does not break existing ability to build using GNU Autotools. In fact, it fixes some compatibility with it (GNU Autotools installs the .pc file, therefore so should CMake).

Closes #243

@Croydon
Copy link
Contributor

Croydon commented Apr 24, 2024

The rest might still be nice to have. Could you rebase this pull request @h3xx?

@Croydon Croydon mentioned this pull request Apr 24, 2024
- Add missing project version
- Fix missing shared library symlinks
@h3xx h3xx changed the title Improve CMake installation CMake: Include libenet.pc in installation Apr 29, 2024
@h3xx
Copy link
Author

h3xx commented Apr 29, 2024

Done rebasing. Excellent work on #242 and #244!

@@ -104,6 +110,16 @@ install(TARGETS enet
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/enet
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you remove ${CMAKE_CURRENT_SOURCE_DIR}?

Copy link
Author

@h3xx h3xx Apr 29, 2024

Choose a reason for hiding this comment

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

It's not necessary. Per the CMake documentation for install() (https://cmake.org/cmake/help/latest/command/install.html):

The FILES form [i.e. install(FILES...) or install(DIRECTORY...)] specifies rules for installing files for a project. File names given as relative paths are interpreted with respect to the current source directory. Files installed by this form are by default given permissions OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ if no PERMISSIONS argument is given.

Try it! :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, this part looks good to me.
Don't have the knowledge to review the rest

@brad0
Copy link

brad0 commented May 11, 2024

This looks good to me and does what I would expect.

@brad0
Copy link

brad0 commented Jun 23, 2024

@Croydon Can you please get this and the LANGUAGES CMake patch in?

@Croydon
Copy link
Contributor

Croydon commented Jun 23, 2024

@Croydon Can you please get this and the LANGUAGES CMake patch in?

I am just another community member and can't do such a thing, sorry.

@brad0
Copy link

brad0 commented Jul 6, 2024

I am just another community member and can't do such a thing, sorry.

Oh, my misunderstanding. I saw you in various tickets and PRs and thought maybe you were associated with the project.

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.

Issues with CMake
3 participants