Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-37996

CMake cleanup: stop overwriting ZLIB_FOUND /ZLIB_LIBRARIES and similar

    XMLWordPrintable

Details

    • Bug
    • Status: In Review (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.11, 11.4, 11.8
    • 10.11, 11.4, 11.8
    • Compiling
    • None
    • Q3/2026 Server Maintenance, Q3/2026 Server Development

    Description

      Apparently, it breaks when used with vcpkg.
      There are more intelligent ways to handle that now: e.g create MariaDB::zlib library, which points (in sense of cmake ALIAS or INTERFACE library) either to standard ZLIB:ZLIB, or to own compiled zlib, and use it consistently instead of ${ZLIB_LIBRARIES}.
      target_include_directories should be set consistently, and then it will help eliminate multiple ZLIB_INCLUDE_DIRS sprinkled around the code.

      Do the same with OpenSSL , i.e create MariaDB::OpenSSL which points to either OpenSSL or WolfSSL, define it well (so that users pick up correct target_link_libraries and target_include_directories) and use it consistently in the code

      Do the same with PCRE2, and other things that can be either system or bundled , where "bundled" can often mean ExternalProject_Add.
      That is, for such targets use interface and alias libraries, MariaDB::lib points to correct library, and carries include directory dependency, and it is not necessary to add anything but target_link_library() to use it.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              wlad Vladislav Vaintroub
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 1d 43m Original Estimate - 1d 43m
                  1d 43m
                  Remaining:
                  Time Spent - 2d Remaining Estimate - 0.4d
                  0.4d
                  Logged:
                  Time Spent - 2d Remaining Estimate - 0.4d
                  2d

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.