diff options
author | Jonathan Bauer | 2011-06-21 16:02:15 +0200 |
---|---|---|
committer | Jonathan Bauer | 2011-06-21 16:02:15 +0200 |
commit | a16c2f6e25459951798d47df079ddaa7be41400a (patch) | |
tree | f7d2c114cd552b3b60014f109c69488b1c817f2e | |
parent | more cleanups (diff) | |
download | fbgui-a16c2f6e25459951798d47df079ddaa7be41400a.tar.gz fbgui-a16c2f6e25459951798d47df079ddaa7be41400a.tar.xz fbgui-a16c2f6e25459951798d47df079ddaa7be41400a.zip |
using cmake instead of qmake
-rw-r--r-- | .gitignore | 18 | ||||
-rw-r--r-- | CMakeLists.txt | 43 | ||||
-rwxr-xr-x[-rw-r--r--] | build.sh | 33 | ||||
-rwxr-xr-x | testApp.sh (renamed from src/testApp.sh) | 2 |
4 files changed, 80 insertions, 16 deletions
@@ -1,14 +1,6 @@ -fbgui -*.o -*~ core *.core -moc_*.* -ui_*.* -qrc_*.* -*.swp -*.swo -debug -.project -.cproject -.metadata +build Makefile -Makefile.* +.cproject +.project +*.swp +update_fbgui.sh diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..d9411fd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 2.8) + +project(fbgui) + +find_package(Qt4 REQUIRED) +if (QT4_FOUND) + message(STATUS "QT4 found.") +else(QT4_FOUND) + message(FATAL_ERROR "QT4 not found!") +endif(QT4_FOUND) + +#find_package(Qxt REQUIRED) + +set(QT_USE_QTNETWORK TRUE) +set(QT_USE_QTWEBKIT TRUE) + +file(GLOB_RECURSE FBGUI_SOURCES src/*.cpp) +file(GLOB_RECURSE FBGUI_MOC_HEADERS src/*.h) +file(GLOB_RECURSE FBGUI_UIS src/*.ui) +file(GLOB_RECURSE FBGUI_RCS src/*.qrc) + +include_directories(${CMAKE_CURRENT_BINARY_DIR} + /usr/local/Qxt/include/QxtCore + /usr/include/sysfs + /usr/include/libusb-1.0) +include(${QT_USE_FILE}) +add_definitions(${QT_DEFINITIONS}) + +link_directories(/usr/local/Qxt/lib /usr/lib) + +QT4_ADD_RESOURCES(FBGUI_RC_SOURCES ${FBGUI_RCS}) +QT4_WRAP_UI(FBGUI_UI_HEADERS ${FBGUI_UIS}) +QT4_WRAP_CPP(FBGUI_MOC_SOURCES ${FBGUI_MOC_HEADERS}) + +add_executable(fbgui + ${FBGUI_SOURCES} + ${FBGUI_MOC_SOURCES} + ${FBGUI_UI_HEADERS} + ${FBGUI_RC_SOURCES}) + +target_link_libraries(fbgui + ${QT_LIBRARIES} + QxtCore qjson sysfs usb-1.0) @@ -1,2 +1,31 @@ -#!/bin/bash -# TODO auto-compiler with cmake +#!/bin/sh +# fbsplash builder script for cmake +DIR=$(pwd) +BUILDDIR=build + +# if --clean, remove build dir +if [ "$1" = "--clean" ] +then + rm -rf $BUILDDIR + echo "$BUILDDIR removed." + exit 1 +fi + +if [ ! -f CMakeLists.txt ] +then + echo "No CMakeLists.txt found." + echo "Run this script from the folder containing CMakeLists.txt." + exit 1 +fi + +# make build dir if its not there +[ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR + +cd $BUILDDIR +# use cmake to create Makefile +echo "Invoking cmake ..." +cmake "$DIR" +echo "Invoking make ..." +make + +cd $DIR diff --git a/src/testApp.sh b/testApp.sh index 9b46385..e1f1d1e 100755 --- a/src/testApp.sh +++ b/testApp.sh @@ -30,7 +30,7 @@ display_id=$(grep -n $(whoami) /etc/passwd| head -n 1|awk -F : '{print $1}') # quick sleep to wait for qvfb loading sleep 0.2 # Start fbgui connecting to QVFb with display_id from above. -$working_path/fbgui -display QVFb:$display_id $@ +$working_path/build/fbgui -display QVFb:$display_id $@ # Check if fbbrowser is not running, if so kill the qvfb. if [ $(ps aux | grep -v grep | grep -c fbgui) -eq 1 ] then |