From 40d974f804c523a2d3297b87ed696beba3de4d95 Mon Sep 17 00:00:00 2001 From: Syping Date: Wed, 16 Oct 2019 22:07:14 +0200 Subject: [PATCH] improve linking and installation --- src/luaengine/luaengine.pro | 16 ++++++++++++++-- src/luaengineapp/luaengineapp.pro | 16 ++++++++++++++-- src/luaenginec/luaenginec.pro | 17 ++++++++++++++--- src/luaenginec/main.cpp | 2 +- src/luaenginecore/luaenginecore.pro | 11 +++++++++++ src/luaenginegui/luaenginegui.pro | 13 ++++++++++++- src/luaengineio/luaengineio.pro | 15 +++++++++++++-- src/luaengineos/luaengineos.pro | 15 +++++++++++++-- src/src.pro | 2 +- 9 files changed, 93 insertions(+), 14 deletions(-) diff --git a/src/luaengine/luaengine.pro b/src/luaengine/luaengine.pro index 70df17c..23774e7 100644 --- a/src/luaengine/luaengine.pro +++ b/src/luaengine/luaengine.pro @@ -15,16 +15,23 @@ #* limitations under the License. #*****************************************************************************/ -QT += core gui widgets +QT += widgets TARGET = luaengine win32: TARGET = LuaEngine CONFIG += c++11 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(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 += \ ../luaenginecore/lua \ @@ -35,3 +42,8 @@ INCLUDEPATH += \ SOURCES += \ main.cpp + +unix { + target.path = $$LUAENGINE_BINDIR + INSTALLS += target +} diff --git a/src/luaengineapp/luaengineapp.pro b/src/luaengineapp/luaengineapp.pro index 5319a7f..01dddf5 100644 --- a/src/luaengineapp/luaengineapp.pro +++ b/src/luaengineapp/luaengineapp.pro @@ -15,16 +15,23 @@ #* limitations under the License. #*****************************************************************************/ -QT += core gui widgets +QT += widgets TARGET = luaengineapp win32: TARGET = LuaEngineApp CONFIG += c++11 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(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 += \ ../luaenginecore/lua \ @@ -40,6 +47,11 @@ OTHER_FILES += \ app.lua \ app.rc +unix { + target.path = $$LUAENGINE_BINDIR + INSTALLS += target +} + win32: CONFIG(LUAENGINE_RESOURCE_SCRIPT) { DEFINES += LUAENGINE_RESOURCE_SCRIPT HEADERS += resource.h diff --git a/src/luaenginec/luaenginec.pro b/src/luaenginec/luaenginec.pro index b60be0a..cb97070 100644 --- a/src/luaenginec/luaenginec.pro +++ b/src/luaenginec/luaenginec.pro @@ -15,16 +15,22 @@ #* limitations under the License. #*****************************************************************************/ -QT += core -QT -= gui widgets +QT -= gui TARGET = luaenginec CONFIG += c++11 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(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine -unix: LIBS += -L$$OUT_PWD/../luaenginecore -lLuaEngine INCLUDEPATH += \ ../luaenginecore/lua \ @@ -33,6 +39,11 @@ INCLUDEPATH += \ SOURCES += \ main.cpp +unix { + target.path = $$LUAENGINE_BINDIR + INSTALLS += target +} + win32 { RC_LANG = 0x0 QMAKE_TARGET_COMPANY = "Syping" diff --git a/src/luaenginec/main.cpp b/src/luaenginec/main.cpp index fabd1b9..f024ed7 100644 --- a/src/luaenginec/main.cpp +++ b/src/luaenginec/main.cpp @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); - a.setApplicationName("luaenginec"); + a.setApplicationName("LuaEngine Compiler"); a.setApplicationVersion("0.1"); QCommandLineParser parser; diff --git a/src/luaenginecore/luaenginecore.pro b/src/luaenginecore/luaenginecore.pro index 87e4b81..1b065ca 100644 --- a/src/luaenginecore/luaenginecore.pro +++ b/src/luaenginecore/luaenginecore.pro @@ -29,6 +29,12 @@ static: DEFINES += LUAENGINE_STATIC linux: DEFINES += LUA_USE_LINUX 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 += \ luaengine/LuaEngine.cpp @@ -99,6 +105,11 @@ HEADERS += \ lua/lvm.h \ lua/lzio.h +unix { + target.path = $$LUAENGINE_LIBDIR + INSTALLS += target +} + win32 { RC_LANG = 0x0 QMAKE_TARGET_COMPANY = "Syping" diff --git a/src/luaenginegui/luaenginegui.pro b/src/luaenginegui/luaenginegui.pro index 805e9f0..abe8bd5 100644 --- a/src/luaenginegui/luaenginegui.pro +++ b/src/luaenginegui/luaenginegui.pro @@ -25,9 +25,15 @@ VERSION = 0.1 DEFINES += LUAENGINEGUI_LIBRARY 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(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine -unix: LIBS += -L$$OUT_PWD/../luaenginecore -lLuaEngine INCLUDEPATH += \ ../luaenginecore/lua \ @@ -40,6 +46,11 @@ HEADERS += \ luaengine/LuaEngineGui.h \ luaengine/LuaEngineGui_global.h +unix { + target.path = $$LUAENGINE_LIBDIR + INSTALLS += target +} + win32 { RC_LANG = 0x0 QMAKE_TARGET_COMPANY = "Syping" diff --git a/src/luaengineio/luaengineio.pro b/src/luaengineio/luaengineio.pro index 4909f83..efa3b91 100644 --- a/src/luaengineio/luaengineio.pro +++ b/src/luaengineio/luaengineio.pro @@ -15,7 +15,7 @@ #* limitations under the License. #*****************************************************************************/ -QT += core +QT -= gui TARGET = LuaEngineIO TEMPLATE = lib CONFIG += c++11 \ @@ -25,9 +25,15 @@ VERSION = 0.1 DEFINES += LUAENGINEIO_LIBRARY 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(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine -unix: LIBS += -L$$OUT_PWD/../luaenginecore -lLuaEngine INCLUDEPATH += \ ../luaenginecore/lua \ @@ -40,6 +46,11 @@ HEADERS += \ luaengine/LuaEngineIO.h \ luaengine/LuaEngineIO_global.h +unix { + target.path = $$LUAENGINE_LIBDIR + INSTALLS += target +} + win32 { RC_LANG = 0x0 QMAKE_TARGET_COMPANY = "Syping" diff --git a/src/luaengineos/luaengineos.pro b/src/luaengineos/luaengineos.pro index 4edacf9..8a2cdae 100644 --- a/src/luaengineos/luaengineos.pro +++ b/src/luaengineos/luaengineos.pro @@ -15,7 +15,7 @@ #* limitations under the License. #*****************************************************************************/ -QT += core +QT -= gui TARGET = LuaEngineOS TEMPLATE = lib CONFIG += c++11 \ @@ -25,9 +25,15 @@ VERSION = 0.1 DEFINES += LUAENGINEOS_LIBRARY 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(release, debug|release): win32: LIBS += -L$$OUT_PWD/../luaenginecore/release -lLuaEngine -unix: LIBS += -L$$OUT_PWD/../luaenginecore -lLuaEngine INCLUDEPATH += \ ../luaenginecore/lua \ @@ -40,6 +46,11 @@ HEADERS += \ luaengine/LuaEngineOS.h \ luaengine/LuaEngineOS_global.h +unix { + target.path = $$LUAENGINE_LIBDIR + INSTALLS += target +} + win32 { RC_LANG = 0x0 QMAKE_TARGET_COMPANY = "Syping" diff --git a/src/src.pro b/src/src.pro index 8c0775a..bc1d66f 100644 --- a/src/src.pro +++ b/src/src.pro @@ -23,6 +23,6 @@ SUBDIRS += luaenginecore \ luaengineio \ luaengineos -CONFIG(WITH_LUAENGINEAPP): SUBDIRS += luaengineapp CONFIG(WITH_LUAENGINERUN): SUBDIRS += luaengine +CONFIG(WITH_LUAENGINEAPP): SUBDIRS += luaengineapp CONFIG(WITH_LUAENGINECOM): SUBDIRS += luaenginec