adding in build setup and linking external library
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
build/
|
||||
|
||||
*.so
|
||||
@@ -0,0 +1,19 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(gtk_hello_world)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(GTKMM gtkmm-4.0)
|
||||
|
||||
set (source_dir "${PROJECT_SOURCE_DIR}/src")
|
||||
file(GLOB source_files "${source_dir}/*.cpp")
|
||||
|
||||
link_directories(${GTKMM_LIBRARY_DIRS})
|
||||
include_directories(${GTKMM_INCLUDE_DIRS})
|
||||
|
||||
add_executable(${PROJECT_NAME} ${source_files})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ${GTKMM_LIBRARIES})
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Building project | making build folder, and going into it..."
|
||||
rm -rf build
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
echo "Running cmake with build type Debug."
|
||||
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
|
||||
|
||||
echo "====================="
|
||||
echo "Running make..."
|
||||
echo "====================="
|
||||
|
||||
make
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <gtkmm.h>
|
||||
|
||||
class MyWindow : public Gtk::Window {
|
||||
public:
|
||||
MyWindow();
|
||||
};
|
||||
|
||||
MyWindow::MyWindow() {
|
||||
set_title("Basic application");
|
||||
set_default_size(800, 450);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
auto app = Gtk::Application::create("org.gtkmm.examples.base");
|
||||
return app->make_window_and_run<MyWindow>(argc, argv);
|
||||
}
|
||||
Reference in New Issue
Block a user