Skip to content

How to determine CPM download path? #621

@artiomn

Description

@artiomn

I have code like this:

if (CPM_SOURCE_CACHE)
    file(GLOB THIRD_PARTY_INCLUDES LIST_DIRECTORIES true "${CPM_SOURCE_CACHE}/**/include")
    include_directories("${CPM_SOURCE_CACHE}" ${THIRD_PARTY_INCLUDES})
endif()

Yes, this is a sort of a hack, but some third-party libraries can't be built without it.
But if my project used as third-party (via add_subdirectory()), I don't set CPM_SOURCE_CACHE and build fails.

How to get always correct real path where CPM saves third-party?

[
Probably: CPM_PACKAGE_${PACKAGE}_SOURCE_DIR?
]

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