I'm a beginner in CMake and the ways that can use it. My IDE is Clion and I tried to install gtk3 for c++ and follow all of the instructions but the simple sample code that they suggest for the test is not work for me. you can find the instructions here. this is the code:
#include <gtkmm.h>
int main(int argc, char** argv)
{
auto app = Gtk::Application::create(argc, argv);
Gtk::Window window;
window.set_default_size(600,400);
return app->run(window);
}
the error is fatal error: gtkmm.h: No such file or directory
but when I change the #include <gtkmm.h>
to #include <gtkmm-3.0/gtkmm.h>
I did not get the error anymore here but I got an error in other subheaders like fatal error: glibmm.h: No such file or directory
. it just needs to somehow tell the compiler to look in the subdirectory but I don't know how to do it. I think it can be fixed in the CmakeLists.txt file but I don't know how to do it. this is my CmakeLists.txt file:
cmake_minimum_required(VERSION 3.16)
project(gtk)
set(CMAKE_CXX_STANDARD 14)
add_executable(gtk main.cpp)
please if anybody knows it helps me.