Category : cmake

I`m fairly new to C++ and I trying to set up a MQTT client on a Raspberry pi. Therover I am using the https://github.com/eclipse/paho.mqtt.cpp repo. I have cloned the repo and ran the following command: ./install_paho_mqtt_c.sh If I read correct this should build the code of the library. Now I want to use the libraby ..

Read more

I am working inside a container. I want to try gtest so first I installed it by doing this inside the container: Download the source file from github/google/googletest build the project by cmake CMakeLists.txt call make cd lib and cp * /usr/lib cd googlemock/include and cp -r gmock /usr/local/include cd googletest/include and cp -r gtest ..

Read more

I’m creating a project with cmake and c where I need to include headers from different folders, #include <dbus/dbus.h> #include <audacious/audctrl.h> #include <audacious/dbus.h> #include <pidgin/pidgin.h> And I added these lines to the cmake cofig file: target_include_directories(untitled PRIVATE /usr/include/dbus-1.0/;/usr/lib/x86_64-linux-gnu/dbus-1.0/include/;/usr/include/glib-2.0/; /usr/lib/x86_64-linux-gnu/glib-2.0/include/;/usr/include/gtk-3.0/;/usr/include/pango-1.0/;/usr/include/cairo/; /usr/include/gdk-pixbuf-2.0/;/usr/include/atk-1.0/ ) Here is some part of the code: GError *gError = NULL; DBusGConnection *dBusGConnection = ..

Read more

I am building a game engine following a tutorial using Visual Studio, but I am using ubuntu as an OS, also I want to make it cross-platform that’s why I am using CMake to build it. The Library Architecture is as follows wheel + build + cmake + CMakeLists.txt | + include | + wheel ..

Read more

I’m using Visual Studio Code and Windows. How should i link my CMake C++ project with SFML library? I tried this: add_executable(testsfml main.cpp) target_link_libraries(testsfml sfml-graphics sfml-window sfml-system) But it doesn’t really work. I get this ERROR: [build] LINK : fatal error LNK1104: cannot open file ‘sfml-graphics.lib’ [E:DevelopingLearningTemp project for lessonssfml cmakebuildtestsfml.vcxproj] [build] Build finished with ..

Read more

I wanto add glfw dependency by cmake in CLion but i get weird error, this is the CMakeLists.txt cmake_minimum_required(VERSION 3.17) project(hello_gl) set(CMAKE_CXX_STANDARD 14) find_package(glfw3 3.3 REQUIRED) target_link_libraries(hello_gl glfw) add_executable(hello_gl main.cpp) CMake Error at CMakeLists.txt:8 (target_link_libraries): Cannot specify link libraries for target "hello_gl" which is not built by this project. This is the error I get? ..

Read more

I faced many link error when I develop qt application with pure cmake on windows. My requirement is to build core source files into a shared library and link it when needed by other one. I made a minimal program for locating problems. CMakeLists.txt cmake_minimum_required(VERSION 3.5) project( Test LANGUAGES CXX) set( TEST_SDK testsdk) set(CMAKE_INCLUDE_CURRENT_DIR ON) ..

Read more