This may be related to my previous question.
I copied the code from the "Simple Example" here.
I copied the cmake instructions from here.
The error I am getting is:
-- Checking for module 'gtkmm-3.0'
-- No package 'gtkmm-3.0' found
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.10)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /path-to-files/
This is my CMakeLists.txt
project(SimpleExample)
find_package(PkgConfig REQUIRED)
set(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/pkgconfig;/usr/share/pkgconfig")
pkg_check_modules(GTKMM gtkmm-3.0)
link_directories(${GTKMM_LIBRARY_DIRS})
include_directories(${GTKMM_INCLUDE_DIRS})
add_executable(SimpleExample SimpleExample.cpp)
target_link_libraries(SimpleExample ${GTKMM_LIBRARIES})
There's a really dumb line in here set(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/pkgconfig;/usr/share/pkgconfig")
which I'm fairly sure isn't supposed to be there, however in my previous question I was struggeling to figure out why pkg-config
wasn't finding the correct locations for the gtkmm-3.0.pc
file.
So I did a search to try and figure out how to set the paths for pkg-config
manually in a CMake file. That is what I came up with. However it does not work.