diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-01-23 21:38:22 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-01-23 21:38:22 +0000 |
commit | f73f26c32e55dfce4f54cfa00291309afb3aab01 (patch) | |
tree | 9837d7f76a5b2cc933214a75f6b6eb41be5b277d | |
parent | b98d3424307be18ebc8b9b8a85b3271176fad6b6 (diff) | |
download | extra-cmake-modules-f73f26c32e55dfce4f54cfa00291309afb3aab01.tar.gz extra-cmake-modules-f73f26c32e55dfce4f54cfa00291309afb3aab01.tar.bz2 |
add a macro KDE4_CREATE_EXPORTS_HEADER(fileName libName)
which should create an exports header for the given lib
This happen via configure_file() from the template file kde4exportsheader.h.in
Is this ok this way ?
Please let me know.
Alex
CCMAIL: kde-buildsystem@kde.org
svn path=/trunk/KDE/kdelibs/; revision=626609
-rw-r--r-- | modules/KDE4Macros.cmake | 18 | ||||
-rw-r--r-- | modules/kde4exportsheader.h.in | 12 |
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 |