Commit 8cc953aa authored by Melroy van den Berg's avatar Melroy van den Berg

first example

parents
Pipeline #1077 canceled with stages
set(PROJECT_NAME WineGUI)
project(${PROJECT_NAME})
cmake_minimum_required(VERSION 2.8.8)
set(CMAKE_CXX_FLAGS "-g -Wall")
if (CMAKE_VERSION VERSION_LESS "3.1")
add_definitions(-std=c++14)
else()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT CYGWIN)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
endif()
# Use the package PkgConfig to detect GTK+ headers/library files
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTK REQUIRED gtk+-3.0)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
################################
# Normal Libraries & Executables
################################
# Add GTK libs and local include
include_directories(
${GTK_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/include
)
link_directories(${GTK_LIBRARY_DIRS})
add_definitions (${GTK_CFLAGS_OTHER})
#add_library(test_lib src/test.cc)
add_executable(winegui src/main.cc)
target_link_libraries(winegui ${CMAKE_THREAD_LIBS_INIT} ${GTK_LIBRARIES}) # test_lib
# To create 'make run'
add_custom_target( run
COMMAND "bin/winegui"
COMMENT "Starting up..." )
This diff is collapsed.
# Wine GUI
Finally, an user-interface friendly WINE manager.
## Development
### Requirements
Dependencies should be met before build:
* cmake
* GTK3.0+
* pkg-config
### Build
Run: `./build.sh`
### Run
Execute:
`./build/bin/winegui`
Or go to `build` directory and execute:
```
ninja run
```
### Rebuild
Cmake is only needed once, after that you can often use:
`ninja`
Clean the build via: `ninja clean`
*Hint:* Run `ninja help` for all available targets.
#!/usr/bin/env bash
if [ ! -d "build" ]; then
echo "Creating build directory..."
mkdir build
fi
if [ -z "$(ls build)" ]; then
echo "INFO: Run cmake & ninja"
cd build
cmake -GNinja ..
else
echo "INFO: Only run ninja..."
cd build
fi
ninja
\ No newline at end of file
/**
* Copyright (c) 2019 WineGUI
*
* \file main.cc
* \brief Main, where it all starts
* \author Melroy van den Berg <webmaster1989@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gtk/gtk.h>
static void activate (GtkApplication* app, gpointer user_data) {
GtkWidget *window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Window");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
gtk_widget_show_all (window);
}
int main (int argc, char **argv) {
GtkApplication *app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
int status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
return status;
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment