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/pkgconfig] Adding generated install defines to libs folders #405

Open
danoli3 opened this issue Jul 28, 2024 · 1 comment
Open

[CMake/pkgconfig] Adding generated install defines to libs folders #405

danoli3 opened this issue Jul 28, 2024 · 1 comment
Assignees

Comments

@danoli3
Copy link
Member

danoli3 commented Jul 28, 2024

[CMake/pkgconfig]

To support the future of openFrameworks.

Deploying these assistive library files alongside the binaries allows for easy to link, bind and compile with CMake / PKGconfig and allows for easy versioning alongside now the Apple PKL formats describing the binaries and variant defines for those binaries.

This solves many linking issues in the build processes as these files contain all the info required by the build systems like versions and locations.

Generated files from build system:

  • Un-usable as files are full paths as per build location.
    Fix: I've developed a bash script to automatically re-write the fullpaths created via CMake build system on install after apothecary builds and set the paths to relative to deploy locations and tests show it works!

Currently the paths are like so:

$1/lib/$PLATFORM/$ARCH/pkgconfig/*pc
$1/lib/$PLATFORM/$ARCH/cmake/cmake_install.cmake

Another location could be directly in the location of libraries like the PKL files are currently - depending on further analysis of how many files are generated
like:
$1/lib/$PLATFORM/$ARCH/cmake_install.cmake
$1/lib/$PLATFORM/$ARCH/zlib.pc

For xcFrameworks this would be within target for each platform:
image

@danoli3 danoli3 self-assigned this Jul 28, 2024
@danoli3
Copy link
Member Author

danoli3 commented Jul 28, 2024

Example unedited: PKGConfig file:

prefix=/Users/one/SOURCE/apothecary/apothecary/build/libpng/build_osx_MAC_ARM64/Release
exec_prefix=/Users/one/SOURCE/apothecary/apothecary/build/libpng/build_osx_MAC_ARM64/Release
libdir=/Users/one/SOURCE/apothecary/apothecary/build/libpng/build_osx_MAC_ARM64/Release/lib
includedir=/Users/one/SOURCE/apothecary/apothecary/build/libpng/build_osx_MAC_ARM64/Release/include/libpng16

Name: libpng
Description: Loads and saves PNG files
Version: 1.6.41
Requires.private: zlib
Libs: -L${libdir} -lpng16
Libs.private: -lz -lm
Cflags: -I${includedir}

Patched to be shipped:

prefix=../../../
exec_prefix=../../../
libdir=../
includedir=../../../include/libpng16

Name: libpng
Description: Loads and saves PNG files
Version: 1.6.41
Requires.private: zlib
Libs: -L${libdir} -lpng16
Libs.private: -lz -lm
Cflags: -I${includedir}

CMake files (sometimes seperate with Versions) - hence folder good idea
image

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