# Write CMake file for project that using GTKMM and An include library

**URL:** https://discourse.cmake.org/t/write-cmake-file-for-project-that-using-gtkmm-and-an-include-library/5216
**Category:** Code
**Created:** [March 14, 2022, 1:05pm UTC](https://discourse.cmake.org/t/write-cmake-file-for-project-that-using-gtkmm-and-an-include-library/5216 "2022-03-14T13:05:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Mamograg17](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mamograg17/32/2259_2.png) [@Mamograg17](https://discourse.cmake.org/u/Mamograg17)
#### Post date: [March 14, 2022, 1:05pm UTC](https://discourse.cmake.org/t/write-cmake-file-for-project-that-using-gtkmm-and-an-include-library/5216/1 "2022-03-14T13:05:30Z")

</div>

Hello,  
I am trying to write a CMake file for my project, this is the project tree :

```auto
Project
 I CMakeLists.txt
 I___src
 I-----I__main.cpp
 I-----I__window.cpp
 I-----I__windows.hpp
 I-----I__operations.cpp
 I-----I__CMakeLists.txt
 I
 I___incld
 I-----I__tinyexpr.c
 I-----I__tinyexpr.h

```

So now i am ge want to link the `tinyexpr.h` to the program, with g++ i know how to to it but with CMake it’s myFirst time,  
This is the CMakeLists.txt of project:

```auto
cmake_minimum_required(VERSION 3.20) 
project(MCalc) 
set(CMAKE_CXX_STANDARD 20)
 find_package(PkgConfig) pkg_check_modules(gtkmm gtkmm-4.0)
 add_subdirectory(src incld)

```

And this is the CMakeLists.txt of the src directory:  
link\_directories(${GTKMM\_LIBRARY\_DIRS} ${INCLD}) find\_package(PkgConfig REQUIRED) pkg\_check\_modules(gtkmm REQUIRED IMPORTED\_TARGET gtkmm-4.0 glibmm-2.68) set(SOURCES main.cpp operations.cpp window.cpp ${INCLD/tinyexpr.h}) add\_executable(MCalc ${SOURCES}) target\_link\_libraries(MCalc PkgConfig::gtkmm)

So if any one could help to make this CMakeFiles work with my program i would be really happy.
