diff options
author | Alexander Neundorf <neundorf@kde.org> | 2008-05-10 21:48:49 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2008-05-10 21:48:49 +0000 |
commit | e679996e1a351e33d29c532e7871f47d59a3a0e3 (patch) | |
tree | 23ca0670c88b01ce0eaa338a483e2045dd7dba1e /modules/FindAutomoc4.cmake | |
parent | d4366ab703662b705ad10840c5beef47dfe8297b (diff) | |
download | extra-cmake-modules-e679996e1a351e33d29c532e7871f47d59a3a0e3.tar.gz extra-cmake-modules-e679996e1a351e33d29c532e7871f47d59a3a0e3.tar.bz2 |
-use automoc4 from kdesupport if available, otherwise fallback to the one from kdelibs.
In a few weeks automoc4 from kdesupport will be required.
Alex
CCMAIL: kretz@kde.org
svn path=/trunk/KDE/kdelibs/; revision=806300
Diffstat (limited to 'modules/FindAutomoc4.cmake')
-rw-r--r-- | modules/FindAutomoc4.cmake | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/modules/FindAutomoc4.cmake b/modules/FindAutomoc4.cmake new file mode 100644 index 00000000..03a90974 --- /dev/null +++ b/modules/FindAutomoc4.cmake @@ -0,0 +1,52 @@ +# - Try to find automoc4 +# Once done this will define +# +# AUTOMOC4_FOUND - automoc4 has been found +# AUTOMOC4_EXECUTABLE - the automoc4 tool +# +# 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. + + +# Copyright (c) 2008, Alexander Neundorf, <neundorf@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 + set(AUTOMOC4_CONFIG_FILE "${KDESupport_SOURCE_DIR}/automoc/Automoc4Config.cmake") +else("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") + # when building this project outside kdesupport + find_file(AUTOMOC4_CONFIG_FILE NAMES Automoc4Config.cmake + PATH_SUFFIXES automoc4 lib/automoc4 lib64/automoc4 + PATHS ${CMAKE_SYSTEM_PREFIX_PATH} ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib + NO_DEFAULT_PATH ) +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) |