Closed bebuch closed 1 year ago
Thanks the for PR! This is a great addition. It seems like the FindLibLZMA module has something similar to protect against multiple find_package() calls, so it seems like a common protection to include.
Can you wrap your commit message with newlines around 73 character width? The first sentence in your commit message is a bit long. The reason we care is because in our releases the Changelog is generated from the commit messages. In order to keep this and the commit log itself looking nice, we have a few standards we try to enforce.
@JiaT75 Unfortunately I don't know if this can be done online on GitHub and I'm too stressed right now to make an offline change using Git.
I have given you access to my fork. Would be nice if you could do that.
@bebuch I was able to make the commit message change during the Squash and Merge. The commit is in your name and I only made stylistic edits to the message (I did not change the meaning).
Thanks for your contribution!
Boost iostream uses
find_package
in quiet mode and then again usesfind_package
with required. This second call triggers aadd_library cannot create imported target "ZLIB::ZLIB" because another target with the same name already exists.
This can simply be fixed by skipping the alias part on secondary
find_package
runs.Pull request checklist
Please check if your PR fulfills the following requirements:
Pull request type
Please check the type of change your PR introduces: - [x] Bugfix - [ ] Feature - [ ] Code style update (formatting, renaming, typo fix) - [ ] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] Documentation content changes - [ ] Other (please describe): ## What is the current behavior? From Boost iostream compilation which finds XZ via config file: ``` CMake Error at C:/Temp/lib/win_x86_64_debug/lib/cmake/zlib/ZLIBConfig.cmake:13 (add_library): add_library cannot create imported target "ZLIB::ZLIB" because another target with the same name already exists. Call Stack (most recent call first): libs/iostreams/CMakeLists.txt:30 (find_package) libs/iostreams/CMakeLists.txt:38 (boost_iostreams_option) ``` ## What is the new behavior? `find_package` works on the first and all folloring runs. ## Does this introduce a breaking change? - [ ] Yes - [x] No