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

Improvements to CMake + Introduction of CPack based packages #346

Merged

Conversation

vijaiaeroastro
Copy link
Collaborator

@vijaiaeroastro vijaiaeroastro commented Feb 20, 2024

Base branch : develop (Right after the 2.3.0-alpha release)

This PR introduces significant enhancements to the CMake infrastructure of lib3mf, detailed as follows:

  1. CMake Configuration: It adds a valid CMake configuration file, lib3mfConfig.cmake, enabling the inclusion of lib3mf as a standard CMake-based C++ library.
  2. CPack Integration: The integration of CPack simplifies the structure of SDK package, which, though comprehensive, previously required additional steps like defining libraries and manually including header paths. With the use of the lib3mfConfig.cmake file, CPack facilitates the generation of CMake packages, including ready-to-install packages for Windows, Linux, and OSX, along with Debian and RPM packages for direct installation on the respective operating systems.
  3. VCPKG Foundation: This update sets the groundwork for VCPKG integration, aiming to achieve a VCPKG deployment of lib3mf, which was a primary motivation behind the CMake improvements.

…anges in the root CMakeLists.txt to accomodate it + Introduction of CPack
…ng is an issue). Also symlinks seem to disappear. This will require a change in cmake config script since it requires exact .so file to be referenced instead of lib3mf.so (A problem to worry at a latter time)
Copy link

codecov bot commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.20%. Comparing base (8ceec9c) to head (5be552e).

Additional details and impacted files
@@                     Coverage Diff                     @@
##           feature/cmake-improvements     #346   +/-   ##
===========================================================
  Coverage                       69.20%   69.20%           
===========================================================
  Files                             271      271           
  Lines                           28691    28691           
===========================================================
  Hits                            19855    19855           
  Misses                           8836     8836           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

CMakeLists.txt Outdated Show resolved Hide resolved
@martinweismann
Copy link
Member

This all looks great!

Tested on windows the CppNew and CPPDynamic new.
CPPDynamic works out of the box.
The CppNew example's CMakeList does not yet take care of copying over the shared library.

We will need to clearly define what the role of the old sdk will be in the future, and how the examples are made available.

@vijaiaeroastro
Copy link
Collaborator Author

@martinweismann In CppNew, do you expect the library to be copied over to the same location as the target binary ?

@martinweismann
Copy link
Member

I think so. That would make the example run out of the box.

@vijaiaeroastro
Copy link
Collaborator Author

I will make the necessary changes.

@vijaiaeroastro
Copy link
Collaborator Author

@martinweismann The necessary CMake changes to fix VCPKG installation are included in the latest commits. For example, VCPKG requires the lib3mfConfig.cmake to be inside the share/lib3mf directory instead of the lib folder. This necessitates changes in the lib3mfConfig.cmake file, as the paths for the lib and bin directories are now different. These changes are dynamically handled in lib3mfConfig.cmake based on whether it is a VCPKG or non-VCPKG installation.

@@ -1,6 +1,9 @@
on: [push, pull_request]
env:
LIB3MF_VERSION: "2.3.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change the version to 2.3.1

uses: actions/upload-artifact@v2
with:
name: lib3mf.so
path: dist/lib3mf.so.2
path: dist/lib3mf.so.2
- name: Extract File Name (CPacked Archive)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this Archive still necessary ?

Copy link
Collaborator

@gangatp gangatp left a comment

Choose a reason for hiding this comment

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

Hi Vijay,

I have few doubts in this PR regarding lib3mfconfig.cmake, does it help/break building lib3mf from source? Are the expamples in this PR, necessary?

@gangatp gangatp merged commit f96fc53 into 3MFConsortium:feature/cmake-improvements Apr 15, 2024
14 checks passed
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.

3 participants