diff --git a/common.pri b/common.pri index 2666d35..a222bd0 100644 --- a/common.pri +++ b/common.pri @@ -1,9 +1,7 @@ CONFIG+=integrated_build #remove if you want to build against installed libs -SHADOW = $$find(OUT_PWD,$$PWD) - -unix:isEmpty(SHADOW){ - search = "$$PWD:::" +!contains($${PWD}, $${OUT_PWD}){ + search = "$$PWD:::" temp = $$split(search,"/") temp = $$last(temp) path = $$replace(search,$$temp,'') @@ -12,6 +10,8 @@ unix:isEmpty(SHADOW){ temp = $$first(temp) path = "$${path}$${temp}" SHADOW=$$path +}else{ + SHADOW=$$PWD } CHART_BUILD_PUBLIC_HEADER_DIR = $$SHADOW/include diff --git a/examples/gdpbarchart/gdpbarchart.pro b/examples/gdpbarchart/gdpbarchart.pro index f8997a0..da90137 100644 --- a/examples/gdpbarchart/gdpbarchart.pro +++ b/examples/gdpbarchart/gdpbarchart.pro @@ -9,6 +9,9 @@ SOURCES += main.cpp\ HEADERS += widget.h !mac { + DIR = $$PWD + + win32:{DIR = $$replace(DIR, "/","\\")} # TODO: QMAKE_POST_LINK does not work on mac; how to copy the data file? - QMAKE_POST_LINK += $$QMAKE_COPY $$PWD/gdpData $$CHART_BUILD_BIN_DIR + QMAKE_POST_LINK += $$QMAKE_COPY $$DIR/gdpData $$CHART_BUILD_BIN_DIR } diff --git a/src/src.pro b/src/src.pro index 3e09ead..20425a0 100644 --- a/src/src.pro +++ b/src/src.pro @@ -62,9 +62,15 @@ DEFINES += QTCOMMERCIALCHART_LIBRARY #qt public headers #this is very primitive and lame parser , TODO: make perl script insted -!exists($$CHART_BUILD_PUBLIC_HEADER_DIR) +!exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal) { system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR) + win32:{ + command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" + }else{ + command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" + } + system($$command) } for(file, PUBLIC_HEADERS) {