aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/KDE4Macros.cmake18
-rw-r--r--modules/kde4exportsheader.h.in12
2 files changed, 27 insertions, 3 deletions
diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake
index ed543621..af9c6f60 100644
--- a/modules/KDE4Macros.cmake
+++ b/modules/KDE4Macros.cmake
@@ -794,12 +794,24 @@ MACRO(KDE4_REMOVE_OBSOLETE_CMAKE_FILES)
ENDMACRO(KDE4_REMOVE_OBSOLETE_CMAKE_FILES)
+
MACRO(KDE4_NO_ENABLE_FINAL _project_name)
if(KDE4_ENABLE_FINAL)
- set(KDE4_ENABLE_FINAL OFF)
- REMOVE_DEFINITIONS(-DKDE_USE_FINAL)
- MESSAGE(STATUS "You used enable-final argument but \"${_project_name}\" doesn't support it. Try to fix compile it and remove KDE4_NO_ENABLE_FINAL macro. Thanks")
+ set(KDE4_ENABLE_FINAL OFF)
+ remove_definitions(-DKDE_USE_FINAL)
+ message(STATUS "You used enable-final argument but \"${_project_name}\" doesn't support it. Try to fix compile it and remove KDE4_NO_ENABLE_FINAL macro. Thanks")
endif(KDE4_ENABLE_FINAL)
ENDMACRO(KDE4_NO_ENABLE_FINAL _project_name)
+
+macro(KDE4_CREATE_EXPORTS_HEADER _outputFile _libName)
+ string(TOUPPER ${_libName} _libNameUpperCase)
+ # the next line is is required, because in CMake arguments to macros are not real
+ # variables, but handled differently. The next line create a real CMake variable,
+ # so configure_file() will replace it correctly.
+ set(_libName ${_libName})
+ # compared to write(FILE) configure_file() only really writes the file if the
+ # contents have changed. Otherwise we would have a lot of recompiles.
+ configure_file(${KDE4_MODULE_DIR}/kde4exportsheader.h.in ${_outputFile})
+endmacro(KDE4_CREATE_EXPORTS_HEADER _outputFile _libName)
diff --git a/modules/kde4exportsheader.h.in b/modules/kde4exportsheader.h.in
new file mode 100644
index 00000000..b9721864
--- /dev/null
+++ b/modules/kde4exportsheader.h.in
@@ -0,0 +1,12 @@
+/* This file is autogenerated by CMake via the macro KDE4_CREATE_EXPORTS_HEADER().
+ * Don't edit, changes will be lost.
+ */
+
+#include <kdemacros.h>
+#ifndef ${_libNameUpperCase}_EXPORT
+# ifdef ${_libName}_EXPORTS
+# define ${_libNameUpperCase}_EXPORT KDE_EXPORT
+# else
+# define ${_libNameUpperCase}_EXPORT KDE_IMPORT
+# endif
+#endif