# rule about package variable naming

**URL:** <https://discourse.cmake.org/t/rule-about-package-variable-naming/4087>\
**Category:** Usage\
**Created:** [September 14, 2021, 1:07pm UTC](https://discourse.cmake.org/t/rule-about-package-variable-naming/4087 "2021-09-14T13:07:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adaldev](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Post date:** [September 14, 2021, 1:07pm UTC](https://discourse.cmake.org/t/rule-about-package-variable-naming/4087/1 "2021-09-14T13:07:11Z")

</div>

Hi, is there a rule with respect to case for naming variables  
\_INCLUDE\_DIRS and \_LIBRARIES  
I have a non consistent behavior with Eigen3 where:  
package name is Eigen3  
and variables set after find\_package are  
Eigen3\_VERSION\_MAJOR  
EIGEN3\_VERSION\_MAJOR  
EIGEN3\_INCLUDE\_DIRS  
EIGEN3\_LIBRARIES

Is the uppercase the rule, is it package dependant?  
thanks

---

<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:** [September 14, 2021, 1:47pm UTC](https://discourse.cmake.org/t/rule-about-package-variable-naming/4087/2 "2021-09-14T13:47:17Z")

</div>

That is…unfortunate. It is usually either the package name or all-uppercase. Having both is…weird.

---

<div class="post-metadata">

**Author:** ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)\
**Post date:** [September 14, 2021, 3:18pm UTC](https://discourse.cmake.org/t/rule-about-package-variable-naming/4087/3 "2021-09-14T15:18:52Z")

</div>

More precisely, the [documentation](https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#standard-variable-names) specifies that the prefix of the variables must be **exactly** the same as the package name.

---

<div class="post-metadata">

**Author:** ![adaldev](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Post date:** [September 20, 2021, 11:48am UTC](https://discourse.cmake.org/t/rule-about-package-variable-naming/4087/4 "2021-09-20T11:48:02Z")

</div>

Thanks to both of you.

I’ll stick to the documentation for my own packages.

Regards,  
A.
