From 189008ea5cca58ab76eab3c1c952544793839069 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 18 Sep 2013 11:45:52 -0400 Subject: Move cmake.m4 from Utilities to Auxiliary The latter fits more consistently with other third party integration files. --- Auxiliary/CMakeLists.txt | 1 + Auxiliary/cmake.m4 | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ Utilities/CMakeLists.txt | 1 - Utilities/cmake.m4 | 53 ------------------------------------------------ 4 files changed, 54 insertions(+), 54 deletions(-) create mode 100644 Auxiliary/cmake.m4 delete mode 100644 Utilities/cmake.m4 diff --git a/Auxiliary/CMakeLists.txt b/Auxiliary/CMakeLists.txt index 34090d2..c003b28 100644 --- a/Auxiliary/CMakeLists.txt +++ b/Auxiliary/CMakeLists.txt @@ -1,3 +1,4 @@ install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${CMAKE_DATA_DIR}/editors/vim) install(FILES cmake-mode.el DESTINATION ${CMAKE_DATA_DIR}/editors/emacs) +install(FILES cmake.m4 DESTINATION share/aclocal) add_subdirectory (bash-completion) diff --git a/Auxiliary/cmake.m4 b/Auxiliary/cmake.m4 new file mode 100644 index 0000000..a374a3b --- /dev/null +++ b/Auxiliary/cmake.m4 @@ -0,0 +1,53 @@ +dnl ============================================================================ +dnl CMake - Cross Platform Makefile Generator +dnl Copyright 2011 Matthias Kretz, kretz@kde.org +dnl +dnl Distributed under the OSI-approved BSD License (the "License"); +dnl see accompanying file Copyright.txt for details. +dnl +dnl This software is distributed WITHOUT ANY WARRANTY; without even the +dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +dnl See the License for more information. +dnl ============================================================================ + +AC_DEFUN([CMAKE_FIND_BINARY], +[AC_ARG_VAR([CMAKE_BINARY], [path to the cmake binary])dnl + +if test "x$ac_cv_env_CMAKE_BINARY_set" != "xset"; then + AC_PATH_TOOL([CMAKE_BINARY], [cmake])dnl +fi +])dnl + +# $1: package name +# $2: language (e.g. C/CXX/Fortran) +# $3: The compiler ID, defaults to GNU. +# Possible values are: GNU, Intel, Clang, SunPro, HP, XL, VisualAge, PGI, +# PathScale, Cray, SCO, MIPSpro, MSVC +# $4: optional extra arguments to cmake, e.g. "-DCMAKE_SIZEOF_VOID_P=8" +# $5: optional path to cmake binary +AC_DEFUN([CMAKE_FIND_PACKAGE], [ +AC_REQUIRE([CMAKE_FIND_BINARY])dnl + +AC_ARG_VAR([$1][_][$2][FLAGS], [$2 compiler flags for $1. This overrides the cmake output])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1. This overrides the cmake output])dnl + +failed=false +AC_MSG_CHECKING([for $1]) +if test -n "$1[]_$2[]FLAGS"; then + $1[]_$2[]FLAGS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=COMPILE $4` || failed=true +fi +if test -n "$1[]_LIBS"; then + $1[]_LIBS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=LINK $4` || failed=true +fi + +if $failed; then + unset $1[]_$2[]FLAGS + unset $1[]_LIBS + + AC_MSG_RESULT([no]) + $6 +else + AC_MSG_RESULT([yes]) + $5 +fi[]dnl +]) diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index 31807ee..89c4951 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -127,7 +127,6 @@ install(FILES ${DOCBOOK_FILES} DESTINATION ${CMAKE_DOC_DIR} ) -install(FILES cmake.m4 DESTINATION share/aclocal) # Drive documentation generation. add_custom_target(documentation ALL DEPENDS ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/cmake.txt ) diff --git a/Utilities/cmake.m4 b/Utilities/cmake.m4 deleted file mode 100644 index a374a3b..0000000 --- a/Utilities/cmake.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl ============================================================================ -dnl CMake - Cross Platform Makefile Generator -dnl Copyright 2011 Matthias Kretz, kretz@kde.org -dnl -dnl Distributed under the OSI-approved BSD License (the "License"); -dnl see accompanying file Copyright.txt for details. -dnl -dnl This software is distributed WITHOUT ANY WARRANTY; without even the -dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -dnl See the License for more information. -dnl ============================================================================ - -AC_DEFUN([CMAKE_FIND_BINARY], -[AC_ARG_VAR([CMAKE_BINARY], [path to the cmake binary])dnl - -if test "x$ac_cv_env_CMAKE_BINARY_set" != "xset"; then - AC_PATH_TOOL([CMAKE_BINARY], [cmake])dnl -fi -])dnl - -# $1: package name -# $2: language (e.g. C/CXX/Fortran) -# $3: The compiler ID, defaults to GNU. -# Possible values are: GNU, Intel, Clang, SunPro, HP, XL, VisualAge, PGI, -# PathScale, Cray, SCO, MIPSpro, MSVC -# $4: optional extra arguments to cmake, e.g. "-DCMAKE_SIZEOF_VOID_P=8" -# $5: optional path to cmake binary -AC_DEFUN([CMAKE_FIND_PACKAGE], [ -AC_REQUIRE([CMAKE_FIND_BINARY])dnl - -AC_ARG_VAR([$1][_][$2][FLAGS], [$2 compiler flags for $1. This overrides the cmake output])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1. This overrides the cmake output])dnl - -failed=false -AC_MSG_CHECKING([for $1]) -if test -n "$1[]_$2[]FLAGS"; then - $1[]_$2[]FLAGS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=COMPILE $4` || failed=true -fi -if test -n "$1[]_LIBS"; then - $1[]_LIBS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=LINK $4` || failed=true -fi - -if $failed; then - unset $1[]_$2[]FLAGS - unset $1[]_LIBS - - AC_MSG_RESULT([no]) - $6 -else - AC_MSG_RESULT([yes]) - $5 -fi[]dnl -]) -- cgit v0.12