Rex Dieter 29094f2
From 086dd2b06c18d3935ffb87b286e548c375580fba Mon Sep 17 00:00:00 2001
Rex Dieter 29094f2
From: Alexander Neundorf <neundorf@kde.org>
Rex Dieter 29094f2
Date: Wed, 23 Jun 2010 21:09:24 +0000
Rex Dieter 29094f2
Subject: [PATCH 24/33] -add cmake_policy(PUSH|POP) to save and restore the
Rex Dieter 29094f2
 original cmake policy settings -add the cmake_minimum_required(VERSION 2.6.4
Rex Dieter 29094f2
 FATAL_ERROR) back, since this is indeed required
Rex Dieter 29094f2
Rex Dieter 29094f2
Alex
Rex Dieter 29094f2
Rex Dieter 29094f2
Rex Dieter 29094f2
svn path=/trunk/kdesupport/automoc/; revision=1141941
Rex Dieter 29094f2
---
Rex Dieter 29094f2
 Automoc4Config.cmake | 22 ++++++++++++++++++++++
Rex Dieter 29094f2
 1 file changed, 22 insertions(+)
Rex Dieter 29094f2
Rex Dieter 29094f2
diff --git a/Automoc4Config.cmake b/Automoc4Config.cmake
Rex Dieter 29094f2
index 2d2d9d2..679a77c 100644
Rex Dieter 29094f2
--- a/Automoc4Config.cmake
Rex Dieter 29094f2
+++ b/Automoc4Config.cmake
Rex Dieter 29094f2
@@ -48,6 +48,16 @@
Rex Dieter 29094f2
 #     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
Rex Dieter 29094f2
 #     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Rex Dieter 29094f2
 
Rex Dieter 29094f2
+# push the current cmake policy settings on the policy stack and pop them again at the
Rex Dieter 29094f2
+# end of this file, so any policies which are changed in this file don't affect anything
Rex Dieter 29094f2
+# on the outside (cmake_minimum_required() sets all policies to NEW for version 2.6.4). Alex
Rex Dieter 29094f2
+if(COMMAND cmake_policy)
Rex Dieter 29094f2
+  cmake_policy(PUSH)
Rex Dieter 29094f2
+endif(COMMAND cmake_policy)
Rex Dieter 29094f2
+
Rex Dieter 29094f2
+# 2.6.4 is required because of the get_filename_component(REALPATH)
Rex Dieter 29094f2
+cmake_minimum_required( VERSION 2.6.4 FATAL_ERROR )
Rex Dieter 29094f2
+
Rex Dieter 29094f2
 
Rex Dieter 29094f2
 get_filename_component(_AUTOMOC4_CURRENT_DIR  "${CMAKE_CURRENT_LIST_FILE}" PATH)
Rex Dieter 29094f2
 
Rex Dieter 29094f2
@@ -62,6 +72,9 @@ if(EXISTS ${_AUTOMOC4_CURRENT_DIR}/kde4automoc.cpp)
Rex Dieter 29094f2
 else(EXISTS ${_AUTOMOC4_CURRENT_DIR}/kde4automoc.cpp)
Rex Dieter 29094f2
    get_filename_component(_AUTOMOC4_BIN_DIR  "${_AUTOMOC4_CURRENT_DIR}" PATH)
Rex Dieter 29094f2
    get_filename_component(_AUTOMOC4_BIN_DIR  "${_AUTOMOC4_BIN_DIR}" PATH)
Rex Dieter 29094f2
+
Rex Dieter 29094f2
+   # This REALPATH here is necessary for the case that the path is a "virtual" drive 
Rex Dieter 29094f2
+   # created using "subst", in this case otherwise the drive letter is missing:
Rex Dieter 29094f2
    if(WIN32)
Rex Dieter 29094f2
       get_filename_component(_AUTOMOC4_BIN_DIR  "${_AUTOMOC4_BIN_DIR}" REALPATH)
Rex Dieter 29094f2
    endif(WIN32)
Rex Dieter 29094f2
@@ -139,6 +152,7 @@ macro(AUTOMOC4 _target_NAME _SRCS)
Rex Dieter 29094f2
    endif(_moc_files)
Rex Dieter 29094f2
 endmacro(AUTOMOC4)
Rex Dieter 29094f2
 
Rex Dieter 29094f2
+
Rex Dieter 29094f2
 macro(_ADD_AUTOMOC4_TARGET _target_NAME _SRCS)
Rex Dieter 29094f2
    set(_moc_files)
Rex Dieter 29094f2
    set(_moc_headers)
Rex Dieter 29094f2
@@ -208,6 +222,7 @@ macro(_ADD_AUTOMOC4_TARGET _target_NAME _SRCS)
Rex Dieter 29094f2
    endif(_moc_files)
Rex Dieter 29094f2
 endmacro(_ADD_AUTOMOC4_TARGET)
Rex Dieter 29094f2
 
Rex Dieter 29094f2
+
Rex Dieter 29094f2
 macro(AUTOMOC4_ADD_EXECUTABLE _target_NAME)
Rex Dieter 29094f2
    set(_SRCS ${ARGN})
Rex Dieter 29094f2
 
Rex Dieter 29094f2
@@ -226,6 +241,7 @@ macro(AUTOMOC4_ADD_EXECUTABLE _target_NAME)
Rex Dieter 29094f2
 
Rex Dieter 29094f2
 endmacro(AUTOMOC4_ADD_EXECUTABLE)
Rex Dieter 29094f2
 
Rex Dieter 29094f2
+
Rex Dieter 29094f2
 macro(AUTOMOC4_ADD_LIBRARY _target_NAME)
Rex Dieter 29094f2
    set(_SRCS ${ARGN})
Rex Dieter 29094f2
 
Rex Dieter 29094f2
@@ -252,3 +268,9 @@ endmacro(_AUTOMOC4_KDE4_PRE_TARGET_HANDLING)
Rex Dieter 29094f2
 macro(_AUTOMOC4_KDE4_POST_TARGET_HANDLING _target)
Rex Dieter 29094f2
    add_dependencies(${_target} "${_target}_automoc")
Rex Dieter 29094f2
 endmacro(_AUTOMOC4_KDE4_POST_TARGET_HANDLING)
Rex Dieter 29094f2
+
Rex Dieter 29094f2
+
Rex Dieter 29094f2
+# restore previous policy settings:
Rex Dieter 29094f2
+if(COMMAND cmake_policy)
Rex Dieter 29094f2
+  cmake_policy(POP)
Rex Dieter 29094f2
+endif(COMMAND cmake_policy)
Rex Dieter 29094f2
-- 
Rex Dieter 29094f2
2.4.3
Rex Dieter 29094f2