# project setup with usage of external project

**URL:** https://discourse.cmake.org/t/project-setup-with-usage-of-external-project/4766
**Category:** Usage
**Created:** [January 3, 2022, 1:55pm UTC](https://discourse.cmake.org/t/project-setup-with-usage-of-external-project/4766 "2022-01-03T13:55:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Django1](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@Django1](https://discourse.cmake.org/u/Django1)
#### Post date: [January 3, 2022, 1:55pm UTC](https://discourse.cmake.org/t/project-setup-with-usage-of-external-project/4766/1 "2022-01-03T13:55:54Z")

</div>

Hi,

my project consists of nearly 20 subprojects and all use the same Qt- and  
other packages and they use “that” external project.

The external project is selfcompiled from github, but I don’t want to import  
build instructions into my project. Just use it as is.  
That foreign project is not built by cmake, so I have to code references on my  
own.  
From the external project I use several include directories and several libs  
(static libs and shared libs as well), so I think, find\_library is not best  
way.

I wonder how could I write the dependencies minimizing code duplication.  
Should I consider using an include-file, that contains cmake statements like  
CMakeLists.txt or does it make sense to code a module?

If the latter is true, is there a tutorial/howto about writing a module?  
Did I get it right, that its not possible to access variable definitions of a  
parent directory? So I guess having subdirectories in different depth are in  
favor of module definition. Right?
