uriparser / uriparser

:hocho: Strictly RFC 3986 compliant URI parsing and handling library written in C89; moved from SourceForge to GitHub

Home Page:https://uriparser.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need a way to disable installation of header files

codeInnovation opened this issue · comments

I need a way to disable the installation of the files such as the public header files when built with CMake. If you try to embed the uriparser as a static library, these files get automatically installed with the package. When two installers both try to include the uriparser library, then there is a collision and it becomes impossible to install both packages. In other words, I'm looking for an option like Google Test's INSTALL_GTEST in the uriparser library, that can be switched off when needed.

What are your thoughts on this? Is there a way to turn off installation of files today? I didn't see a way yet in the CMakeLists.txt file. I'm certainly willing to help make the change.

In other words you need a switch to bypass all of

uriparser/CMakeLists.txt

Lines 187 to 204 in ba9990a

install(
TARGETS
uriparser
EXPORT
uriparser
ARCHIVE
DESTINATION
${CMAKE_INSTALL_LIBDIR}
LIBRARY
DESTINATION
${CMAKE_INSTALL_LIBDIR}
RUNTIME
DESTINATION
${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/uriparser
)
?

Are you aware of the problems described at https://wiki.gentoo.org/wiki/Why_not_bundle_dependencies ?

Yes I was hoping for a switch to disable the install command. There are several calls to install in CMakeLists.txt. I have a change on a fork that bypasses them all. I wasn't really certain if they all needed to be bypassed though or if just the one you have shown would be sufficient.

As for the problems with static linking, I guess that is true. It does have drawbacks but deployment environments can be challenging sometimes.

Do you want to share your version as a pull request or would you rather want to review a pull request done by me? For a name I'd like URIPARSER_INSTALL, I think. Default would be ON.

I'll submit a pull request. Thanks!