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

Relocate CMake target export definitions #1657

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

donny-dont
Copy link
Contributor

When exporting a CMake target the install(TARGETS ${ZLIB_INSTALL_LIBRARIES}) is repeated with an EXPORT parameter. On Windows this would install the .dll files into the lib directory.

Set the EXPORT_NAME earlier and unconditionally on the TARGET. Then move the EXPORT to a single install(TARGETS).

When exporting a CMake target the `install(TARGETS ${ZLIB_INSTALL_LIBRARIES})` is repeated with an `EXPORT` parameter. On Windows this would install the `.dll` files into the `lib` directory.

Set the `EXPORT_NAME` earlier and unconditionally on the `TARGET`. Then move the `EXPORT` to a single `install(TARGETS)`.
Copy link

codecov bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e2c4179) 83.15% compared to head (a591ba5) 83.14%.
Report is 6 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1657      +/-   ##
===========================================
- Coverage    83.15%   83.14%   -0.01%     
===========================================
  Files          135      135              
  Lines        10898    10898              
  Branches      2817     2817              
===========================================
- Hits          9062     9061       -1     
  Misses        1127     1127              
- Partials       709      710       +1     

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

@Dead2 Dead2 requested a review from mtl1979 February 5, 2024 07:24
@mtl1979
Copy link
Collaborator

mtl1979 commented Feb 5, 2024

Before:

C:\build\git\zlib-ng\build-win>cmake --install .
-- Install configuration: "Release"
-- Up-to-date: install/Program Files (x86)/zlib/lib/zlib-ng.lib
-- Up-to-date: install/Program Files (x86)/zlib/bin/zlib-ng2.dll
-- Up-to-date: install/Program Files (x86)/zlib/lib/zlibstatic-ng.lib
-- Installing: install/Program Files (x86)/zlib/include/zlib-ng.h
-- Up-to-date: install/Program Files (x86)/zlib/include/zlib_name_mangling-ng.h
-- Up-to-date: install/Program Files (x86)/zlib/include/zconf-ng.h
-- Installing: install/Program Files (x86)/zlib/lib/pkgconfig/zlib-ng.pc
-- Up-to-date: install/Program Files (x86)/zlib/lib/zlib-ng.lib
-- Up-to-date: install/Program Files (x86)/zlib/lib/zlib-ng2.dll
-- Up-to-date: install/Program Files (x86)/zlib/lib/zlibstatic-ng.lib
-- Installing: install/Program Files (x86)/zlib/lib/cmake/zlib-ng/zlib-ng.cmake
-- Up-to-date: install/Program Files (x86)/zlib/lib/cmake/zlib-ng/zlib-ng-release.cmake
-- Installing: install/Program Files (x86)/zlib/lib/cmake/zlib-ng/zlib-ng-config.cmake
-- Installing: install/Program Files (x86)/zlib/lib/cmake/zlib-ng/zlib-ng-config-version.cmake

After:

C:\build\git\zlib-ng\build-win>cmake --install .
-- Install configuration: "Release"
-- Up-to-date: install/Program Files (x86)/zlib/lib/zlib-ng.lib
-- Up-to-date: install/Program Files (x86)/zlib/bin/zlib-ng2.dll
-- Up-to-date: install/Program Files (x86)/zlib/lib/zlibstatic-ng.lib
-- Up-to-date: install/Program Files (x86)/zlib/include/zlib-ng.h
-- Up-to-date: install/Program Files (x86)/zlib/include/zlib_name_mangling-ng.h
-- Up-to-date: install/Program Files (x86)/zlib/include/zconf-ng.h
-- Up-to-date: install/Program Files (x86)/zlib/lib/pkgconfig/zlib-ng.pc
-- Up-to-date: install/Program Files (x86)/zlib/lib/cmake/zlib-ng/zlib-ng.cmake
-- Installing: install/Program Files (x86)/zlib/lib/cmake/zlib-ng/zlib-ng-release.cmake
-- Up-to-date: install/Program Files (x86)/zlib/lib/cmake/zlib-ng/zlib-ng-config.cmake
-- Up-to-date: install/Program Files (x86)/zlib/lib/cmake/zlib-ng/zlib-ng-config-version.cmake

Copy link
Collaborator

@mtl1979 mtl1979 left a comment

Choose a reason for hiding this comment

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

Removes some duplicate files during install step. LGTM

@Dead2 Dead2 merged commit 2049832 into zlib-ng:develop Feb 7, 2024
139 checks passed
This was referenced May 30, 2024
@Dead2 Dead2 mentioned this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants