improve linking and installation

This commit is contained in:
Syping 2019-10-16 22:07:14 +02:00
parent 262533dae9
commit 40d974f804
9 changed files with 93 additions and 14 deletions

View file

@ -15,16 +15,23 @@
#* limitations under the License. #* limitations under the License.
#*****************************************************************************/ #*****************************************************************************/
QT += core gui widgets QT += widgets
TARGET = luaengine TARGET = luaengine
win32: TARGET = LuaEngine win32: TARGET = LuaEngine
CONFIG += c++11 CONFIG += c++11
static: DEFINES += LUAENGINE_STATIC static: DEFINES += LUAENGINE_STATIC
# PROJECT PREFIX
unix {
isEmpty(LUAENGINE_PREFIX): LUAENGINE_PREFIX = /usr/local
isEmpty(LUAENGINE_BINDIR): LUAENGINE_BINDIR = $$LUAENGINE_PREFIX/bin
isEmpty(LUAENGINE_LIBDIR): LUAENGINE_LIBDIR = $$LUAENGINE_PREFIX/lib
}
unix: LIBS += "-Wl,-rpath,\'$$LUAENGINE_LIBDIR\'" -L$$OUT_PWD/../luaengineos -lLuaEngineOS -L$$OUT_PWD/../luaengineio -lLuaEngineIO -L$$OUT_PWD/../luaenginegui -lLuaEngineGui -L$$OUT_PWD/../luaenginecore -lLuaEngine
CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaengineos/debug -lLuaEngineOS -L$$OUT_PWD/../luaengineio/debug -lLuaEngineIO -L$$OUT_PWD/../luaenginegui/debug -lLuaEngineGui -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaengineos/debug -lLuaEngineOS -L$$OUT_PWD/../luaengineio/debug -lLuaEngineIO -L$$OUT_PWD/../luaenginegui/debug -lLuaEngineGui -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine
CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaengineos/release -lLuaEngineOS -L$$OUT_PWD/../luaengineio/release -lLuaEngineIO -L$$OUT_PWD/../luaenginegui/release -lLuaEngineGui -L$$OUT_PWD/../luaenginecore/release -lLuaEngine CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaengineos/release -lLuaEngineOS -L$$OUT_PWD/../luaengineio/release -lLuaEngineIO -L$$OUT_PWD/../luaenginegui/release -lLuaEngineGui -L$$OUT_PWD/../luaenginecore/release -lLuaEngine
unix: LIBS += -L$$OUT_PWD/../luaengineos -lLuaEngineOS -L$$OUT_PWD/../luaengineio -lLuaEngineIO -L$$OUT_PWD/../luaenginegui -lLuaEngineGui -L$$OUT_PWD/../luaenginecore -lLuaEngine
INCLUDEPATH += \ INCLUDEPATH += \
../luaenginecore/lua \ ../luaenginecore/lua \
@ -35,3 +42,8 @@ INCLUDEPATH += \
SOURCES += \ SOURCES += \
main.cpp main.cpp
unix {
target.path = $$LUAENGINE_BINDIR
INSTALLS += target
}

View file

@ -15,16 +15,23 @@
#* limitations under the License. #* limitations under the License.
#*****************************************************************************/ #*****************************************************************************/
QT += core gui widgets QT += widgets
TARGET = luaengineapp TARGET = luaengineapp
win32: TARGET = LuaEngineApp win32: TARGET = LuaEngineApp
CONFIG += c++11 CONFIG += c++11
static: DEFINES += LUAENGINE_STATIC static: DEFINES += LUAENGINE_STATIC
# PROJECT PREFIX
unix {
isEmpty(LUAENGINE_PREFIX): LUAENGINE_PREFIX = /usr/local
isEmpty(LUAENGINE_BINDIR): LUAENGINE_BINDIR = $$LUAENGINE_PREFIX/bin
isEmpty(LUAENGINE_LIBDIR): LUAENGINE_LIBDIR = $$LUAENGINE_PREFIX/lib
}
unix: LIBS += "-Wl,-rpath,\'$$LUAENGINE_LIBDIR\'" -L$$OUT_PWD/../luaengineos -lLuaEngineOS -L$$OUT_PWD/../luaengineio -lLuaEngineIO -L$$OUT_PWD/../luaenginegui -lLuaEngineGui -L$$OUT_PWD/../luaenginecore -lLuaEngine
CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaengineos/debug -lLuaEngineOS -L$$OUT_PWD/../luaengineio/debug -lLuaEngineIO -L$$OUT_PWD/../luaenginegui/debug -lLuaEngineGui -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaengineos/debug -lLuaEngineOS -L$$OUT_PWD/../luaengineio/debug -lLuaEngineIO -L$$OUT_PWD/../luaenginegui/debug -lLuaEngineGui -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine
CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaengineos/release -lLuaEngineOS -L$$OUT_PWD/../luaengineio/release -lLuaEngineIO -L$$OUT_PWD/../luaenginegui/release -lLuaEngineGui -L$$OUT_PWD/../luaenginecore/release -lLuaEngine CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaengineos/release -lLuaEngineOS -L$$OUT_PWD/../luaengineio/release -lLuaEngineIO -L$$OUT_PWD/../luaenginegui/release -lLuaEngineGui -L$$OUT_PWD/../luaenginecore/release -lLuaEngine
unix: LIBS += -L$$OUT_PWD/../luaengineos -lLuaEngineOS -L$$OUT_PWD/../luaengineio -lLuaEngineIO -L$$OUT_PWD/../luaenginegui -lLuaEngineGui -L$$OUT_PWD/../luaenginecore -lLuaEngine
INCLUDEPATH += \ INCLUDEPATH += \
../luaenginecore/lua \ ../luaenginecore/lua \
@ -40,6 +47,11 @@ OTHER_FILES += \
app.lua \ app.lua \
app.rc app.rc
unix {
target.path = $$LUAENGINE_BINDIR
INSTALLS += target
}
win32: CONFIG(LUAENGINE_RESOURCE_SCRIPT) { win32: CONFIG(LUAENGINE_RESOURCE_SCRIPT) {
DEFINES += LUAENGINE_RESOURCE_SCRIPT DEFINES += LUAENGINE_RESOURCE_SCRIPT
HEADERS += resource.h HEADERS += resource.h

View file

@ -15,16 +15,22 @@
#* limitations under the License. #* limitations under the License.
#*****************************************************************************/ #*****************************************************************************/
QT += core QT -= gui
QT -= gui widgets
TARGET = luaenginec TARGET = luaenginec
CONFIG += c++11 CONFIG += c++11
static: DEFINES += LUAENGINE_STATIC static: DEFINES += LUAENGINE_STATIC
# PROJECT PREFIX
unix {
isEmpty(LUAENGINE_PREFIX): LUAENGINE_PREFIX = /usr/local
isEmpty(LUAENGINE_BINDIR): LUAENGINE_BINDIR = $$LUAENGINE_PREFIX/bin
isEmpty(LUAENGINE_LIBDIR): LUAENGINE_LIBDIR = $$LUAENGINE_PREFIX/lib
}
unix: LIBS += "-Wl,-rpath,\'$$LUAENGINE_LIBDIR\'" -L$$OUT_PWD/../luaenginecore -lLuaEngine
CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine
CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine
unix: LIBS += -L$$OUT_PWD/../luaenginecore -lLuaEngine
INCLUDEPATH += \ INCLUDEPATH += \
../luaenginecore/lua \ ../luaenginecore/lua \
@ -33,6 +39,11 @@ INCLUDEPATH += \
SOURCES += \ SOURCES += \
main.cpp main.cpp
unix {
target.path = $$LUAENGINE_BINDIR
INSTALLS += target
}
win32 { win32 {
RC_LANG = 0x0 RC_LANG = 0x0
QMAKE_TARGET_COMPANY = "Syping" QMAKE_TARGET_COMPANY = "Syping"

View file

@ -26,7 +26,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QCoreApplication a(argc, argv); QCoreApplication a(argc, argv);
a.setApplicationName("luaenginec"); a.setApplicationName("LuaEngine Compiler");
a.setApplicationVersion("0.1"); a.setApplicationVersion("0.1");
QCommandLineParser parser; QCommandLineParser parser;

View file

@ -29,6 +29,12 @@ static: DEFINES += LUAENGINE_STATIC
linux: DEFINES += LUA_USE_LINUX linux: DEFINES += LUA_USE_LINUX
gcc: QMAKE_CFLAGS += -Wno-cast-function-type gcc: QMAKE_CFLAGS += -Wno-cast-function-type
# PROJECT PREFIX
unix {
isEmpty(LUAENGINE_PREFIX): LUAENGINE_PREFIX = /usr/local
isEmpty(LUAENGINE_LIBDIR): LUAENGINE_LIBDIR = $$LUAENGINE_PREFIX/lib
}
SOURCES += \ SOURCES += \
luaengine/LuaEngine.cpp luaengine/LuaEngine.cpp
@ -99,6 +105,11 @@ HEADERS += \
lua/lvm.h \ lua/lvm.h \
lua/lzio.h lua/lzio.h
unix {
target.path = $$LUAENGINE_LIBDIR
INSTALLS += target
}
win32 { win32 {
RC_LANG = 0x0 RC_LANG = 0x0
QMAKE_TARGET_COMPANY = "Syping" QMAKE_TARGET_COMPANY = "Syping"

View file

@ -25,9 +25,15 @@ VERSION = 0.1
DEFINES += LUAENGINEGUI_LIBRARY DEFINES += LUAENGINEGUI_LIBRARY
static: DEFINES += LUAENGINE_STATIC static: DEFINES += LUAENGINE_STATIC
# PROJECT PREFIX
unix {
isEmpty(LUAENGINE_PREFIX): LUAENGINE_PREFIX = /usr/local
isEmpty(LUAENGINE_LIBDIR): LUAENGINE_LIBDIR = $$LUAENGINE_PREFIX/lib
}
unix: LIBS += "-Wl,-rpath,\'$$LUAENGINE_LIBDIR\'" -L$$OUT_PWD/../luaenginecore -lLuaEngine
CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine
CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine
unix: LIBS += -L$$OUT_PWD/../luaenginecore -lLuaEngine
INCLUDEPATH += \ INCLUDEPATH += \
../luaenginecore/lua \ ../luaenginecore/lua \
@ -40,6 +46,11 @@ HEADERS += \
luaengine/LuaEngineGui.h \ luaengine/LuaEngineGui.h \
luaengine/LuaEngineGui_global.h luaengine/LuaEngineGui_global.h
unix {
target.path = $$LUAENGINE_LIBDIR
INSTALLS += target
}
win32 { win32 {
RC_LANG = 0x0 RC_LANG = 0x0
QMAKE_TARGET_COMPANY = "Syping" QMAKE_TARGET_COMPANY = "Syping"

View file

@ -15,7 +15,7 @@
#* limitations under the License. #* limitations under the License.
#*****************************************************************************/ #*****************************************************************************/
QT += core QT -= gui
TARGET = LuaEngineIO TARGET = LuaEngineIO
TEMPLATE = lib TEMPLATE = lib
CONFIG += c++11 \ CONFIG += c++11 \
@ -25,9 +25,15 @@ VERSION = 0.1
DEFINES += LUAENGINEIO_LIBRARY DEFINES += LUAENGINEIO_LIBRARY
static: DEFINES += LUAENGINE_STATIC static: DEFINES += LUAENGINE_STATIC
# PROJECT PREFIX
unix {
isEmpty(LUAENGINE_PREFIX): LUAENGINE_PREFIX = /usr/local
isEmpty(LUAENGINE_LIBDIR): LUAENGINE_LIBDIR = $$LUAENGINE_PREFIX/lib
}
unix: LIBS += "-Wl,-rpath,\'$$LUAENGINE_LIBDIR\'" -L$$OUT_PWD/../luaenginecore -lLuaEngine
CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine
CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine
unix: LIBS += -L$$OUT_PWD/../luaenginecore -lLuaEngine
INCLUDEPATH += \ INCLUDEPATH += \
../luaenginecore/lua \ ../luaenginecore/lua \
@ -40,6 +46,11 @@ HEADERS += \
luaengine/LuaEngineIO.h \ luaengine/LuaEngineIO.h \
luaengine/LuaEngineIO_global.h luaengine/LuaEngineIO_global.h
unix {
target.path = $$LUAENGINE_LIBDIR
INSTALLS += target
}
win32 { win32 {
RC_LANG = 0x0 RC_LANG = 0x0
QMAKE_TARGET_COMPANY = "Syping" QMAKE_TARGET_COMPANY = "Syping"

View file

@ -15,7 +15,7 @@
#* limitations under the License. #* limitations under the License.
#*****************************************************************************/ #*****************************************************************************/
QT += core QT -= gui
TARGET = LuaEngineOS TARGET = LuaEngineOS
TEMPLATE = lib TEMPLATE = lib
CONFIG += c++11 \ CONFIG += c++11 \
@ -25,9 +25,15 @@ VERSION = 0.1
DEFINES += LUAENGINEOS_LIBRARY DEFINES += LUAENGINEOS_LIBRARY
static: DEFINES += LUAENGINE_STATIC static: DEFINES += LUAENGINE_STATIC
# PROJECT PREFIX
unix {
isEmpty(LUAENGINE_PREFIX): LUAENGINE_PREFIX = /usr/local
isEmpty(LUAENGINE_LIBDIR): LUAENGINE_LIBDIR = $$LUAENGINE_PREFIX/lib
}
unix: LIBS += "-Wl,-rpath,\'$$LUAENGINE_LIBDIR\'" -L$$OUT_PWD/../luaenginecore -lLuaEngine
CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine CONFIG(debug, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/debug -lLuaEngine
CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine CONFIG(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine
unix: LIBS += -L$$OUT_PWD/../luaenginecore -lLuaEngine
INCLUDEPATH += \ INCLUDEPATH += \
../luaenginecore/lua \ ../luaenginecore/lua \
@ -40,6 +46,11 @@ HEADERS += \
luaengine/LuaEngineOS.h \ luaengine/LuaEngineOS.h \
luaengine/LuaEngineOS_global.h luaengine/LuaEngineOS_global.h
unix {
target.path = $$LUAENGINE_LIBDIR
INSTALLS += target
}
win32 { win32 {
RC_LANG = 0x0 RC_LANG = 0x0
QMAKE_TARGET_COMPANY = "Syping" QMAKE_TARGET_COMPANY = "Syping"

View file

@ -23,6 +23,6 @@ SUBDIRS += luaenginecore \
luaengineio \ luaengineio \
luaengineos luaengineos
CONFIG(WITH_LUAENGINEAPP): SUBDIRS += luaengineapp
CONFIG(WITH_LUAENGINERUN): SUBDIRS += luaengine CONFIG(WITH_LUAENGINERUN): SUBDIRS += luaengine
CONFIG(WITH_LUAENGINEAPP): SUBDIRS += luaengineapp
CONFIG(WITH_LUAENGINECOM): SUBDIRS += luaenginec CONFIG(WITH_LUAENGINECOM): SUBDIRS += luaenginec