##// 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 83 LIBS += -l$$LIBRARY_NAME
84 84
85 85 mac: {
86 # This is a hack to make binaries to use the internal version of the QtCommercial Charts library on OSX
87 CHARTS_LIB_NAME = libQtCommercialChart.1.dylib
86 # This is a hack; we define variables for easier install_name_tool calls from project files of OSX executables/libraries
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 89 CONFIG(debug, debug|release) {
89 CHARTS_LIB_NAME = libQtCommercialChartd.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
90 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
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 100 } else {
@@ -2,3 +2,11
2 2 TARGET = chartthemes
3 3 SOURCES = main.cpp themewidget.cpp
4 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,5 +1,6
1 CURRENTLY_BUILDING_COMPONENTS = "demos"
1 2 !include( ../config.pri ) {
2 error( "Couldn't find the config.pri file!" )
3 error( "Couldn't find the config.pri file!" )
3 4 }
4 5
5 6 TEMPLATE = subdirs
@@ -2,3 +2,5
2 2 TARGET = dynamicspline
3 3 HEADERS += chart.h
4 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 14 customslice.h \
15 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 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 4 TARGET = areachart
5 5 SOURCES += main.cpp
6 6
7
8
7 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -5,3 +5,4
5 5 TARGET = barchart
6 6 SOURCES += main.cpp
7 7
8 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -5,5 +5,4
5 5 TARGET = customchart
6 6 SOURCES += main.cpp
7 7
8
9
8 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,5 +1,6
1 CURRENTLY_BUILDING_COMPONENTS = "examples"
1 2 !include( ../config.pri ) {
2 error( "Couldn't find the config.pri file!" )
3 error( "Couldn't find the config.pri file!" )
3 4 }
4 5
5 6 TEMPLATE = subdirs
@@ -18,12 +19,4 SUBDIRS += \
18 19 stackedbarchart \
19 20 stackedbarchartdrilldown \
20 21 zoomlinechart \
21 modeldata
22
23
24
25
26
27
28
29
22 modeldata
@@ -4,5 +4,4
4 4 TARGET = linechart
5 5 SOURCES += main.cpp
6 6
7
8
7 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,11 +1,5
1 #-------------------------------------------------
2 #
3 # Project created by QtCreator 2012-03-08T14:30:24
4 #
5 #-------------------------------------------------
6
7 1 !include( ../examples.pri ) {
8 error( "Couldn't find the examples.pri file!" )
2 error( "Couldn't find the examples.pri file!" )
9 3 }
10 4
11 5 QT += core gui
@@ -20,3 +14,5 SOURCES += main.cpp\
20 14
21 15 HEADERS += tablewidget.h \
22 16 customtablemodel.h
17
18 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -5,3 +5,4
5 5 TARGET = percentbarchart
6 6 SOURCES += main.cpp
7 7
8 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -4,4 +4,4
4 4 TARGET = piechart
5 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 10 drilldownchart.h \
11 11 drilldownslice.h
12 12
13 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -3,4 +3,6
3 3 }
4 4 TARGET = presenterchart
5 5 HEADERS += chartview.h
6 SOURCES += main.cpp chartview.cpp No newline at end of file
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 8 HEADERS += \
9 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 7 chartview.cpp
8 8 HEADERS += \
9 9 chartview.h
10
11 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -4,5 +4,4
4 4 TARGET = splinechart
5 5 SOURCES += main.cpp
6 6
7
8
7 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -2,4 +2,6
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = stackedbarchart
5 SOURCES += main.cpp No newline at end of file
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 5 SOURCES += main.cpp drilldownseries.cpp drilldownchart.cpp
6 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 5 HEADERS += chartview.h
6 6 SOURCES += main.cpp chartview.cpp
7 7
8
9
10
8 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,3 +1,4
1 CURRENTLY_BUILDING_COMPONENTS = "qmlplugin"
1 2 TEMPLATE = lib
2 3 TARGET = qtcommercialchartqml
3 4 CONFIG += qt plugin
@@ -49,3 +50,4 INSTALLS += target qmldir
49 50 FILE = $$PWD/qmldir
50 51 win32:{FILE = $$replace(FILE, "/","\\")}
51 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 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4
4 5 SOURCES += tst_chartdataset.cpp
6
7 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -2,3 +2,5
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_domain.cpp
5
6 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -2,3 +2,5
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_qchart.cpp
5
6 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -2,3 +2,5
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 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 16 HEADERS += \
17 17 mainwidget.h \
18 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 16 # TODO: QMAKE_POST_LINK does not work on mac; how to copy the data file?
17 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 15 HEADERS += tablewidget.h \
16 16 customtablemodel.h
17
18 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_TESTS_BIN_DIR"
@@ -6,5 +6,4 TARGET = wavechart
6 6 SOURCES += main.cpp wavechart.cpp
7 7 HEADERS += wavechart.h
8 8
9
10
9 mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_TESTS_BIN_DIR"
General Comments 0
You need to be logged in to leave comments. Login now