Commit c9d80e03 authored by victor's avatar victor

git-svn-id: http://lpm.org.ru/svn/kumir2@1 382dccb8-6cdf-11e0-9640-eb60159f4418
parents
!isEmpty(QTCREATOR_PRI_INCLUDED):error("kumir2.pri already included")
QTCREATOR_PRI_INCLUDED = 1
defineReplace(cleanPath) {
win32:1 ~= s|\\\\|/|g
contains(1, ^/.*):pfx = /
else:pfx =
segs = $$split(1, /)
out =
for(seg, segs) {
equals(seg, ..):out = $$member(out, 0, -2)
else:!equals(seg, .):out += $$seg
}
return($$join(out, /, $$pfx))
}
defineReplace(targetPath) {
return($$replace(1, /, $$QMAKE_DIR_SEP))
}
defineReplace(qtLibraryName) {
unset(LIBRARY_NAME)
LIBRARY_NAME = $$1
CONFIG(debug, debug|release) {
!debug_and_release|build_pass {
mac:RET = $$member(LIBRARY_NAME, 0)_debug
else:win32:RET = $$member(LIBRARY_NAME, 0)d
}
}
isEmpty(RET):RET = $$LIBRARY_NAME
return($$RET)
}
defineTest(minQtVersion) {
maj = $$1
min = $$2
patch = $$3
isEqual(QT_MAJOR_VERSION, $$maj) {
isEqual(QT_MINOR_VERSION, $$min) {
isEqual(QT_PATCH_VERSION, $$patch) {
return(true)
}
greaterThan(QT_PATCH_VERSION, $$patch) {
return(true)
}
}
greaterThan(QT_MINOR_VERSION, $$min) {
return(true)
}
}
return(false)
}
# For use in custom compilers which just copy files
win32:i_flag = i
defineReplace(stripSrcDir) {
win32 {
!contains(1, ^.:.*):1 = $$OUT_PWD/$$1
} else {
!contains(1, ^/.*):1 = $$OUT_PWD/$$1
}
out = $$cleanPath($$1)
out ~= s|^$$re_escape($$PWD/)||$$i_flag
return($$out)
}
isEmpty(TEST):CONFIG(debug, debug|release) {
!debug_and_release|build_pass {
TEST = 1
}
}
isEmpty(IDE_LIBRARY_BASENAME) {
IDE_LIBRARY_BASENAME = lib
}
DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
equals(TEST, 1) {
QT +=testlib
DEFINES += WITH_TESTS
}
IDE_SOURCE_TREE = $$PWD
isEmpty(IDE_BUILD_TREE) {
sub_dir = $$_PRO_FILE_PWD_
sub_dir ~= s,^$$re_escape($$PWD),,
IDE_BUILD_TREE = $$cleanPath($$OUT_PWD)
IDE_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
}
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
macx {
IDE_APP_TARGET = "Kumir"
IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH
IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
IDE_DATA_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
IDE_DOC_PATH = $$IDE_DATA_PATH/doc
IDE_BIN_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
contains(QT_CONFIG, ppc):CONFIG += ppc x86
copydata = 1
} else {
win32 {
contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
IDE_APP_TARGET = kumir2
} else {
IDE_APP_TARGET = kumir2
}
IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/kumir2
IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH/plugins
IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
IDE_DATA_PATH = $$IDE_BUILD_TREE/share/kumir2
IDE_DOC_PATH = $$IDE_BUILD_TREE/share/doc/kumir2
IDE_BIN_PATH = $$IDE_APP_PATH
!isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}
INCLUDEPATH += \
$$IDE_SOURCE_TREE/src/shared \
$$IDE_SOURCE_TREE/tools
DEPENDPATH += \
$$IDE_SOURCE_TREE/src/shared \
$$IDE_SOURCE_TREE/tools
LIBS += -L$$IDE_LIBRARY_PATH
#DEFINES += QT_NO_CAST_FROM_ASCII
DEFINES += QT_NO_CAST_TO_ASCII
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
unix {
CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
CONFIG(debug, debug|release):MOC_DIR = $${OUT_PWD}/.moc/debug-shared
CONFIG(release, debug|release):MOC_DIR = $${OUT_PWD}/.moc/release-shared
RCC_DIR = $${OUT_PWD}/.rcc
UI_DIR = $${OUT_PWD}/.uic
}
linux-g++-* {
# Bail out on non-selfcontained libraries. Just a security measure
# to prevent checking in code that does not compile on other platforms.
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined -Wl,--no-undefined
}
win32-msvc* {
#Don't warn about sprintf, fopen etc being 'unsafe'
DEFINES += _CRT_SECURE_NO_WARNINGS
}
# Based on Qt Creator pro file
#version check qt
contains(QT_VERSION, ^4\\.[0-5]\\..*) {
message("Cannot build Kumir with Qt version $${QT_VERSION}.")
error("Use at least Qt 4.6.")
}
include(kumir2.pri)
#include(doc/doc.pri)
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = src share
TEMPLATE=subdirs
SUBDIRS=
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeIconFile</key>
<string>profile.icns</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>pro</string>
</array>
<key>CFBundleTypeName</key>
<string>Qt Project File</string>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeIconFile</key>
<string>prifile.icns</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>pri</string>
</array>
<key>CFBundleTypeName</key>
<string>Qt Project Include File</string>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeIconFile</key>
<string>profile.icns</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>creator</string>
</array>
<key>CFBundleTypeName</key>
<string>Qt Creator Makefile Based Project File</string>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeIconFile</key>
<string>profile.icns</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>qmlproject</string>
</array>
<key>CFBundleTypeName</key>
<string>Quick Project File</string>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>qrc</string>
</array>
<key>CFBundleTypeName</key>
<string>Qt Resource File</string>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>ui</string>
</array>
<key>CFBundleTypeName</key>
<string>Qt UI File</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>h</string>
<string>hpp</string>
</array>
<key>CFBundleTypeName</key>
<string>Header File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>cc</string>
<string>CC</string>
<string>cp</string>
<string>CP</string>
<string>cpp</string>
<string>CPP</string>
<string>cxx</string>
<string>CXX</string>
<string>c++</string>
<string>C++</string>
</array>
<key>CFBundleTypeName</key>
<string>C++ Source File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mm</string>
<string>MM</string>
</array>
<key>CFBundleTypeName</key>
<string>Objective-C++ Source File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>m</string>
</array>
<key>CFBundleTypeName</key>
<string>Objective-C Source File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>c</string>
<string>C</string>
</array>
<key>CFBundleTypeName</key>
<string>C Source File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>txt</string>
<string>text</string>
</array>
<key>CFBundleTypeName</key>
<string>Text File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>NSStringPboardType</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>NSHumanReadableCopyright</key>
<string>(C) 2008-2011 Nokia Corporation</string>
<key>CFBundleIconFile</key>
<string>@ICON@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
<string>com.nokia.qtcreator</string>
<key>CFBundleVersion</key>
<string>2.1.0</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
</dict>
</plist>
include(../../kumir2.pri)
TEMPLATE = app
TARGET = $$IDE_APP_TARGET
DESTDIR = $$IDE_APP_PATH
SOURCES += main.cpp
include(../rpath.pri)
win32 {
CONFIG(debug, debug|release):LIBS *= -lExtensionSystemd
else:LIBS *= -lExtensionSystem
RC_FILE = kumir2.rc
target.path = /bin
INSTALLS += target
} else:macx {
CONFIG(debug, debug|release):LIBS *= -lExtensionSystem_debug
else:LIBS *= -lExtensionSystem
LIBS += -framework CoreFoundation
ICON = kumir2.icns
QMAKE_INFO_PLIST = Info.plist
FILETYPES.files = profile.icns prifile.icns
FILETYPES.path = Contents/Resources
QMAKE_BUNDLE_DATA += FILETYPES
} else {
LIBS *= -lExtensionSystem
target.path = /bin
INSTALLS += target
}
OTHER_FILES += kumir2.rc Info.plist
IDI_ICON1 ICON DISCARDABLE "qtcreator.ico"
IDI_ICON2 ICON DISCARDABLE "winicons\c.ico"
IDI_ICON3 ICON DISCARDABLE "winicons\cpp.ico"
IDI_ICON4 ICON DISCARDABLE "winicons\h.ico"
IDI_ICON5 ICON DISCARDABLE "winicons\ui.ico"
IDI_ICON6 ICON DISCARDABLE "winicons\pro.ico"
IDI_ICON7 ICON DISCARDABLE "winicons\pri.ico"
#include <QtCore>
#include <QtGui>
#include "extensionsystem/pluginmanager.h"
#ifdef Q_OS_MAC
# define PLUGINS_PATH QDir(QApplication::applicationDirPath()+"/../PlugIns").canonicalPath()
# define SHARE_PATH "/../Resources"
#else
# define PLUGINS_PATH QDir(QApplication::applicationDirPath()+"/../"+IDE_LIBRARY_BASENAME+"/kumir2/plugins").canonicalPath()
# define SHARE_PATH "/../share/kumir2"
#endif
void showErrorMessage(const QString & text)
{
bool gui = true;
#ifdef Q_WS_X11
gui = gui && getenv("DISPLAY")!=0;
#endif
if (gui) {
QMessageBox::critical(0, "Kumir 2 Launcher", text);
}
else {
qCritical("%s", qPrintable(text));
}
}
int main(int argc, char **argv)
{
bool gui = true;
#ifdef Q_WS_X11
gui = gui && getenv("DISPLAY")!=0;
#endif
QApplication * app = new QApplication(argc, argv, gui);
QSettings::setDefaultFormat(QSettings::IniFormat);
QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, SHARE_PATH);
app->addLibraryPath(PLUGINS_PATH);
ExtensionSystem::PluginManager * manager = new ExtensionSystem::PluginManager;
QObject::connect (app, SIGNAL(aboutToQuit()), manager, SLOT(shutdown()));
manager->setPluginPath(PLUGINS_PATH);
manager->setSharePath(SHARE_PATH);
QString error;
#ifdef CONFIGURATION_TEMPLATE
const QString defaultTemplate = CONFIGURATION_TEMPLATE;
#else
const QString defaultTemplate = "&KumirCompiler";
#endif
QString templ = defaultTemplate;
for (int i=1; i<argc; i++) {
QString arg = QString::fromLocal8Bit(argv[i]);
if (arg.startsWith("[") && arg.endsWith("]")) {
templ = arg.mid(1, arg.length()-2);
}
}
error = manager->loadPluginsByTemplate(templ);
if (!gui && manager->isGuiRequired()) {
showErrorMessage("Requires X11 session to run this configuration");
delete manager;
delete app;
return 1;
}
if (!error.isEmpty()) {
showErrorMessage(error);
delete manager;
delete app;
return 1;
}
error = manager->initializePlugins();
if (!error.isEmpty()) {
showErrorMessage(error);
delete manager;
delete app;
return 1;
}
error = manager->start();
if (!error.isEmpty()) {
showErrorMessage(error);
delete manager;
delete app;
return 1;
}
int ret = app->exec();
delete manager;
delete app;
return ret;
}
include(../kumir2.pri)
win32 {
DLLDESTDIR = $$IDE_APP_PATH
}
DESTDIR = $$IDE_LIBRARY_PATH
include(rpath.pri)
TARGET = $$qtLibraryTarget($$TARGET)
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
!macx {
win32 {
target.path = /bin
target.files = $$DESTDIR/$${TARGET}.dll
} else {
target.path = /$$IDE_LIBRARY_BASENAME/kumir2
}
INSTALLS += target
}
QT -= gui
\ No newline at end of file
include(../kumir2.pri)
DESTDIR = $$IDE_PLUGIN_PATH
LIBS += -L$$DESTDIR
INCLUDEPATH += $$IDE_SOURCE_TREE/src/plugins
DEPENDPATH += $$IDE_SOURCE_TREE/src/plugins
# copy the plugin spec
isEmpty(TARGET) {
error("kumir2plugin.pri: You must provide a TARGET")
}
PLUGINSPECS = $${_PRO_FILE_PWD_}/$${TARGET}.pluginspec
copy2build.input = PLUGINSPECS
copy2build.output = $$DESTDIR/${QMAKE_FUNC_FILE_IN_stripSrcDir}
isEmpty(vcproj):copy2build.variable_out = PRE_TARGETDEPS
copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copy2build.name = COPY ${QMAKE_FILE_IN}
copy2build.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += copy2build
macx {
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../PlugIns/$${PROVIDER}/
} else:linux-* {
#do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
QMAKE_RPATHDIR += \$\$ORIGIN
QMAKE_RPATHDIR += \$\$ORIGIN/..
QMAKE_RPATHDIR += \$\$ORIGIN/../..
IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":")
QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\'
QMAKE_RPATHDIR =
}
#contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
CONFIG += plugin plugin_with_soname
!macx {
target.path = /$$IDE_LIBRARY_BASENAME/kumir2/plugins/$$PROVIDER
pluginspec.files += $${TARGET}.pluginspec
pluginspec.path = /$$IDE_LIBRARY_BASENAME/kumir2/plugins/$$PROVIDER
INSTALLS += target pluginspec
}
TARGET = $$qtLibraryTarget($$TARGET)
QT -= gui
{
name: "KumirAnalizer",
version: "1.99.0",
copyright: "NIISI RAS",
license: "LGPL2",
provides: "Analizer"