export-header.patch 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. From 372d1f5067a873ad9a59021a2b2e7afbd83cfe04 Mon Sep 17 00:00:00 2001
  2. From: Matthias Kuhn <matthias@opengis.ch>
  3. Date: Sun, 30 May 2021 19:46:46 +0200
  4. Subject: [PATCH] Add export header
  5. ---
  6. lib/CMakeLists.txt | 8 +++++++-
  7. lib/include/Spix/AnyRpcServer.h | 3 ++-
  8. lib/include/Spix/QtQmlBot.h | 3 ++-
  9. 3 files changed, 11 insertions(+), 3 deletions(-)
  10. diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
  11. index 643a4c8..1e6b9b4 100644
  12. --- a/lib/CMakeLists.txt
  13. +++ b/lib/CMakeLists.txt
  14. @@ -4,7 +4,6 @@
  15. include(GNUInstallDirs)
  16. include(CMakePackageConfigHelpers)
  17. -
  18. #
  19. # Dependencies
  20. #
  21. @@ -117,6 +116,7 @@ add_library(Spix ${SOURCES} ${MOC_FILES})
  22. target_include_directories(Spix
  23. PUBLIC
  24. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  25. + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
  26. $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  27. PRIVATE
  28. src
  29. @@ -130,6 +130,11 @@ target_link_libraries(Spix
  30. AnyRPC::anyrpc
  31. )
  32. +#
  33. +# Export headers
  34. +#
  35. +include(GenerateExportHeader)
  36. +generate_export_header(Spix)
  37. #
  38. # SpixConfig.cmake File
  39. @@ -153,6 +158,7 @@ install(
  40. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  41. )
  42. install(DIRECTORY include/Spix DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
  43. +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/spix_export.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
  44. install(
  45. EXPORT SpixTargets
  46. FILE SpixTargets.cmake
  47. diff --git a/lib/include/Spix/AnyRpcServer.h b/lib/include/Spix/AnyRpcServer.h
  48. index 8a3c447..a1e0707 100644
  49. --- a/lib/include/Spix/AnyRpcServer.h
  50. +++ b/lib/include/Spix/AnyRpcServer.h
  51. @@ -7,6 +7,7 @@
  52. #pragma once
  53. #include <Spix/TestServer.h>
  54. +#include "spix_export.h"
  55. namespace spix {
  56. @@ -20,7 +21,7 @@ struct AnyRpcServerPimpl;
  57. * application through external scripts (e.g. python with
  58. * its xml-rpc library).
  59. */
  60. -class AnyRpcServer : public TestServer {
  61. +class SPIX_EXPORT AnyRpcServer : public TestServer {
  62. public:
  63. AnyRpcServer(int anyrpcPort = 9000);
  64. ~AnyRpcServer() override;
  65. diff --git a/lib/include/Spix/QtQmlBot.h b/lib/include/Spix/QtQmlBot.h
  66. index 1f69a50..7ec88c6 100644
  67. --- a/lib/include/Spix/QtQmlBot.h
  68. +++ b/lib/include/Spix/QtQmlBot.h
  69. @@ -9,6 +9,7 @@
  70. #include <QObject>
  71. #include <Spix/TestServer.h>
  72. #include <memory>
  73. +#include "spix_export.h"
  74. namespace spix {
  75. @@ -25,7 +26,7 @@ class QtScene;
  76. * Usually it is enough to create one object of this type
  77. * in `main()` of your application to start processing tests.
  78. */
  79. -class QtQmlBot : public QObject {
  80. +class SPIX_EXPORT QtQmlBot : public QObject {
  81. Q_OBJECT
  82. public:
  83. --
  84. 2.31.1