# Where can a project install its CMake modules

**URL:** https://discourse.cmake.org/t/where-can-a-project-install-its-cmake-modules/15304
**Category:** Code
**Created:** [November 13, 2025, 1:43pm UTC](https://discourse.cmake.org/t/where-can-a-project-install-its-cmake-modules/15304 "2025-11-13T13:43:55Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![anon74639460](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/da6949/32.png) [@anon74639460](https://discourse.cmake.org/u/anon74639460)
#### Post date: [November 22, 2025, 7:07pm UTC](https://discourse.cmake.org/t/where-can-a-project-install-its-cmake-modules/15304/10 "2025-11-22T19:07:51Z")

</div>

Take a very close look at [LsCs](https://github.com/RolandHughes/ls-cs). It is a fork of CopperSpice which is a fork of Qt 4.8-ish. It dynamically configures what it builds based on what the system has. Lots of plugins. You probably also want to take a close look at the cmake directory. Probably this file in particular.

> <https://github.com/RolandHughes/ls-cs/blob/master/cmake/LsCsDeploy.cmake>

All of your “repetitive code” can go into “functions”, or at least most of it can. That which cannot can just be in a .cmake stub file that the other cmake files includes.

> [@Including a .cmake file](https://discourse.cmake.org/t/including-a-cmake-file/7034/6):
>
> Dear Craig: THanks for your quick reaction. I was specifically confused about chapter 34.2 (13th edition), where the example includes the line: list(APPEND CMAKE\_MODULE\_PATH ${CMAKE\_CURRENT\_LIST\_DIR}/cmake) and then loads a module with include(dependencies.cmake). Since that is the only module loaded in the example, I concluded that it would reside in the cmake subdirectory (since otherwise above line would be superfluous). Anyhow, your response clarifies- thanks!

Every tragedy in IT will be repeated at least 3 different times on at least 3 different platforms if you live long enough.

During the days interpreted BASIC on PDP-11 and MAI BASIC/4 machines we were notorious for %INCLUDE of entire programs or just a range of line numbers from them. (God forbid somebody renumber the source!) Even more notorious, because it was billed as a safety feature, was writing programs that immediately exited. To get them to actually do anything you had to CHAIN to a specific line number.

Enter interpreted languages on PCs. Once again, it is the Wild Wild West! 🤩 If only the scripted languages had line numbers so we could play our cruelest games!

If you refactor your entire project around the concept of

“Write it once”

cutting anything replicated out into a common includable .cmake file, things should get cleaner for you.

---

_[View the full topic](https://discourse.cmake.org/t/where-can-a-project-install-its-cmake-modules/15304)._
