Skip to content

Conversation

qbisi
Copy link

@qbisi qbisi commented Aug 31, 2025

nixpkgs use absolute CMAKE_INSTALL_* path during cmake configure phase. This pull request remove the need to patch freecad submodule OndselSolver in nixpkgs:
https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/fr/freecad/0002-FreeCad-OndselSolver-pkgconfig.patch.

@chennes
Copy link
Member

chennes commented Sep 16, 2025

I think you can avoid the branching by using CMake's built-ins, e.g.

set(PKGCONFIG_LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
set(PKGCONFIG_INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}")

Is OndselSolver.pc being installed?

@qbisi
Copy link
Author

qbisi commented Sep 16, 2025

I think you can avoid the branching by using CMake's built-ins, e.g.

Thanks, will give it a trial.

Is OndselSolver.pc being installed?

Yes, installed by freecad (nixpkgs have applied a patch to fix the generated OndselSolver.pc )

$ cat /nix/store/42ijx9jg6026846s51rlnxy5dhdi193z-freecad-1.0.2/share/pkgconfig/OndselSolver.pc                         
prefix=/nix/store/42ijx9jg6026846s51rlnxy5dhdi193z-freecad-1.0.2
exec_prefix=/nix/store/42ijx9jg6026846s51rlnxy5dhdi193z-freecad-1.0.2
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: OndselSolver
Description: Assembly Constraints and Multibody Dynamics code
Version: 1.0.1

Requires:
Libs: -L${libdir} -lOndselSolver
Cflags: -I${includedir}

@qbisi
Copy link
Author

qbisi commented Sep 16, 2025

Tested work for me.

@qbisi
Copy link
Author

qbisi commented Sep 16, 2025

Or just use @CMAKE_INSTALL_FULL_LIBDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ in OndeselSolver.pc.in for simplification ?

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.

2 participants