make it usable as a meson submodule
This commit is contained in:
parent
3d21921c4a
commit
885ec1a10b
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <SDL2/SDL_ttf.h>
|
||||
|
||||
#include "caption.hpp"
|
||||
#include <basic_widgets/caption.hpp>
|
||||
|
||||
class Button : public Widget
|
||||
{
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "SDL2/SDL_ttf.h"
|
||||
#include <SDL2/SDL_ttf.h>
|
||||
|
||||
#include "widget.hpp"
|
||||
#include <basic_widgets/widget.hpp>
|
||||
|
||||
class Caption : public Widget
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef HORIZONTAL_LAYOUT_HPP
|
||||
#define HORIZONTAL_LAYOUT_HPP
|
||||
|
||||
#include "layout.hpp"
|
||||
#include <basic_widgets/layout.hpp>
|
||||
|
||||
class Horizontal_Layout : public Layout
|
||||
{
|
|
@ -7,8 +7,7 @@
|
|||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#include "caption.hpp"
|
||||
#include "widget.hpp"
|
||||
#include <basic_widgets/caption.hpp>
|
||||
|
||||
template<typename T>
|
||||
concept CanToString = requires(T value) { std::to_string(value); };
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include "widget.hpp"
|
||||
#include <basic_widgets/widget.hpp>
|
||||
|
||||
class Layout : public Widget
|
||||
{
|
|
@ -5,8 +5,8 @@
|
|||
#include <regex>
|
||||
#include <type_traits>
|
||||
|
||||
#include "button.hpp"
|
||||
#include "input.hpp"
|
||||
#include <basic_widgets/button.hpp>
|
||||
#include <basic_widgets/input.hpp>
|
||||
|
||||
template<typename T>
|
||||
concept Numeric = std::is_arithmetic_v<T>;
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef VERTICAL_LAYOUT_HPP
|
||||
#define VERTICAL_LAYOUT_HPP
|
||||
|
||||
#include "layout.hpp"
|
||||
#include <basic_widgets/layout.hpp>
|
||||
|
||||
class Vertical_Layout : public Layout
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
#include "button.hpp"
|
||||
#include <basic_widgets/button.hpp>
|
||||
|
||||
Button::Button(SDL_Renderer* r)
|
||||
: Widget(r), _caption(r)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "caption.hpp"
|
||||
#include <basic_widgets/caption.hpp>
|
||||
|
||||
Caption::Caption(SDL_Renderer* r)
|
||||
: Widget(r)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "button.hpp"
|
||||
#include "horizontal_layout.hpp"
|
||||
#include "vertical_layout.hpp"
|
||||
#include <basic_widgets/button.hpp>
|
||||
#include <basic_widgets/horizontal_layout.hpp>
|
||||
#include <basic_widgets/vertical_layout.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "horizontal_layout.hpp"
|
||||
#include "numeric_input.hpp"
|
||||
#include "vertical_layout.hpp"
|
||||
#include <basic_widgets/horizontal_layout.hpp>
|
||||
#include <basic_widgets/numeric_input.hpp>
|
||||
#include <basic_widgets/vertical_layout.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "iostream"
|
||||
|
||||
#include "horizontal_layout.hpp"
|
||||
#include <basic_widgets/horizontal_layout.hpp>
|
||||
|
||||
Horizontal_Layout::Horizontal_Layout(SDL_Renderer* r)
|
||||
: Layout::Layout(r)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "layout.hpp"
|
||||
#include <basic_widgets/layout.hpp>
|
||||
|
||||
Layout::Layout(SDL_Renderer* r)
|
||||
: Widget(r)
|
||||
|
|
28
meson.build
28
meson.build
|
@ -1,26 +1,38 @@
|
|||
project('sdl2_basic_widgets', 'cpp',
|
||||
version : '0.1',
|
||||
version : '0.1pre',
|
||||
default_options : ['warning_level=3', 'cpp_std=c++20'])
|
||||
|
||||
lib = static_library('sdl2_basic_widgets',
|
||||
sdl = [
|
||||
dependency('sdl2'),
|
||||
dependency('SDL2_ttf')
|
||||
]
|
||||
|
||||
api = include_directories('api')
|
||||
|
||||
libbasic_widgets = static_library('basic_widgets',
|
||||
'horizontal_layout.cpp',
|
||||
'layout.cpp',
|
||||
'button.cpp',
|
||||
'caption.cpp',
|
||||
'vertical_layout.cpp',
|
||||
'widget.cpp',
|
||||
dependencies : [
|
||||
dependency('sdl2'),
|
||||
dependency('SDL2_ttf')
|
||||
],
|
||||
dependencies : sdl,
|
||||
include_directories : api,
|
||||
install : true)
|
||||
|
||||
libbasic_widgets_dep = declare_dependency(
|
||||
include_directories : api,
|
||||
link_with: libbasic_widgets,
|
||||
dependencies : sdl)
|
||||
|
||||
executable('button_demo',
|
||||
'examples/button_example.cpp',
|
||||
link_with : lib,
|
||||
link_with : libbasic_widgets,
|
||||
include_directories : api,
|
||||
install : false)
|
||||
|
||||
executable('input_demo',
|
||||
'examples/input_example.cpp',
|
||||
link_with : lib,
|
||||
link_with : libbasic_widgets,
|
||||
include_directories : api,
|
||||
install : false)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "vertical_layout.hpp"
|
||||
#include <basic_widgets/vertical_layout.hpp>
|
||||
|
||||
Vertical_Layout::Vertical_Layout(SDL_Renderer* r)
|
||||
: Layout(r)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "widget.hpp"
|
||||
#include <basic_widgets/widget.hpp>
|
||||
|
||||
Widget::Widget(SDL_Renderer* r)
|
||||
: _renderer(r)
|
||||
|
|
Loading…
Reference in a new issue