# A problem with documentation of find\_package

**URL:** https://discourse.cmake.org/t/a-problem-with-documentation-of-find-package/2550
**Category:** Usage
**Created:** [January 15, 2021, 1:36am UTC](https://discourse.cmake.org/t/a-problem-with-documentation-of-find-package/2550 "2021-01-15T01:36:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pauljurczak](https://discourse.cmake.org/user_avatar/discourse.cmake.org/pauljurczak/32/1418_2.png) [@pauljurczak](https://discourse.cmake.org/u/pauljurczak)
#### Post date: [January 15, 2021, 1:36am UTC](https://discourse.cmake.org/t/a-problem-with-documentation-of-find-package/2550/1 "2021-01-15T01:36:46Z")

</div>

I couldn’t find a documentation page specifying how to arrive from a module name, e.g. `FindCUDAToolkit` to the proper syntax of calling `find_package`, i.e. `find_package(CUDAToolkit)` in this case. I’m I missing something? If not, can it be added to documentation?

Initially, I asked that question on stackoverflow [https://stackoverflow.com/questions/65713975](https://stackoverflow.com/questions/65713975)

---

<div class="post-metadata">

### Author: ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)
#### Post date: [January 15, 2021, 7:04am UTC](https://discourse.cmake.org/t/a-problem-with-documentation-of-find-package/2550/2 "2021-01-15T07:04:47Z")

</div>

Quoting [https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html](https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html)

> A “find module” is a `Find<PackageName>.cmake` file to be loaded by the find\_package() command when invoked for `<PackageName>`.

and

> A FindFoo.cmake module will typically be loaded by the command:
> 
> ```cmake
> find_package(Foo [major[.minor[.patch[.tweak]]]]
> [EXACT] [QUIET] [REQUIRED]
> [[COMPONENTS] [components...]]
> [OPTIONAL_COMPONENTS components...]
> [NO_POLICY_SCOPE]) 
> 
> ```

Does that cover it?

---

<div class="post-metadata">

### Author: ![pauljurczak](https://discourse.cmake.org/user_avatar/discourse.cmake.org/pauljurczak/32/1418_2.png) [@pauljurczak](https://discourse.cmake.org/u/pauljurczak)
#### Post date: [January 15, 2021, 4:28pm UTC](https://discourse.cmake.org/t/a-problem-with-documentation-of-find-package/2550/3 "2021-01-15T16:28:51Z")

</div>

Yes, it does, but you have to know where to look for it. For a newbie like me, it would help to have this repeated or linked to on `find_package()` page: [https://cmake.org/cmake/help/latest/command/find\_package.html](https://cmake.org/cmake/help/latest/command/find_package.html)

On second reading, technically this information is on `find_package()` page, but it’s not straightforward to uncover for a beginner. I think the main problem for me was that page [https://cmake.org/cmake/help/latest/module/FindCUDAToolkit.html](https://cmake.org/cmake/help/latest/module/FindCUDAToolkit.html) calls `FindCUDAToolkit` a script and has no reference to `CUDAToolkit` package.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [January 19, 2021, 7:29pm UTC](https://discourse.cmake.org/t/a-problem-with-documentation-of-find-package/2550/4 "2021-01-19T19:29:36Z")

</div>

I think enhancing the `find_package` docs would be the way to go here. Wanting to use module `FindX` via `find_package`, one could expect that the `find_package` docs would be of interest. Adding "use via `find_package(X)`" feels like adding "use via `include(X)`" to other module documentation.

Cc: @kyle.edwards @betsy.mcphail
