qwtfunctions.pri 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ################################################################
  2. # Qwt Widget Library
  3. # Copyright (C) 1997 Josef Wilgen
  4. # Copyright (C) 2002 Uwe Rathmann
  5. #
  6. # This library is free software; you can redistribute it and/or
  7. # modify it under the terms of the Qwt License, Version 1.0
  8. ################################################################
  9. # Copied and modified from qt_functions.prf
  10. defineReplace(qwtLibraryTarget) {
  11. unset(LIBRARY_NAME)
  12. LIBRARY_NAME = $$1
  13. mac:contains(QWT_CONFIG, QwtFramework) {
  14. QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME
  15. export(QMAKE_FRAMEWORK_BUNDLE_NAME)
  16. }
  17. contains(TEMPLATE, .*lib):CONFIG(debug, debug|release) {
  18. !debug_and_release|build_pass {
  19. mac:RET = $$member(LIBRARY_NAME, 0)_debug
  20. win32:RET = $$member(LIBRARY_NAME, 0)d
  21. }
  22. }
  23. isEmpty(RET):RET = $$LIBRARY_NAME
  24. return($$RET)
  25. }
  26. defineTest(qwtAddLibrary) {
  27. LIB_PATH = $$1
  28. LIB_NAME = $$2
  29. mac:contains(QWT_CONFIG, QwtFramework) {
  30. LIBS *= -F$${LIB_PATH}
  31. }
  32. else {
  33. unix:lessThan(QT_MAJOR_VERSION, 5) {
  34. # Many Linux distributions install Qwt in the same directory
  35. # as the Qt libs and thus we need to prepend the path for the local build
  36. # to avoid conflicting with the installed version.
  37. # Qt5 qmake appends ( instead of prepending ) the path to the Qt libs
  38. # to LIBS, but for Qt4 we need to use the QMAKE_LIBDIR_FLAGS.
  39. QMAKE_LIBDIR_FLAGS *= -L$${LIB_PATH}
  40. }
  41. else {
  42. LIBS *= -L$${LIB_PATH}
  43. }
  44. }
  45. unset(LINKAGE)
  46. mac:contains(QWT_CONFIG, QwtFramework) {
  47. LINKAGE = -framework $${LIB_NAME}
  48. }
  49. isEmpty(LINKAGE) {
  50. if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
  51. mac:LINKAGE = -l$${LIB_NAME}_debug
  52. win32:LINKAGE = -l$${LIB_NAME}d
  53. }
  54. }
  55. isEmpty(LINKAGE) {
  56. LINKAGE = -l$${LIB_NAME}
  57. }
  58. !isEmpty(QMAKE_LSB) {
  59. QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME}
  60. }
  61. LIBS += $$LINKAGE
  62. export(LIBS)
  63. export(QMAKE_LFLAGS)
  64. export(QMAKE_LIBDIR_FLAGS)
  65. return(true)
  66. }