Skip to content

Documentation of CMake / CPMFindPackage cross-platform incompatibilities? #675

@aral-matrix

Description

@aral-matrix

After getting a working CMakeLists.txt file to pull in dependencies from either local installed packages (CPM_LOCAL_PACKAGES_ONLY) or remote packages (CPM_DOWNLOAD_ALL) on my flavour of Linux (Debian 12/13), I understand that some of the code does not correctly pull in dependencies on Windows. Examples that seem to fail (I can't test this myself) are quoted below.

My question is: Is there a comprehensive list of portability-breaking functions of CMake? Ideally so that I can search it for CPMFindPackage and find those issues that concern this specific function?

Relevant project is here (this specific commit):
troldal/OpenXLSX@e1f0589

  • it seemingly does not build with option(OPENXLSX_ENABLE_LIBZIP "Enable using libzip" ON)

Problematic sections

boost nowide does not get pulled in:

    CPMFindPackage(
            NAME Boost
            VERSION 1.73.0
            GITHUB_REPOSITORY boostorg/nowide
            # NAME nowide
            GIT_TAG standalone
            OPTIONS
            "NOWIDE_INSTALL ON"
            FIND_PACKAGE_ARGUMENTS "COMPONENTS nowide"
    )

libzip does not get pulled in:

    CPMFindPackage(
            NAME libzip
            GITHUB_REPOSITORY nih-at/libzip
            GIT_TAG v1.11.4
            OPTIONS "COMPONENTS zip"                                    # only relevant for find_package (i.e. OPENXLSX_CPM_LOCAL_PACKAGES_ONLY=ON)
            OPTIONS "QUIET OPTIONAL_COMPONENTS zipcmp zipmerge ziptool" # "
            OPTIONS "BUILD_TOOLS OFF"                                   # only relevant for CPMFindPackage (i.e. OPENXLSX_CPM_LOCAL_PACKAGES_ONLY=OFF)
            OPTIONS "BUILD_REGRESS OFF"                                 # "
            OPTIONS "BUILD_OSSFUZZ OFF"                                 # "
            OPTIONS "BUILD_EXAMPLES OFF"                                # "
            OPTIONS "BUILD_DOC OFF"                                     # "
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions