[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bphonon=5D_cmake=3A_import_more_recent_findAutomoc4_?=
From:       Harald Sitter <sitter () kde ! org>
Date:       2011-02-28 21:20:11
Message-ID: 20110228212011.BC457A60C9 () git ! kde ! org
[Download RAW message or body]

Git commit b1f4766e6d39b8099c6c28255acdf21a3ad3f5ef by Harald Sitter.
Committed on 28/02/2011 at 22:19.
Pushed by sitter into branch 'master'.

import more recent findAutomoc4 from kdelibs

This should make building on windows less of a PITA

M  +8    -33   cmake/FindAutomoc4.cmake     

http://commits.kde.org/phonon/b1f4766e6d39b8099c6c28255acdf21a3ad3f5ef

diff --git a/cmake/FindAutomoc4.cmake b/cmake/FindAutomoc4.cmake
index 86baf8d..e08ae80 100644
--- a/cmake/FindAutomoc4.cmake
+++ b/cmake/FindAutomoc4.cmake
@@ -42,40 +42,15 @@
 # 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
-   set(AUTOMOC4_CONFIG_FILE "${KDESupport_SOURCE_DIR}/automoc/Automoc4Config.cmake")
+   include("${KDESupport_SOURCE_DIR}/automoc/Automoc4Config.cmake")
 else("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
    # when building this project outside kdesupport
-
-   # CMAKE_[SYSTEM_]PREFIX_PATH exists starting with cmake 2.6.0
-   file(TO_CMAKE_PATH "$ENV{CMAKE_PREFIX_PATH}" _env_CMAKE_PREFIX_PATH)
-   file(TO_CMAKE_PATH "$ENV{CMAKE_LIBRARY_PATH}" _env_CMAKE_LIBRARY_PATH)
-
-   find_file(AUTOMOC4_CONFIG_FILE NAMES Automoc4Config.cmake 
-             PATH_SUFFIXES automoc4 lib/automoc4 lib64/automoc4
-             PATHS ${_env_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH} \
                ${CMAKE_SYSTEM_PREFIX_PATH} 
-                   ${_env_CMAKE_LIBRARY_PATH} ${CMAKE_LIBRARY_PATH} \
                ${CMAKE_SYSTEM_LIBRARY_PATH}
-                   ${CMAKE_INSTALL_PREFIX}
-             NO_DEFAULT_PATH )
+   # 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}")
 
-
-if(AUTOMOC4_CONFIG_FILE)
-   include(${AUTOMOC4_CONFIG_FILE})
-   set(AUTOMOC4_FOUND TRUE)
-else(AUTOMOC4_CONFIG_FILE)
-   set(AUTOMOC4_FOUND FALSE)
-endif(AUTOMOC4_CONFIG_FILE)
-
-if (AUTOMOC4_FOUND)
-   if (NOT Automoc4_FIND_QUIETLY)
-      message(STATUS "Found Automoc4: ${AUTOMOC4_EXECUTABLE}")
-   endif (NOT Automoc4_FIND_QUIETLY)
-else (AUTOMOC4_FOUND)
-   if (Automoc4_FIND_REQUIRED)
-      message(FATAL_ERROR "Did not find automoc4 (part of kdesupport).")
-   else (Automoc4_FIND_REQUIRED)
-      if (NOT Automoc4_FIND_QUIETLY)
-         message(STATUS "Did not find automoc4 (part of kdesupport).")
-      endif (NOT Automoc4_FIND_QUIETLY)
-   endif (Automoc4_FIND_REQUIRED)
-endif (AUTOMOC4_FOUND)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Automoc4 "Did not find automoc4 \
(Automoc4Config.cmake, part of kdesupport)." AUTOMOC4_EXECUTABLE)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic