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

Adding configuration such that CMake find_package can also find the installed package. #30

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

stefi07
Copy link
Contributor

@stefi07 stefi07 commented Aug 20, 2024

Export all libraries to milkTargets.cmake, which gets installed in lib/cmake (following pkgconfig).
Also create milk_all alias for a collective target that would include all libraries in client project.
Generate milkConfigVersion.cmake and milkConfig.cmake, which are also installed in lib/cmake.

installed package.

Export all libraries to milkTargets.cmake, which gets installed in
lib/cmake (following pkgconfig).
Also create milk_all alias for a collective target that would include
all libraries in client project.
Generate milkConfigVersion.cmake and milkConfig.cmake, which are also
installed in lib/cmake.
@DasVinch
Copy link
Member

Hi @stefi07 , thanks a lot for your contribution (I'll take a deeper look asap)!
Can you clarify what is the intended goal? Faster, more modular install, or am I missing something?

@stefi07
Copy link
Contributor Author

stefi07 commented Aug 22, 2024

Hi @DasVinch, thanks for considering my contribution.

The existing install procedure for milk creates a pkgconf dir with .pc files that allow pkg-conf to retrieve information about the installed library. In a CMakeLists.txt file, however, this requires first to call find_package on PkgConfig (i.e. including the line find_package(PkgConfig REQUIRED)).

This PR (and the symmetrical one for ImageStreamIO) adds direct support for CMake’s find_package (https://cmake.org/cmake/help/v3.0/command/find_package.html) by adding to the install procedure the creation of .cmake config files that are installed in a cmake dir (in the same parent dir as the pkgconf dir). With find_package the library is included as an imported target, which makes it easier to manage dependencies downstream.

@DasVinch
Copy link
Member

Looks good to me! Just holding on the ISIO PR.

@DasVinch DasVinch merged commit ec9119d into milk-org:dev Aug 29, 2024
2 checks passed
@DasVinch DasVinch mentioned this pull request Aug 29, 2024
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