[PATCH 3/9] Always use cmake's internal automoc support.

Jon Severinsson jon at severinsson.net
Sat Oct 6 18:15:45 UTC 2012


This increases the required cmake version to 2.8.6.
---
 CMakeLists.txt                      |    2 +-
 cmake/CMakeLists.txt                |    1 -
 cmake/FindAutomoc4.cmake            |   56 -----------------------------------
 cmake/FindPhononInternal.cmake      |   31 ++++++-------------
 demos/metadatareader/CMakeLists.txt |    2 +-
 demos/phota/CMakeLists.txt          |    2 +-
 demos/simplecapture/CMakeLists.txt  |    2 +-
 demos/simpleplayer/CMakeLists.txt   |    2 +-
 8 filer ändrade, 14 tillägg(+), 84 borttagningar(-)
 delete mode 100644 cmake/FindAutomoc4.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2cb6db5..ed09836 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
 project(Phonon)
 
-cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR)
 
 # CMP0002: we have multiple targets with the same name for the unit tests
 cmake_policy(SET CMP0002 OLD)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 4a3886c..7574b42 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -1,6 +1,5 @@
 install(FILES cmake_uninstall.cmake.in
               COPYING-CMAKE-SCRIPTS
-              FindAutomoc4.cmake
               FindPackageHandleStandardArgs.cmake
               FindPhononInternal.cmake
               PhononMacros.cmake
diff --git a/cmake/FindAutomoc4.cmake b/cmake/FindAutomoc4.cmake
deleted file mode 100644
index e08ae80..0000000
--- a/cmake/FindAutomoc4.cmake
+++ /dev/null
@@ -1,56 +0,0 @@
-# - Try to find automoc4
-# Once done this will define
-#
-#  AUTOMOC4_FOUND - automoc4 has been found
-#  AUTOMOC4_EXECUTABLE - the automoc4 tool
-#  AUTOMOC4_VERSION - the full version of automoc4
-#  AUTOMOC4_VERSION_MAJOR, AUTOMOC4_VERSION_MINOR, AUTOMOC4_VERSION_PATCH - AUTOMOC4_VERSION 
-#                     broken into its components
-#
-# It also adds the following macros
-#  AUTOMOC4(<target> <SRCS_VAR>)
-#    Use this to run automoc4 on all files contained in the list <SRCS_VAR>.
-#
-#  AUTOMOC4_MOC_HEADERS(<target> header1.h header2.h ...)
-#    Use this to add more header files to be processed with automoc4.
-#
-#  AUTOMOC4_ADD_EXECUTABLE(<target_NAME> src1 src2 ...)
-#    This macro does the same as ADD_EXECUTABLE, but additionally
-#    adds automoc4 handling for all source files.
-#
-# AUTOMOC4_ADD_LIBRARY(<target_NAME> src1 src2 ...)
-#    This macro does the same as ADD_LIBRARY, but additionally
-#    adds automoc4 handling for all source files.
-
-# Internal helper macro, may change or be removed anytime:
-# _ADD_AUTOMOC4_TARGET(<target_NAME> <SRCS_VAR>)
-#
-# Since version 0.9.88:
-# The following two macros are only to be used for KDE4 projects
-# and do something which makes sure automoc4 works for KDE. Don't
-# use them anywhere else.
-# _AUTOMOC4_KDE4_PRE_TARGET_HANDLING(<target_NAME> <SRCS_VAR>)
-# _AUTOMOC4_KDE4_POST_TARGET_HANDLING(<target_NAME>)
-
-
-# Copyright (c) 2008-2009, Alexander Neundorf, <neundorf at kde.org>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-
-# check if we are inside KDESupport and automoc is enabled
-if("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
-   # when building this project as part of kdesupport
-   include("${KDESupport_SOURCE_DIR}/automoc/Automoc4Config.cmake")
-else("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
-   # when building this project outside kdesupport
-   # use the new "config-mode" of cmake 2.6, which searches the installed Automoc4Config.cmake file
-   # see the man page for details
-   set(_Automoc4_FIND_QUIETLY ${Automoc4_FIND_QUIETLY})
-   find_package(Automoc4 QUIET NO_MODULE)
-   set(Automoc4_FIND_QUIETLY ${_Automoc4_FIND_QUIETLY})
-endif("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Automoc4 "Did not find automoc4 (Automoc4Config.cmake, part of kdesupport)." AUTOMOC4_EXECUTABLE)
diff --git a/cmake/FindPhononInternal.cmake b/cmake/FindPhononInternal.cmake
index 1d472e4..413da3c 100644
--- a/cmake/FindPhononInternal.cmake
+++ b/cmake/FindPhononInternal.cmake
@@ -69,28 +69,15 @@ find_package(Qt4 ${_REQ_STRING_KDE4})
 
 # - Automoc
 
-# Starting with CMake 2.8.6 there is a builtin to replace automoc4, use that when possible.
-if(CMAKE_VERSION VERSION_GREATER 2.8.5)
-    message(STATUS "Using CMake automoc builtin")
-    set(CMAKE_AUTOMOC TRUE)
-    # Compatiblity Macros
-    macro(AUTOMOC4_ADD_EXECUTABLE _target_NAME)
-        add_executable(${_target_NAME} ${ARGN})
-    endmacro(AUTOMOC4_ADD_EXECUTABLE _target_NAME)
-    macro(AUTOMOC4_ADD_LIBRARY _target_NAME _add_executable_param)
-        add_library(${_target_NAME} ${_add_executable_param} ${ARGN})
-    endmacro(AUTOMOC4_ADD_LIBRARY)
-else(CMAKE_VERSION VERSION_GREATER 2.8.5)
-    message(STATUS "Can not use CMake automoc builtin, trying to find automoc4")
-    find_package(Automoc4 REQUIRED)
-    if (NOT AUTOMOC4_VERSION)
-        set(AUTOMOC4_VERSION "0.9.83")
-    endif (NOT AUTOMOC4_VERSION)
-    macro_ensure_version("0.9.86" "${AUTOMOC4_VERSION}" _automoc4_version_ok)
-    if (NOT _automoc4_version_ok)
-        message(FATAL_ERROR "Your version of automoc4 is too old. You have ${AUTOMOC4_VERSION}, you need at least 0.9.86")
-    endif (NOT _automoc4_version_ok)
-endif(CMAKE_VERSION VERSION_GREATER 2.8.5)
+message(STATUS "Using CMake automoc builtin")
+set(CMAKE_AUTOMOC TRUE)
+# Compatiblity Macros
+macro(AUTOMOC4_ADD_EXECUTABLE _target_NAME)
+    add_executable(${_target_NAME} ${ARGN})
+endmacro(AUTOMOC4_ADD_EXECUTABLE _target_NAME)
+macro(AUTOMOC4_ADD_LIBRARY _target_NAME _add_executable_param)
+    add_library(${_target_NAME} ${_add_executable_param} ${ARGN})
+endmacro(AUTOMOC4_ADD_LIBRARY)
 
 # restore the original CMAKE_MODULE_PATH
 set(CMAKE_MODULE_PATH ${_phonon_cmake_module_path_back})
diff --git a/demos/metadatareader/CMakeLists.txt b/demos/metadatareader/CMakeLists.txt
index 0410a1c..397c1d6 100644
--- a/demos/metadatareader/CMakeLists.txt
+++ b/demos/metadatareader/CMakeLists.txt
@@ -1,5 +1,5 @@
 project(metadatareader)
-cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR)
 
 find_package(Qt4 COMPONENTS QtCore REQUIRED)
 include(${QT_USE_FILE})
diff --git a/demos/phota/CMakeLists.txt b/demos/phota/CMakeLists.txt
index b37b4ad..09594d7 100644
--- a/demos/phota/CMakeLists.txt
+++ b/demos/phota/CMakeLists.txt
@@ -1,5 +1,5 @@
 project(phota)
-cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR)
 
 find_package(Qt4 REQUIRED)
 include(${QT_USE_FILE})
diff --git a/demos/simplecapture/CMakeLists.txt b/demos/simplecapture/CMakeLists.txt
index c13715d..28b9564 100644
--- a/demos/simplecapture/CMakeLists.txt
+++ b/demos/simplecapture/CMakeLists.txt
@@ -1,5 +1,5 @@
 project(simplecapture)
-cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR)
 
 find_package(Qt4 REQUIRED)
 include(${QT_USE_FILE})
diff --git a/demos/simpleplayer/CMakeLists.txt b/demos/simpleplayer/CMakeLists.txt
index e97bfd3..c60ddc9 100644
--- a/demos/simpleplayer/CMakeLists.txt
+++ b/demos/simpleplayer/CMakeLists.txt
@@ -1,5 +1,5 @@
 project(simpleplayer)
-cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR)
 
 find_package(Qt4 REQUIRED)
 include(${QT_USE_FILE})
-- 
1.7.10.4



More information about the Kde-frameworks-devel mailing list