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

newton-4.00 cmake style is directory based instead of target based. #323

Open
jonesmz opened this issue Nov 20, 2023 · 0 comments
Open

newton-4.00 cmake style is directory based instead of target based. #323

jonesmz opened this issue Nov 20, 2023 · 0 comments

Comments

@jonesmz
Copy link
Contributor

jonesmz commented Nov 20, 2023

The newton-4.00 folder has CMakeLists.txt files which are not easy to consume by other code.

The type is written in terms of applying (repeatedly) includes, compiler definitions, and link libraries, to the current directory and subdirectorys.

The maintainers of the CMake program strongly recommend against this style (to the point where there was a recent ticket (sometime in the last 6 months, give or take) in their bug tracker about removing it entirely), and instead recommend attaching everything to targets.

For example:

in newton-4.00/sdk/dNewton, the library is defined as building with

include_directories(.)
include_directories(../dCore)
include_directories(../dTinyxml)
include_directories(../dProfiler)
include_directories(../dCollision)

include_directories(dJoints/)
include_directories(dModels/)
include_directories(dIkSolver/)
include_directories(dParticles/)
include_directories(dModels/dVehicle/)
include_directories(dModels/dCharacter/)

But none of these include directories are exposed as public properties of the library, which is defined with add_library(${projectName} ...) (Static, or Shared, depending on build settings). This means that projects trying to use newton have no way to access the header files, or compilation flags without constructing their own list of includes and compilation flags, which may not be 100% accurate, especially after an update.

It would help greatly if newton-4.00 would adopt a target-centric cmake configuration instead. Otherwise I'm still stuck on 3.14.

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

No branches or pull requests

1 participant