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: GNUInstallDirs, export target zlib::zlib, CPack configuration, install PDB file #148

Closed
wants to merge 5 commits into from

Conversation

rickertm
Copy link

@rickertm rickertm commented Jun 3, 2016

Use GNUInstallDirs (${CMAKE_INSTALL_LIBDIR} instead of ${CMAKE_INSTALL_PREFIX}/lib) for improved platform compatibility
Export target zlib::zlib with corresponding config file
Add CPack configuration for packaging
Install PDB file with debug information for Debug and RelWithDebInfo builds

@tschw
Copy link

tschw commented May 15, 2017

Very nice - modern buildfiles! Thanks a lot, @rickertm !

Are you sure about the CMake minimum version? I see target_include_directories first appeared in the documentation of version 2.8.11.

Not sure when @madler last looked at CMake, but guessing from version 2.4 that might have been a while ago. As a clue on what this is about, just in case:

# only needed once per dependent build tree:
find_package(zlib CONFIG)

# now to let my_project use zlib:
target_link_libraries(my_project PRIVATE zlib::zlib)

# that's all - no need to mess with directories, files, #defines, transitive dependencies

@rickertm
Copy link
Author

Thanks for the feedback. You're right, it should be 2.8.11, I was only checking for GNUInstallDirs. Besides target_include_directories(), the module CMakePackageConfigHelpers also needs 2.8.8.

hzhuang1 pushed a commit to Linaro/warpdrive-zlib that referenced this pull request Jul 31, 2019
Rename library when compiled without --zlib-compat
Vollstrecker pushed a commit to cmake-remake/zlib that referenced this pull request Nov 30, 2024
@Vollstrecker Vollstrecker mentioned this pull request Dec 11, 2024
@Neustradamus Neustradamus mentioned this pull request Jan 1, 2025
@madler
Copy link
Owner

madler commented Feb 2, 2025

See #1027 .

@madler madler closed this Feb 2, 2025
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