Made a basic project for the calculator, just a gtk window so far, but build system set up, as well as directory structure. Added all the cmake crap to gitingore as well
This commit is contained in:
parent
58334d6cfd
commit
22805d3e7e
10
.gitignore
vendored
10
.gitignore
vendored
|
@ -52,3 +52,13 @@ Module.symvers
|
||||||
Mkfile.old
|
Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
**/bin/
|
||||||
|
**/build/
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles
|
||||||
|
.cache
|
||||||
|
cmake_install.cmake
|
||||||
|
compile_commands.json
|
||||||
|
Makefile
|
||||||
|
|
||||||
|
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "lib/wieve-libs"]
|
||||||
|
path = lib/wieve-libs
|
||||||
|
url = git@mudf.lat:ObeseTermite/wieve-libs.git
|
17
calculator/CMakeLists.txt
Normal file
17
calculator/CMakeLists.txt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
|
project(calculator)
|
||||||
|
|
||||||
|
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
|
||||||
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
|
||||||
|
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
||||||
|
|
||||||
|
include_directories(${GTK3_INCLUDE_DIRS})
|
||||||
|
link_directories(${GTK3_LIBRARY_DIRS})
|
||||||
|
add_definitions(${GTK3_CFLAGS_OTHER})
|
||||||
|
|
||||||
|
add_executable(wieve-calc ${PROJECT_SOURCE_DIR}/calc.c)
|
||||||
|
target_link_libraries(wieve-calc ${GTK3_LIBRARIES})
|
25
calculator/calc.c
Normal file
25
calculator/calc.c
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
static void activate (GtkApplication* app, gpointer user_data)
|
||||||
|
{
|
||||||
|
GtkWidget *window;
|
||||||
|
|
||||||
|
window = gtk_application_window_new (app);
|
||||||
|
gtk_window_set_title (GTK_WINDOW (window), "Calculator");
|
||||||
|
gtk_window_set_default_size (GTK_WINDOW (window), 500, 800);
|
||||||
|
gtk_widget_show_all (window);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main (int argc, char **argv)
|
||||||
|
{
|
||||||
|
GtkApplication *app;
|
||||||
|
int status;
|
||||||
|
|
||||||
|
app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
|
||||||
|
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||||
|
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||||
|
g_object_unref (app);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
1
lib/wieve-libs
Submodule
1
lib/wieve-libs
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 98b87b419528e48edcfa0291cc8eeb0c2a65d10e
|
Loading…
Reference in a new issue