-
Notifications
You must be signed in to change notification settings - Fork 6
Refactor CMake with JRL CMake Modules v2 #28
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
base: main
Are you sure you want to change the base?
Conversation
551117d to
1c71142
Compare
| HEADERS ${nanoeigenpy_HEADERS} | ||
| BASE_DIRS include | ||
| ) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a missing install directive for the main target ${PROJECT_NAME} I think. That's what breaks the pixi-build tests is my guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I build the binary dir (${CMAKE_BINARY_DIR}lib/site-packages/nanoeigenpy) just like the install space.
Then I just install the whole directory, including the nanoeigenpy target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems it gets installed to lib/python{version}/site-packages/site-packages. I'll suggest a fix.
|
We need to update the changelog. I suggest adding this in the |
CMakeLists.txt
Outdated
| TARGETS ${PROJECT_NAME} | ||
| EXPORT ${TARGETS_EXPORT_NAME} | ||
| LIBRARY DESTINATION ${Python_SITELIB} | ||
| DIRECTORY ${CMAKE_BINARY_DIR}/lib/site-packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| DIRECTORY ${CMAKE_BINARY_DIR}/lib/site-packages | |
| DIRECTORY ${CMAKE_BINARY_DIR}/lib/site-packages/ |
This will ensure the contents of the directory, not the site-packages directory itself, gets installed at destination.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I wonder why it is not built in ${CMAKE_BINARY_DIR}/lib/site-packages/${PROJECT_NAME} like the other project I ported, but in ${CMAKE_BINARY_DIR}lib/site-packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because for this project we had decided with @Lucas-Haubert to install the compiled library and stubs directly into the sitelib without a subdirectory with its own __init__ py file, because that file would do absolutely nothing in this instance - no wrapping or processing was required.
CMakeLists.txt
Outdated
| OUTPUT ${Python_SITELIB}/nanoeigenpy.pyi | ||
| PYTHON_PATH $<TARGET_FILE_DIR:nanoeigenpy> | ||
| ) | ||
| if(nanobind_add_stub) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition doesn't work it seems.
The correct signature should be:
| if(nanobind_add_stub) | |
| if(COMMAND nanobind_add_stub) |
remove custom function as they behave strangely
no chance observed in this repo. Its for future proofness.
|
I don't understand why ROS-CI isn't working here. It seems templates don't work. Is it a C++ version issue or something? Or an upstream issue? |
This PR is a full rewrite of the CMake files with the JRL CMake Modules v2.
c++17minimum requiredpytest