diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..0d4309bf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ + +# This makes us use Ubuntu 14 instead of 12 +dist: trusty + +language: cpp +script: + - sudo apt-get update + - sudo apt-get install libgtk-3-dev -y || sudo apt-cache search libgtk3 + - make -f GNUmakefile + - make -f GNUmakefile examples + - make -f GNUmakefile test diff --git a/GNUmakefile b/GNUmakefile index a0c871f3..319ff4d4 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -57,4 +57,12 @@ test: libui example: libui @$(MAKE) -f build/GNUmakefile.example inlibuibuild=1 -# TODO examples rule? +# TODO examples rule? --> That's it right ? +examples: + @$(MAKE) -f GNUmakefile example EXAMPLE=histogram + #@$(MAKE) -f GNUmakefile example EXAMPLE=controlgallery + +.PHONY: examples + +install: + @$(MAKE) -f build/GNUmakefile.libui install inlibuibuild=1 diff --git a/build/GNUmakefile.libui b/build/GNUmakefile.libui index 936fc2b6..a4666720 100644 --- a/build/GNUmakefile.libui +++ b/build/GNUmakefile.libui @@ -39,3 +39,6 @@ else endif include build/GNUbase$(TOOLCHAIN).mk + +# install rule is OS specific +include $(OS)/GNUinstall.mk diff --git a/darwin/GNUinstall.mk b/darwin/GNUinstall.mk new file mode 100644 index 00000000..41df8837 --- /dev/null +++ b/darwin/GNUinstall.mk @@ -0,0 +1,9 @@ +ifndef PREFIX + PREFIX=/usr +endif + +# Incorrect for Mac Os X, this should be easy to fix +install: $(OUT) + cp $(OUT) $(DESTDIR)$(PREFIX)/lib/libui.0.dylib + ln -s libui.0.dylib $(DESTDIR)$(PREFIX)/lib/libui.dylib + cp ui.h ui_$(OS).h $(DESTDIR)$(PREFIX)/include/ diff --git a/unix/GNUinstall.mk b/unix/GNUinstall.mk new file mode 100644 index 00000000..634dbc06 --- /dev/null +++ b/unix/GNUinstall.mk @@ -0,0 +1,8 @@ +ifndef PREFIX + PREFIX=/usr +endif + +install: $(OUT) + cp $(OUT) $(DESTDIR)$(PREFIX)/lib/libui.so.0 + ln -fs libui.so.0 $(DESTDIR)$(PREFIX)/lib/libui.so + cp ui.h ui_$(OS).h $(DESTDIR)$(PREFIX)/include/ diff --git a/unix/group.c b/unix/group.c index 8f40c4f8..d0bdd451 100644 --- a/unix/group.c +++ b/unix/group.c @@ -53,8 +53,9 @@ void uiGroupSetChild(uiGroup *g, uiControl *child) if (g->child != NULL) childRemove(g->child); g->child = newChildWithBox(child, uiControl(g), g->container, g->margined); - if (g->child != NULL) + if (g->child != NULL) { uiControlQueueResize(uiControl(g)); + } } int uiGroupMargined(uiGroup *g) diff --git a/windows/GNUinstall.mk b/windows/GNUinstall.mk new file mode 100644 index 00000000..1d783c01 --- /dev/null +++ b/windows/GNUinstall.mk @@ -0,0 +1,3 @@ +install: + @echo "No install for windows !" + @exit 1