Hello,
I am trying to write a CMake file for my project, this is the project tree :
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:
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.