Skip to content

Commit

Permalink
Update plotline.sh to get script directory. Skip test dir for release…
Browse files Browse the repository at this point in the history
… build. Add lib directory correctly.
  • Loading branch information
Jordan committed Mar 4, 2016
1 parent 31c28fd commit 726ab94
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
3 changes: 2 additions & 1 deletion Plotline.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ TEMPLATE = subdirs
CONFIG += ordered

SUBDIRS = src \
test \
doc

CONFIG(debug, debug|release): SUBDIRS += test

OTHER_FILES = \
README.markdown

Expand Down
4 changes: 2 additions & 2 deletions packages/me.rngr.plotline/meta/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Description>
Application to create, manage, and publish a novel.
</Description>
<Version>0.0.1</Version>
<ReleaseDate>2016-02-23</ReleaseDate>
<Version>1.0</Version>
<ReleaseDate>2016-03-04</ReleaseDate>
<Name>me.rngr.plotline</Name>
<Licenses>
<License name="GPL v3" file="license.txt" />
Expand Down
5 changes: 4 additions & 1 deletion plotline.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:src/lib ./src/app/plotline
# Thanks to https://stackoverflow.com/a/246128
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:src/lib $DIR/src/app/plotline
9 changes: 8 additions & 1 deletion test/test.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@
TEMPLATE = subdirs

SUBDIRS += \
unit
./unit

LIBS += -L$$OUT_PWD../../src/lib/libplotline.a

INCLUDEPATH += \
$$PWD/../../src/lib

CONFIG += c++11
21 changes: 6 additions & 15 deletions test/unit/unit.pro
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,17 @@ DISTFILES += \
fixtures/revision-deserialize.json \
fixtures/revision-bug-test.json

REQUIRES += \
$$PWD/../../src/lib \
$$PWD/../../src/app

INCLUDEPATH += \
$$OUT_PWD/../../src/lib \
$$OUT_PWD/../../src/app

##
# Depending on whether we're building the libraries statically or dynamically,
# Either the .so will be found or the .a will be found.
# There is probably a more elegant solution.
##

exists($$OUT_PWD/../../src/lib/libplotline.a){
LIBS += $$OUT_PWD/../../src/lib/libplotline.a
}
CONFIG += console testcase c++11

exists($$OUT_PWD/../../src/lib/libplotline.so){
LIBS += $$OUT_PWD/../../src/lib/libplotline.so
}
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../src/lib/release/ -lplotline
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../src/lib/debug/ -lplotline
else:unix: LIBS += -L$$OUT_PWD/../../src/lib/ -lplotline

CONFIG += console testcase c++11
INCLUDEPATH += $$PWD/../../src/lib
DEPENDPATH += $$PWD/../../src/lib

0 comments on commit 726ab94

Please # to comment.