Skip to content

Use proper cmake exports - #5958

Draft
larshg wants to merge 5 commits into
PointCloudLibrary:masterfrom
larshg:Usepropercmakeexport
Draft

larshg wants to merge 5 commits into
PointCloudLibrary:masterfrom
larshg:Usepropercmakeexport

Conversation

@larshg

@larshg larshg commented Feb 10, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@larshg
larshg force-pushed the Usepropercmakeexport branch 2 times, most recently from 47db731 to 55ce06a Compare February 17, 2024 16:59
@dg0yt

dg0yt commented Mar 27, 2024

Copy link
Copy Markdown
Contributor

Might be a candidate for a test build in vcpkg ... once the other port issues are sorted out.

@larshg
larshg force-pushed the Usepropercmakeexport branch 2 times, most recently from d640a97 to 03925ea Compare October 5, 2025 10:04

@dg0yt dg0yt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would expect to see PRIVATE/PUBLIC keywords in target_link_libraries(). But I understand that this may need more changes.

Comment thread CMakeLists.txt
Comment on lines +99 to +101
DISSECT_VERSION()
GET_OS_INFO()
SET_INSTALL_DIRS()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would appreciate adopting lower-case commands in new/moved CMake code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't mind, do you have any pointers that this is "good practice or examples where this is done" 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just glanced at methods at VTK - and indeed they are seemingly all lowercase - I'll keep it in mind.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Basically it is done in all modern CMake code, including reference documentation. I believe lower-case is widely accepted as more readable for humans.
The transition is facilitated by the fact that command names are case-insensitive.

(Variable names are case-sensitive, and I don't have a strong opinion about them. Also keywords like PUBLIC are case-sensitive. This makes them stand out nicely. Don't discussion build types 🤦)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just glanced at methods at VTK - and indeed they are seemingly all lowercase - I'll keep it in mind.

VTK... It is maintained by Kitware as is CMake. It is probably an old CMake code base, and it tells me that Kitware should ... have a lot of early awareness of shortcomings in CMake.
(Coincidentally I'm trying to fix issues in the vtk port in vcpkg.)

@larshg

larshg commented Oct 5, 2025

Copy link
Copy Markdown
Contributor Author

I would expect to see PRIVATE/PUBLIC keywords in target_link_libraries(). But I understand that this may need more changes.

Yes, this is on the todo - but would probably be a separate PR as it require lot of changes.

@larshg
larshg force-pushed the Usepropercmakeexport branch 2 times, most recently from 9f43486 to 9310a16 Compare October 10, 2025 12:23
@larshg
larshg force-pushed the Usepropercmakeexport branch 3 times, most recently from 755f27d to 9aa44fa Compare October 14, 2025 16:44
@larshg
larshg force-pushed the Usepropercmakeexport branch from 9aa44fa to 4084e25 Compare October 14, 2025 16:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants