diff --git a/build.pri b/build.pri deleted file mode 100644 index 7cccbe1..0000000 --- a/build.pri +++ /dev/null @@ -1,75 +0,0 @@ -local_build:{ - INCLUDEPATH += $$CHART_BUILD_PUBLIC_HEADER_DIR - - !win32: { - LIBS += -L $$CHART_BUILD_LIB_DIR -Wl,-rpath,$$CHART_BUILD_LIB_DIR - }else{ - win32-msvc*: { - # hack fix for error: - # "LINK : fatal error LNK1146: no argument specified with option '/LIBPATH:'" - QMAKE_LIBDIR += $$CHART_BUILD_LIB_DIR - }else{ - LIBS += -L $$CHART_BUILD_LIB_DIR - } - } - - CONFIG(debug, debug|release) { - LIBS += -lQtCommercialChartd - #this is ugly hack to work around missing rpath, it simply copies lib - win32:{ - copylib.target = $$CHART_BUILD_BIN_DIR/QtCommercialChartd.dll - copylib.commands = $$QMAKE_COPY $$CHART_BUILD_LIB_DIR\\QtCommercialChartd.dll $$CHART_BUILD_BIN_DIR - copylib.depends = $$CHART_BUILD_LIB_DIR/QtCommercialChartd.dll - PRE_TARGETDEPS += $$CHART_BUILD_BIN_DIR/QtCommercialChartd.dll - QMAKE_EXTRA_TARGETS +=copylib - } - } else { - LIBS += -lQtCommercialChart - - #this is ugly hack to work around missing rpath, it simply copies lib - win32: { - copylib.target = $$CHART_BUILD_BIN_DIR/QtCommercialChart - copylib.commands = $$QMAKE_COPY $$CHART_BUILD_LIB_DIR\\QtCommercialChart.dll $$CHART_BUILD_BIN_DIR - copylib.depends = $$CHART_BUILD_LIB_DIR/QtCommercialChart.dll - PRE_TARGETDEPS += $$CHART_BUILD_BIN_DIR/QtCommercialChart - QMAKE_EXTRA_TARGETS +=copylib - } - } - - mac: { - # This is a hack to make binaries to use the internal version of the QtCommercial Charts library on OSX - CHARTS_LIB_NAME = libQtCommercialChart.1.dylib - CONFIG(debug, debug|release) { - CHARTS_LIB_NAME = libQtCommercialChartd.1.dylib - } - BIN_TARGET_PATH = "" - exists ($$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET) { - BIN_TARGET_PATH = $$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET - } - exists ($$CHART_BUILD_BIN_DIR"/test/"$$TARGET".app/Contents/MacOS/"$$TARGET) { - # Executable in test folder - BIN_TARGET_PATH = $$CHART_BUILD_BIN_DIR"/test/"$$TARGET".app/Contents/MacOS/"$$TARGET - } - exists ($$CHART_BUILD_BIN_DIR"/test/tst_"$$TARGET".app/Contents/MacOS/tst_"$$TARGET) { - # Executable in test folder with custom target "tst_NNN" - BIN_TARGET_PATH = $$CHART_BUILD_BIN_DIR"/test/tst_"$$TARGET".app/Contents/MacOS/tst_"$$TARGET - } - exists($$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib") { - # Plugin - BIN_TARGET_PATH = $$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib" - } - !isEmpty (BIN_TARGET_PATH) { - QMAKE_POST_LINK += install_name_tool -change $$CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$CHARTS_LIB_NAME $$BIN_TARGET_PATH -# message($$QMAKE_POST_LINK) - } - - # Hack to make qml plugins available as internal build versions - exists($$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib") { - QMAKE_POST_LINK += " & $$QMAKE_COPY qmldir $$CHART_BUILD_PLUGIN_DIR" - message($$QMAKE_POST_LINK) - } - } - -} else { - CONFIG += qtcommercialchart -} diff --git a/charts.pro b/charts.pro index 97c8ac8..fea227b 100644 --- a/charts.pro +++ b/charts.pro @@ -7,15 +7,14 @@ SUBDIRS = src qmlplugin examples demos test development_build: message('Development build') -local_build:{ +!system_build:{ message('Configured for local build against local libs...') - message('You can run "make" to build qchart library, examples and demos...') + message('You can run "make" to build qchart library, examples, demos and plugin...') + message('You can run "make install" to install qchart in qt sdk...') } else { message('Running build aginst system libs...') message('Building only charts library...') - message('You can run "make install" to build and install charts.') message('Afterwards you can run "cd examples; qmake ; make " to build examples.') - message('Run qmake CONFIG+=local_build' to build everything at once.) SUBDIRS = src } diff --git a/config.pri b/config.pri index 1b4a1ba..264dae8 100644 --- a/config.pri +++ b/config.pri @@ -1,5 +1,8 @@ -#check if shadow build +LIBRARY_NAME = QtCommercialChart + +##################### SHADOW CONFIG ################################################# + !contains($${PWD}, $${OUT_PWD}){ search = "$$PWD:::" temp = $$split(search,"/") @@ -15,24 +18,24 @@ CONFIG-=development_build } +##################### BUILD PATHS ################################################## + CHART_BUILD_PUBLIC_HEADER_DIR = $$SHADOW/include CHART_BUILD_PRIVATE_HEADER_DIR = $$CHART_BUILD_PUBLIC_HEADER_DIR/private CHART_BUILD_LIB_DIR = $$SHADOW/lib CHART_BUILD_DIR = $$SHADOW/build CHART_BUILD_BIN_DIR = $$SHADOW/bin -CHART_BUILD_PLUGIN_DIR = $$CHART_BUILD_LIB_DIR/QtCommercial/Chart +CHART_BUILD_PLUGIN_DIR = $$CHART_BUILD_BIN_DIR/QtCommercial/Chart CHART_BUILD_DOC_DIR = $$SHADOW/doc - -# hack to fix windows builds win32:{ CHART_BUILD_PUBLIC_HEADER_DIR = $$replace(CHART_BUILD_PUBLIC_HEADER_DIR, "/","\\") CHART_BUILD_PRIVATE_HEADER_DIR = $$replace(CHART_BUILD_PRIVATE_HEADER_DIR, "/","\\") - CHART_BUILD_LIB_DIR = $$replace(CHART_BUILD_LIB_DIR, "/","\\") CHART_BUILD_BUILD_DIR = $$replace(CHART_BUILD_BUILD_DIR, "/","\\") CHART_BUILD_BIN_DIR = $$replace(CHART_BUILD_BIN_DIR, "/","\\") CHART_BUILD_PLUGIN_DIR = $$replace(CHART_BUILD_PLUGIN_DIR, "/","\\") CHART_BUILD_DOC_DIR = $$replace(CHART_BUILD_DOC_DIR, "/","\\") + CHART_BUILD_LIB_DIR = CHART_BUILD_BIN_DIR } mac: { @@ -44,8 +47,69 @@ mac: { QMAKE_LFLAGS *= -mmacosx-version-min=10.5 } +##################### DEVELOPMENT BUILD ################################################### + development_build: { DEFINES+=DEVELOPMENT_BUILD - CONFIG+=local_build CONFIG+=debug_and_release +} + + +##################### BUILD CONFIG ######################################################## + +!system_build:{ + + INCLUDEPATH += $$CHART_BUILD_PUBLIC_HEADER_DIR + + !win32: { + LIBS += -L $$CHART_BUILD_LIB_DIR -Wl,-rpath,$$CHART_BUILD_LIB_DIR + }else{ + win32-msvc*: { + # hack fix for error: + # "LINK : fatal error LNK1146: no argument specified with option '/LIBPATH:'" + QMAKE_LIBDIR += $$CHART_BUILD_LIB_DIR + }else{ + LIBS += -L $$CHART_BUILD_LIB_DIR + } + } + + CONFIG(debug, debug|release) { + mac: LIBRARY_NAME = $$join(LIBRARY_NAME,,,_debug) + win32: LIBRARY_NAME = $$join(LIBRARY_NAME,,,d) + } + + LIBS += -l$$LIBRARY_NAME + + + mac: { + # This is a hack to make binaries to use the internal version of the QtCommercial Charts library on OSX + CHARTS_LIB_NAME = libQtCommercialChart.1.dylib + CONFIG(debug, debug|release) { + CHARTS_LIB_NAME = libQtCommercialChartd.1.dylib + } + BIN_TARGET_PATH = "" + exists ($$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET) { + BIN_TARGET_PATH = $$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET + } + exists ($$CHART_BUILD_BIN_DIR"/test/"$$TARGET".app/Contents/MacOS/"$$TARGET) { + # Executable in test folder + BIN_TARGET_PATH = $$CHART_BUILD_BIN_DIR"/test/"$$TARGET".app/Contents/MacOS/"$$TARGET + } + exists ($$CHART_BUILD_BIN_DIR"/test/tst_"$$TARGET".app/Contents/MacOS/tst_"$$TARGET) { + # Executable in test folder with custom target "tst_NNN" + BIN_TARGET_PATH = $$CHART_BUILD_BIN_DIR"/test/tst_"$$TARGET".app/Contents/MacOS/tst_"$$TARGET + } + exists($$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib") { + # Plugin + BIN_TARGET_PATH = $$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib" + } + !isEmpty (BIN_TARGET_PATH) { + QMAKE_POST_LINK += install_name_tool -change $$CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$CHARTS_LIB_NAME $$BIN_TARGET_PATH + } + } + +}else { + + CONFIG += qtcommercialchart + } \ No newline at end of file diff --git a/demos/demos.pri b/demos/demos.pri index 7feabdc..8cfc561 100644 --- a/demos/demos.pri +++ b/demos/demos.pri @@ -2,10 +2,6 @@ error( "Couldn't find the config.pri file!" ) } -!include( ../build.pri ) { - error( "Couldn't find the build.pri file !") -} - DESTDIR = $$CHART_BUILD_BIN_DIR OBJECTS_DIR = $$CHART_BUILD_DIR/bin/$$TARGET MOC_DIR = $$CHART_BUILD_DIR/bin/$$TARGET diff --git a/demos/demos.pro b/demos/demos.pro index 398e390..be83a85 100644 --- a/demos/demos.pro +++ b/demos/demos.pro @@ -2,10 +2,6 @@ error( "Couldn't find the config.pri file!" ) } -!include( ../build.pri ) { - error( "Couldn't find the build.pri file !") -} - TEMPLATE = subdirs SUBDIRS += chartthemes \ piechartcustomization \ diff --git a/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.pri index 1b90206..567c6dc 100644 --- a/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.pri +++ b/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.pri @@ -1,10 +1,3 @@ -# checksum 0x368d version 0x60010 -# This file was generated by the Qt Quick Application wizard of Qt Creator. -# The code below adds the QmlApplicationViewer to the project and handles the -# activation of QML debugging. -# It is recommended not to modify this file, since newer versions of Qt Creator -# may offer an updated version of it. - QT += declarative SOURCES += $$PWD/qmlapplicationviewer.cpp @@ -18,129 +11,3 @@ INCLUDEPATH += $$PWD DEFINES -= QMLJSDEBUGGER } -contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) { - DEFINES += HARMATTAN_BOOSTER -} -# This file was generated by an application wizard of Qt Creator. -# The code below handles deployment to Symbian and Maemo, aswell as copying -# of the application data to shadow build directories on desktop. -# It is recommended not to modify this file, since newer versions of Qt Creator -# may offer an updated version of it. - -defineTest(qtcAddDeployment) { -for(deploymentfolder, DEPLOYMENTFOLDERS) { - item = item$${deploymentfolder} - itemsources = $${item}.sources - $$itemsources = $$eval($${deploymentfolder}.source) - itempath = $${item}.path - $$itempath= $$eval($${deploymentfolder}.target) - export($$itemsources) - export($$itempath) - DEPLOYMENT += $$item -} - -MAINPROFILEPWD = $$PWD - -symbian { - isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg - isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 -} else:win32 { - copyCommand = - for(deploymentfolder, DEPLOYMENTFOLDERS) { - source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) - source = $$replace(source, /, \\) - sourcePathSegments = $$split(source, \\) - target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments) - target = $$replace(target, /, \\) - !isEqual(source,$$target) { - !isEmpty(copyCommand):copyCommand += && - isEqual(QMAKE_DIR_SEP, \\) { - copyCommand += $(COPY_DIR) \"$$source\" \"$$target\" - } else { - source = $$replace(source, \\\\, /) - target = $$OUT_PWD/$$eval($${deploymentfolder}.target) - target = $$replace(target, \\\\, /) - copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\" - } - } - } - !isEmpty(copyCommand) { - copyCommand = @echo Copying application data... && $$copyCommand - copydeploymentfolders.commands = $$copyCommand - first.depends = $(first) copydeploymentfolders - export(first.depends) - export(copydeploymentfolders.commands) - QMAKE_EXTRA_TARGETS += first copydeploymentfolders - } -} else:unix { - maemo5 { - desktopfile.files = $${TARGET}.desktop - desktopfile.path = /usr/share/applications/hildon - icon.files = $${TARGET}64.png - icon.path = /usr/share/icons/hicolor/64x64/apps - } else:!isEmpty(MEEGO_VERSION_MAJOR) { - desktopfile.files = $${TARGET}_harmattan.desktop - desktopfile.path = /usr/share/applications - icon.files = $${TARGET}80.png - icon.path = /usr/share/icons/hicolor/80x80/apps - } else { # Assumed to be a Desktop Unix - copyCommand = - for(deploymentfolder, DEPLOYMENTFOLDERS) { - source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) - source = $$replace(source, \\\\, /) - macx { - target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) - } else { - target = $$OUT_PWD/$$eval($${deploymentfolder}.target) - } - target = $$replace(target, \\\\, /) - sourcePathSegments = $$split(source, /) - targetFullPath = $$target/$$last(sourcePathSegments) - !isEqual(source,$$targetFullPath) { - !isEmpty(copyCommand):copyCommand += && - copyCommand += $(MKDIR) \"$$target\" - copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\" - } - } - !isEmpty(copyCommand) { - copyCommand = @echo Copying application data... && $$copyCommand - copydeploymentfolders.commands = $$copyCommand - first.depends = $(first) copydeploymentfolders - export(first.depends) - export(copydeploymentfolders.commands) - QMAKE_EXTRA_TARGETS += first copydeploymentfolders - } - } - installPrefix = /opt/$${TARGET} - for(deploymentfolder, DEPLOYMENTFOLDERS) { - item = item$${deploymentfolder} - itemfiles = $${item}.files - $$itemfiles = $$eval($${deploymentfolder}.source) - itempath = $${item}.path - $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target) - export($$itemfiles) - export($$itempath) - INSTALLS += $$item - } - - !isEmpty(desktopfile.path) { - export(icon.files) - export(icon.path) - export(desktopfile.files) - export(desktopfile.path) - INSTALLS += icon desktopfile - } - - target.path = $${installPrefix}/bin - export(target.path) - INSTALLS += target -} - -export (ICON) -export (INSTALLS) -export (DEPLOYMENT) -export (TARGET.EPOCHEAPSIZE) -export (TARGET.CAPABILITY) -export (LIBS) -export (QMAKE_EXTRA_TARGETS) -} diff --git a/demos/qmlchart/qmlchart.pro b/demos/qmlchart/qmlchart.pro index ba3d623..002222e 100644 --- a/demos/qmlchart/qmlchart.pro +++ b/demos/qmlchart/qmlchart.pro @@ -2,47 +2,8 @@ error( "Couldn't find the demos.pri file!" ) } -integrated_build:{ - message(Please export QML_IMPORT_PATH=$$CHART_BUILD_LIB_DIR) -} - -RESOURCES += \ - resources.qrc - -# Add more folders to ship with the application, here -folder_01.source = qml/qmlchart -folder_01.target = qml -DEPLOYMENTFOLDERS = folder_01 - -# Additional import path used to resolve QML modules in Creator's code model -QML_IMPORT_PATH = - -symbian:TARGET.UID3 = 0xE421236E - -# Smart Installer package's UID -# This UID is from the protected range and therefore the package will -# fail to install if self-signed. By default qmake uses the unprotected -# range value if unprotected UID is defined for the application and -# 0x2002CCCF value if protected UID is given to the application -#symbian:DEPLOYMENT.installer_header = 0x2002CCCF - -# Allow network access on Symbian -symbian:TARGET.CAPABILITY += NetworkServices - -# If your application uses the Qt Mobility libraries, uncomment the following -# lines and add the respective components to the MOBILITY variable. -# CONFIG += mobility -# MOBILITY += - -# Speed up launching on MeeGo/Harmattan when using applauncherd daemon -# CONFIG += qdeclarative-boostable - -# Add dependency to Symbian components -# CONFIG += qt-components - -# The .cpp file which was generated for your project. Feel free to hack it. +RESOURCES += resources.qrc SOURCES += main.cpp -# Please do not modify the following two lines. Required for deployment. include(qmlapplicationviewer/qmlapplicationviewer.pri) -qtcAddDeployment() + diff --git a/examples/examples.pri b/examples/examples.pri index 7feabdc..8cfc561 100644 --- a/examples/examples.pri +++ b/examples/examples.pri @@ -2,10 +2,6 @@ error( "Couldn't find the config.pri file!" ) } -!include( ../build.pri ) { - error( "Couldn't find the build.pri file !") -} - DESTDIR = $$CHART_BUILD_BIN_DIR OBJECTS_DIR = $$CHART_BUILD_DIR/bin/$$TARGET MOC_DIR = $$CHART_BUILD_DIR/bin/$$TARGET diff --git a/examples/examples.pro b/examples/examples.pro index 5f91650..594aa6e 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -2,10 +2,6 @@ error( "Couldn't find the config.pri file!" ) } -!include( ../build.pri ) { - error( "Couldn't find the build.pri file !") -} - TEMPLATE = subdirs SUBDIRS += \ areachart \ diff --git a/qmlplugin/qmlplugin.pro b/qmlplugin/qmlplugin.pro index 803a0b9..a31f8e8 100644 --- a/qmlplugin/qmlplugin.pro +++ b/qmlplugin/qmlplugin.pro @@ -4,10 +4,7 @@ CONFIG += qt plugin QT += declarative !include( ../config.pri ) { - error( "Couldn't find the common.pri file!" ) -} -!include( ../build.pri ) { - error( "Couldn't find the build.pri file !") + error( "Couldn't find the config.pri file!" ) } DESTDIR = $$CHART_BUILD_PLUGIN_DIR @@ -47,5 +44,17 @@ TARGETPATH = QtCommercial/Chart target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH qmldir.files += $$PWD/qmldir qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH - INSTALLS += target qmldir + +!mac { + FILE = $$PWD/qmldir + win32:{FILE = $$replace(FILE, "/","\\")} + QMAKE_POST_LINK += $$QMAKE_COPY $$FILE $$CHART_BUILD_PLUGIN_DIR +}else{ + # Hack to make qml plugins available as internal build versions + exists($$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib") { + QMAKE_POST_LINK += " & $$QMAKE_COPY qmldir $$CHART_BUILD_PLUGIN_DIR" + } +} + + diff --git a/src/src.pro b/src/src.pro index 9f470b2..1f442e9 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,12 +1,19 @@ !include( ../config.pri ):error( Couldn't find the config.pri file! ) -TARGET = QtCommercialChart + +TARGET = $$LIBRARY_NAME DESTDIR = $$CHART_BUILD_LIB_DIR TEMPLATE = lib -QT += core \ - gui +QT = core gui + win32-msvc*: LIBS += User32.lib -CONFIG += debug_and_release -CONFIG(debug, debug|release):TARGET = QtCommercialChartd + +CONFIG(debug, debug|release) { + mac: TARGET = $$join(TARGET,,,_debug) + win32: TARGET = $$join(TARGET,,d) +} + +LIBS -= -l$$LIBRARY_NAME + SOURCES += \ $$PWD/chartdataset.cpp \ $$PWD/chartpresenter.cpp \ diff --git a/test/test.pri b/test/test.pri index 1467d8a..7fcfcf4 100644 --- a/test/test.pri +++ b/test/test.pri @@ -1,9 +1,6 @@ !include( ../config.pri ) { error( "Couldn't find the config.pri file!" ) } -!include( ../build.pri ) { - error( "Couldn't find the build.pri file !") -} TEMPLATE = app diff --git a/test/test.pro b/test/test.pro index 5d0aaf4..0ee6359 100644 --- a/test/test.pro +++ b/test/test.pro @@ -2,10 +2,6 @@ error( "Couldn't find the config.pri file!" ) } -!include( ../build.pri ) { - error( "Couldn't find the build.pri file !") -} - TEMPLATE = subdirs SUBDIRS += \ chartwidgettest \