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 consistency fixes #41

Open
wants to merge 3 commits into
base: master/s-line
Choose a base branch
from
Open

CMake consistency fixes #41

wants to merge 3 commits into from

Conversation

Ghostkeeper
Copy link
Contributor

These are some changes that we made to the CMake build system to prepare for Cura 5.0.

From the original PR:

In order to get this to work on our build-system and working for all three OSes we did a shit tons of boy scouting in our cmake. We removed old methods with variables and try to be consisted in a target-based approach. The idea is that we don't patch stuff down the line, but that the install should place everything in the correct path in a uniform way across all of Cura's dependencies. Most of these changes are in the other PR's. The CMakeLists.txt changes here are for consistency overal.

I'd suggest that you take a look at these changes to see how they can be adjusted for the build environment of the firmware. I don't expect the changes here to have a big impact on the way you're working though.

Contributes to issue CURA-8640.

jellespijker and others added 3 commits March 24, 2022 16:30
Changed install path on Debian from dist-packages

Contributes to CURA-8640
Will only be present in development environment

Contributes to CURA-8640
find_package(Python3 ${CURA_PYTHON_VERSION} EXACT REQUIRED COMPONENTS Interpreter)
if(NOT DEFINED Python_VERSION)
set(Python_VERSION
3.10
Copy link
Member

Choose a reason for hiding this comment

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

we have 3.7 on the printer, anything above that won't work for firmware.

Copy link
Contributor

@CoenSchalkwijk CoenSchalkwijk Apr 15, 2022

Choose a reason for hiding this comment

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

Hm, I'm assuming libCharon needs 3.10 when used with/for Cura?
If so, to be on the safe side: do not use a default value, but require Python_VERSION to be specified instead?
In order to prevent 'silent' mistakes.

if(NOT DEFINED Python_SITELIB_LOCAL)
set(Python_SITELIB_LOCAL
"${Python_SITELIB}"
CACHE PATH "Local alternative site-package location to install Cura" FORCE)
endif()

option(INSTALL_SERVICE "Install the Charon DBus-service" ON)
option(INSTALL_CLIENT "Install the Charon Client library" ON)
Copy link
Contributor

@CoenSchalkwijk CoenSchalkwijk Apr 15, 2022

Choose a reason for hiding this comment

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

With the exclusions removed, do these still matter?
INSTALL_CLIENT seems to be unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I think these could be removed as well then, if they are indeed unused now.

I'm not sure why those excludes were removed because this is code for the firmware-side.

set(CHARON_INSTALL_PATH lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages)
endif()

set(_excludes PATTERN __pycache__ EXCLUDE)
Copy link
Contributor

Choose a reason for hiding this comment

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

No longer necessary?

endif()
find_package(Python ${Python_VERSION} EXACT REQUIRED COMPONENTS Interpreter)
message(STATUS "Linking and building ${project_name} against Python ${Python_VERSION}")
if(NOT DEFINED Python_SITELIB_LOCAL)
Copy link
Contributor

Choose a reason for hiding this comment

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

Where/how's this expected to be set now?

Copy link
Contributor Author

@Ghostkeeper Ghostkeeper May 12, 2022

Choose a reason for hiding this comment

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

Cura-build sets this variable upon building. The reason is that all other packages are installed to site-packages on all platforms (Windows, MacOS and Linux) but on Debian-based platforms like our Ubuntu build server the default for Python_SITELIB is dist-packages.

We added this so that from cura-build we could override the installation directory to be consistent so that we would have to make fewer exceptions.
The default remains the Python_SITELIB that becomes dist-packages on Debian-based systems, like it was before.

Copy link
Contributor

@CoenSchalkwijk CoenSchalkwijk May 13, 2022

Choose a reason for hiding this comment

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

Since these changes are aimed at changes/requirements from the cura-build, is it stil possible to use this for a cura-build-less build of libCharon? As in: does Team Styx now need to use the cura-build to release/create a new pkg for libCharon?

Copy link
Contributor Author

@Ghostkeeper Ghostkeeper May 13, 2022

Choose a reason for hiding this comment

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

No, that's not our intention. That would be very unworkable for you!

If Python_SITELIB_LOCAL is not specified it should default to the old behaviour.

Would it be acceptable if we add documentation to this about that this parameter exists and leave the behaviour as-is, then?

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.

4 participants