aboutsummaryrefslogtreecommitdiff
path: root/modules/KDE4Macros.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-01-23 21:38:22 +0000
committerAlexander Neundorf <neundorf@kde.org>2007-01-23 21:38:22 +0000
commitf73f26c32e55dfce4f54cfa00291309afb3aab01 (patch)
tree9837d7f76a5b2cc933214a75f6b6eb41be5b277d /modules/KDE4Macros.cmake
parentb98d3424307be18ebc8b9b8a85b3271176fad6b6 (diff)
downloadextra-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
Diffstat (limited to 'modules/KDE4Macros.cmake')
-rw-r--r--modules/KDE4Macros.cmake18
1 files changed, 15 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)