##// END OF EJS Templates
Hacked library dependency issues on OSX
Tero Ahola -
r1035:94e302b01c45
parent child
Show More
@@ -83,30 +83,18 development_build: {
83 LIBS += -l$$LIBRARY_NAME
83 LIBS += -l$$LIBRARY_NAME
84
84
85 mac: {
85 mac: {
86 # This is a hack to make binaries to use the internal version of the QtCommercial Charts library on OSX
86 # This is a hack; we define variables for easier install_name_tool calls from project files of OSX executables/libraries
87 CHARTS_LIB_NAME = libQtCommercialChart.1.dylib
87 # install_name_tool is used to update the dependencies to chart library to match the local build folder
88 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
88 CONFIG(debug, debug|release) {
89 CONFIG(debug, debug|release) {
89 CHARTS_LIB_NAME = libQtCommercialChartd.1.dylib
90 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
90 }
91 BIN_TARGET_PATH = ""
92 exists ($$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET) {
93 BIN_TARGET_PATH = $$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET
94 }
95 exists ($$CHART_BUILD_BIN_DIR"/test/"$$TARGET".app/Contents/MacOS/"$$TARGET) {
96 # Executable in test folder
97 BIN_TARGET_PATH = $$CHART_BUILD_BIN_DIR"/test/"$$TARGET".app/Contents/MacOS/"$$TARGET
98 }
99 exists ($$CHART_BUILD_BIN_DIR"/test/tst_"$$TARGET".app/Contents/MacOS/tst_"$$TARGET) {
100 # Executable in test folder with custom target "tst_NNN"
101 BIN_TARGET_PATH = $$CHART_BUILD_BIN_DIR"/test/tst_"$$TARGET".app/Contents/MacOS/tst_"$$TARGET
102 }
103 exists($$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib") {
104 # Plugin
105 BIN_TARGET_PATH = $$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib"
106 }
107 !isEmpty (BIN_TARGET_PATH) {
108 QMAKE_POST_LINK += install_name_tool -change $$CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$CHARTS_LIB_NAME $$BIN_TARGET_PATH
109 }
91 }
92 MAC_POST_LINK_PREFIX = install_name_tool -change $$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME
93 MAC_DEMOS_BIN_DIR = $$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET
94 MAC_EXAMPLES_BIN_DIR = $$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET
95 MAC_TESTS_BIN_DIR = $$CHART_BUILD_BIN_DIR"/test/"$$TARGET".app/Contents/MacOS/"$$TARGET
96 MAC_AUTOTESTS_BIN_DIR = $$CHART_BUILD_BIN_DIR"/test/tst_"$$TARGET".app/Contents/MacOS/tst_"$$TARGET
97 MAC_PLUGINS_BIN_DIR = $$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib"
110 }
98 }
111
99
112 } else {
100 } else {
@@ -2,3 +2,11
2 TARGET = chartthemes
2 TARGET = chartthemes
3 SOURCES = main.cpp themewidget.cpp
3 SOURCES = main.cpp themewidget.cpp
4 HEADERS = themewidget.h
4 HEADERS = themewidget.h
5
6 # This is a hack to make binaries to use the internal version of the QtCommercial Charts library on OSX
7 #CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
8 #CONFIG(debug, debug|release) {
9 # CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
10 #}
11
12 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -1,3 +1,4
1 CURRENTLY_BUILDING_COMPONENTS = "demos"
1 !include( ../config.pri ) {
2 !include( ../config.pri ) {
2 error( "Couldn't find the config.pri file!" )
3 error( "Couldn't find the config.pri file!" )
3 }
4 }
@@ -2,3 +2,5
2 TARGET = dynamicspline
2 TARGET = dynamicspline
3 HEADERS += chart.h
3 HEADERS += chart.h
4 SOURCES += main.cpp chart.cpp
4 SOURCES += main.cpp chart.cpp
5
6 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -14,4 +14,5 HEADERS += \
14 customslice.h \
14 customslice.h \
15 mainwidget.h
15 mainwidget.h
16
16
17 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
17
18
@@ -7,3 +7,4 SOURCES += main.cpp
7
7
8 include(qmlapplicationviewer/qmlapplicationviewer.pri)
8 include(qmlapplicationviewer/qmlapplicationviewer.pri)
9
9
10 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -4,5 +4,4
4 TARGET = areachart
4 TARGET = areachart
5 SOURCES += main.cpp
5 SOURCES += main.cpp
6
6
7
7 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
8
@@ -5,3 +5,4
5 TARGET = barchart
5 TARGET = barchart
6 SOURCES += main.cpp
6 SOURCES += main.cpp
7
7
8 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -5,5 +5,4
5 TARGET = customchart
5 TARGET = customchart
6 SOURCES += main.cpp
6 SOURCES += main.cpp
7
7
8
8 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
9
@@ -1,3 +1,4
1 CURRENTLY_BUILDING_COMPONENTS = "examples"
1 !include( ../config.pri ) {
2 !include( ../config.pri ) {
2 error( "Couldn't find the config.pri file!" )
3 error( "Couldn't find the config.pri file!" )
3 }
4 }
@@ -19,11 +20,3 SUBDIRS += \
19 stackedbarchartdrilldown \
20 stackedbarchartdrilldown \
20 zoomlinechart \
21 zoomlinechart \
21 modeldata
22 modeldata
22
23
24
25
26
27
28
29
@@ -4,5 +4,4
4 TARGET = linechart
4 TARGET = linechart
5 SOURCES += main.cpp
5 SOURCES += main.cpp
6
6
7
7 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
8
@@ -1,9 +1,3
1 #-------------------------------------------------
2 #
3 # Project created by QtCreator 2012-03-08T14:30:24
4 #
5 #-------------------------------------------------
6
7 !include( ../examples.pri ) {
1 !include( ../examples.pri ) {
8 error( "Couldn't find the examples.pri file!" )
2 error( "Couldn't find the examples.pri file!" )
9 }
3 }
@@ -20,3 +14,5 SOURCES += main.cpp\
20
14
21 HEADERS += tablewidget.h \
15 HEADERS += tablewidget.h \
22 customtablemodel.h
16 customtablemodel.h
17
18 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -5,3 +5,4
5 TARGET = percentbarchart
5 TARGET = percentbarchart
6 SOURCES += main.cpp
6 SOURCES += main.cpp
7
7
8 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -4,4 +4,4
4 TARGET = piechart
4 TARGET = piechart
5 SOURCES += main.cpp
5 SOURCES += main.cpp
6
6
7
7 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -10,3 +10,4 HEADERS += \
10 drilldownchart.h \
10 drilldownchart.h \
11 drilldownslice.h
11 drilldownslice.h
12
12
13 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -4,3 +4,5
4 TARGET = presenterchart
4 TARGET = presenterchart
5 HEADERS += chartview.h
5 HEADERS += chartview.h
6 SOURCES += main.cpp chartview.cpp
6 SOURCES += main.cpp chartview.cpp
7
8 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -7,3 +7,5 SOURCES += main.cpp \
7
7
8 HEADERS += \
8 HEADERS += \
9 chartview.h
9 chartview.h
10
11 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -7,3 +7,5 SOURCES += main.cpp \
7 chartview.cpp
7 chartview.cpp
8 HEADERS += \
8 HEADERS += \
9 chartview.h
9 chartview.h
10
11 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -4,5 +4,4
4 TARGET = splinechart
4 TARGET = splinechart
5 SOURCES += main.cpp
5 SOURCES += main.cpp
6
6
7
7 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
8
@@ -3,3 +3,5
3 }
3 }
4 TARGET = stackedbarchart
4 TARGET = stackedbarchart
5 SOURCES += main.cpp
5 SOURCES += main.cpp
6
7 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -5,3 +5,4 TARGET = stackedbarchartdrilldown
5 SOURCES += main.cpp drilldownseries.cpp drilldownchart.cpp
5 SOURCES += main.cpp drilldownseries.cpp drilldownchart.cpp
6 HEADERS += drilldownseries.h drilldownchart.h
6 HEADERS += drilldownseries.h drilldownchart.h
7
7
8 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -5,6 +5,4 TARGET = zoomlinechart
5 HEADERS += chartview.h
5 HEADERS += chartview.h
6 SOURCES += main.cpp chartview.cpp
6 SOURCES += main.cpp chartview.cpp
7
7
8
8 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
9
10
@@ -1,3 +1,4
1 CURRENTLY_BUILDING_COMPONENTS = "qmlplugin"
1 TEMPLATE = lib
2 TEMPLATE = lib
2 TARGET = qtcommercialchartqml
3 TARGET = qtcommercialchartqml
3 CONFIG += qt plugin
4 CONFIG += qt plugin
@@ -49,3 +50,4 INSTALLS += target qmldir
49 FILE = $$PWD/qmldir
50 FILE = $$PWD/qmldir
50 win32:{FILE = $$replace(FILE, "/","\\")}
51 win32:{FILE = $$replace(FILE, "/","\\")}
51 QMAKE_POST_LINK += $$QMAKE_COPY $$FILE $$CHART_BUILD_PLUGIN_DIR
52 QMAKE_POST_LINK += $$QMAKE_COPY $$FILE $$CHART_BUILD_PLUGIN_DIR
53 mac: QMAKE_POST_LINK += " & $$MAC_POST_LINK_PREFIX $$MAC_PLUGINS_BIN_DIR"
@@ -1,4 +1,7
1 !include( ../auto.pri ) {
1 !include( ../auto.pri ) {
2 error( "Couldn't find the auto.pri file!" )
2 error( "Couldn't find the auto.pri file!" )
3 }
3 }
4
4 SOURCES += tst_chartdataset.cpp
5 SOURCES += tst_chartdataset.cpp
6
7 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -2,3 +2,5
2 error( "Couldn't find the auto.pri file!" )
2 error( "Couldn't find the auto.pri file!" )
3 }
3 }
4 SOURCES += tst_domain.cpp
4 SOURCES += tst_domain.cpp
5
6 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -2,3 +2,5
2 error( "Couldn't find the auto.pri file!" )
2 error( "Couldn't find the auto.pri file!" )
3 }
3 }
4 SOURCES += tst_qchart.cpp
4 SOURCES += tst_qchart.cpp
5
6 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -2,3 +2,5
2 error( "Couldn't find the auto.pri file!" )
2 error( "Couldn't find the auto.pri file!" )
3 }
3 }
4 SOURCES += tst_qchartview.cpp
4 SOURCES += tst_qchartview.cpp
5
6 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -16,3 +16,5 SOURCES += main.cpp \
16 HEADERS += \
16 HEADERS += \
17 mainwidget.h \
17 mainwidget.h \
18 dataseriedialog.h
18 dataseriedialog.h
19
20 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_TESTS_BIN_DIR"
@@ -16,3 +16,5 HEADERS += widget.h
16 # TODO: QMAKE_POST_LINK does not work on mac; how to copy the data file?
16 # TODO: QMAKE_POST_LINK does not work on mac; how to copy the data file?
17 QMAKE_POST_LINK += $$QMAKE_COPY $$FILE $$CHART_BUILD_BIN_DIR
17 QMAKE_POST_LINK += $$QMAKE_COPY $$FILE $$CHART_BUILD_BIN_DIR
18 }
18 }
19
20 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_TESTS_BIN_DIR"
@@ -14,3 +14,5 SOURCES += main.cpp\
14
14
15 HEADERS += tablewidget.h \
15 HEADERS += tablewidget.h \
16 customtablemodel.h
16 customtablemodel.h
17
18 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_TESTS_BIN_DIR"
@@ -6,5 +6,4 TARGET = wavechart
6 SOURCES += main.cpp wavechart.cpp
6 SOURCES += main.cpp wavechart.cpp
7 HEADERS += wavechart.h
7 HEADERS += wavechart.h
8
8
9
9 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_TESTS_BIN_DIR"
10
General Comments 0
You need to be logged in to leave comments. Login now