Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use find_package with a user provided Find* module? #649

Open
higaski opened this issue Mar 3, 2025 · 0 comments · May be fixed by #654
Open

How to use find_package with a user provided Find* module? #649

higaski opened this issue Mar 3, 2025 · 0 comments · May be fixed by #654

Comments

@higaski
Copy link
Contributor

higaski commented Mar 3, 2025

I'm trying to download a project which does not contain a CMake configuration from GitHub using

cpmaddpackage(
  NAME
  CWPack
  GITHUB_REPOSITORY
  "clwi/CWPack"
  GIT_TAG
  1.4
  SYSTEM
  YES
  DOWNLOAD_ONLY
  YES)

and then provide my own Find* module by adding a FindCWPack.cmake file inside a cmake subdirectory.

However, trying to call find_package to find this file does not work.

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)

find_package(CWPack)

At least not without also setting CPM_DONT_UPDATE_MODULE_PATH.

Is this intended behavior? I think it is a bit confusing, specially if DOWNLOAD_ONLY is specified as well?

higaski added a commit to higaski/cpm_issue_649 that referenced this issue Mar 3, 2025
@Avus-c Avus-c linked a pull request Mar 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant