aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-08-11 23:33:22 +0000
committerAlexander Neundorf <neundorf@kde.org>2008-08-11 23:33:22 +0000
commit989a8c1696b3f8a245ccafd3f90a805a1f283d37 (patch)
treea633c9ab361e8303b8859dbae38c51b622fc5b4f /modules
parent6402cc6a7ad14a3c37408dc0624eac8d5095fd52 (diff)
downloadextra-cmake-modules-989a8c1696b3f8a245ccafd3f90a805a1f283d37.tar.gz
extra-cmake-modules-989a8c1696b3f8a245ccafd3f90a805a1f283d37.tar.bz2
mostly revert patch from yesterday, since it doesn't seem to support 64bit yet
Alex svn path=/trunk/KDE/kdelibs/; revision=845536
Diffstat (limited to 'modules')
-rw-r--r--modules/FindAutomoc4.cmake39
1 files changed, 30 insertions, 9 deletions
diff --git a/modules/FindAutomoc4.cmake b/modules/FindAutomoc4.cmake
index fad02bef..03b0b23d 100644
--- a/modules/FindAutomoc4.cmake
+++ b/modules/FindAutomoc4.cmake
@@ -17,16 +17,37 @@
# 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
- find_package(Automoc4 QUIET NO_MODULE)
+# enable the code below again when cmake also searches in lib64/ (should be 2.6.2), Alex
+# # 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
+# find_package(Automoc4 QUIET NO_MODULE)
+# endif("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
+
+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
+ # 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 )
endif("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
+if(AUTOMOC4_CONFIG_FILE)
+ include(${AUTOMOC4_CONFIG_FILE})
+endif(AUTOMOC4_CONFIG_FILE)
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Automoc4 "Did not find automoc4 (part of kdesupport)." AUTOMOC4_EXECUTABLE)