summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-04-12 18:00:27 +0200
committerSébastien Helleu <flashcode@flashtux.org>2014-04-12 18:00:27 +0200
commit7618fdd240e32292b2202c76550c67f09ee0d90e (patch)
treefac0d0f452c6e6ead98db6ce107e36eeb5f95b09 /cmake
parent51d18c92e54b58c2a612ef765f7802226e62ba42 (diff)
downloadweechat-7618fdd240e32292b2202c76550c67f09ee0d90e.zip
core: use lower case for CMake keywords
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindAsciidoc.cmake24
-rw-r--r--cmake/FindAspell.cmake26
-rw-r--r--cmake/FindENCHANT.cmake10
-rw-r--r--cmake/FindGCRYPT.cmake26
-rw-r--r--cmake/FindGettext.cmake57
-rw-r--r--cmake/FindGnuTLS.cmake32
-rw-r--r--cmake/FindGuile.cmake12
-rw-r--r--cmake/FindIconv.cmake49
-rw-r--r--cmake/FindLua.cmake50
-rw-r--r--cmake/FindNcurses.cmake34
-rw-r--r--cmake/FindPerl.cmake37
-rw-r--r--cmake/FindPython.cmake58
-rw-r--r--cmake/FindRuby.cmake68
-rw-r--r--cmake/FindSourcehighlight.cmake16
-rw-r--r--cmake/FindTCL.cmake79
-rw-r--r--cmake/FindZLIB.cmake67
-rw-r--r--cmake/cmake_uninstall.cmake.in36
17 files changed, 329 insertions, 352 deletions
diff --git a/cmake/FindAsciidoc.cmake b/cmake/FindAsciidoc.cmake
index d68c84abe..5b40a2387 100644
--- a/cmake/FindAsciidoc.cmake
+++ b/cmake/FindAsciidoc.cmake
@@ -20,32 +20,32 @@
# - Find Asciidoc
# This module finds if asciidoc (version 8 or newer) is installed.
-IF (ASCIIDOC_FOUND)
+if(ASCIIDOC_FOUND)
# Already in cache, be silent
- SET(ASCIIDOC_FIND_QUIETLY TRUE)
-ENDIF (ASCIIDOC_FOUND)
+ set(ASCIIDOC_FIND_QUIETLY TRUE)
+endif()
-FIND_PROGRAM(
+find_program(
ASCIIDOC_EXECUTABLE asciidoc
PATHS /bin /usr/bin /usr/local/bin /usr/pkg/bin
)
-FIND_PROGRAM(
+find_program(
A2X_EXECUTABLE a2x
PATHS /bin /usr/bin /usr/local/bin /usr/pkg/bin
)
-IF(ASCIIDOC_EXECUTABLE AND A2X_EXECUTABLE)
- EXECUTE_PROCESS(
+if(ASCIIDOC_EXECUTABLE AND A2X_EXECUTABLE)
+ execute_process(
COMMAND ${ASCIIDOC_EXECUTABLE} --version
OUTPUT_VARIABLE ASCIIDOC_VERSION
)
- IF(${ASCIIDOC_VERSION} MATCHES "asciidoc 8.*")
- SET(ASCIIDOC_FOUND TRUE)
- ENDIF(${ASCIIDOC_VERSION} MATCHES "asciidoc 8.*")
+ if(${ASCIIDOC_VERSION} MATCHES "asciidoc 8.*")
+ set(ASCIIDOC_FOUND TRUE)
+ endif()
- MARK_AS_ADVANCED(
+ mark_as_advanced(
ASCIIDOC_EXECUTABLE
)
-ENDIF(ASCIIDOC_EXECUTABLE AND A2X_EXECUTABLE)
+endif()
diff --git a/cmake/FindAspell.cmake b/cmake/FindAspell.cmake
index b53c8cfd2..b70d9816d 100644
--- a/cmake/FindAspell.cmake
+++ b/cmake/FindAspell.cmake
@@ -26,31 +26,31 @@
# ASPELL_INCLUDE_PATH = path to where aspell.h can be found
# ASPELL_LIBRARY = path to where libaspell.so* can be found
-IF (ASPELL_FOUND)
+if(ASPELL_FOUND)
# Already in cache, be silent
SET(ASPELL_FIND_QUIETLY TRUE)
-ENDIF (ASPELL_FOUND)
+endif()
-FIND_PATH(ASPELL_INCLUDE_PATH
+find_path(ASPELL_INCLUDE_PATH
NAMES aspell.h
PATHS /usr/include /usr/local/include /usr/pkg/include
)
-FIND_LIBRARY(ASPELL_LIBRARY
+find_library(ASPELL_LIBRARY
NAMES aspell aspell-15
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
)
-IF (ASPELL_INCLUDE_PATH AND ASPELL_LIBRARY)
- SET(CMAKE_REQUIRED_INCLUDES ${ASPELL_INCLUDE_PATH})
- SET(CMAKE_REQUIRED_LIBRARIES ${ASPELL_LIBRARY})
- CHECK_SYMBOL_EXISTS(aspell_version_string "aspell.h" HAVE_ASPELL_VERSION_STRING)
- SET(CMAKE_REQUIRED_INCLUDES)
- SET(CMAKE_REQUIRED_LIBRARIES)
- SET(ASPELL_FOUND TRUE)
-ENDIF (ASPELL_INCLUDE_PATH AND ASPELL_LIBRARY)
+if(ASPELL_INCLUDE_PATH AND ASPELL_LIBRARY)
+ set(CMAKE_REQUIRED_INCLUDES ${ASPELL_INCLUDE_PATH})
+ set(CMAKE_REQUIRED_LIBRARIES ${ASPELL_LIBRARY})
+ check_symbol_exists(aspell_version_string "aspell.h" HAVE_ASPELL_VERSION_STRING)
+ set(CMAKE_REQUIRED_INCLUDES)
+ set(CMAKE_REQUIRED_LIBRARIES)
+ set(ASPELL_FOUND TRUE)
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
ASPELL_INCLUDE_PATH
ASPELL_LIBRARY
)
diff --git a/cmake/FindENCHANT.cmake b/cmake/FindENCHANT.cmake
index d1e77dda9..e74695fc0 100644
--- a/cmake/FindENCHANT.cmake
+++ b/cmake/FindENCHANT.cmake
@@ -12,19 +12,19 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-if (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
# in cache already
set(ENCHANT_FOUND TRUE)
-else (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
- if (NOT WIN32)
+else()
+ if(NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PC_ENCHANT enchant)
set(ENCHANT_DEFINITIONS ${PC_ENCHANT_CFLAGS_OTHER})
- endif (NOT WIN32)
+ endif()
find_path(ENCHANT_INCLUDE_DIR
NAMES enchant++.h
@@ -41,4 +41,4 @@ else (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
mark_as_advanced(ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES)
-endif (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+endif()
diff --git a/cmake/FindGCRYPT.cmake b/cmake/FindGCRYPT.cmake
index ca50dc57a..a8e047b6d 100644
--- a/cmake/FindGCRYPT.cmake
+++ b/cmake/FindGCRYPT.cmake
@@ -27,27 +27,27 @@
# GCRYPT_LDFLAGS = ldflags to use to compile
#
-FIND_PROGRAM(LIBGCRYPT_CONFIG_EXECUTABLE NAMES libgcrypt-config)
+find_program(LIBGCRYPT_CONFIG_EXECUTABLE NAMES libgcrypt-config)
set(GCRYPT_LDFLAGS)
set(GCRYPT_CFLAGS)
-IF(LIBGCRYPT_CONFIG_EXECUTABLE)
+if(LIBGCRYPT_CONFIG_EXECUTABLE)
- EXEC_PROGRAM(${LIBGCRYPT_CONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GCRYPT_LDFLAGS)
- EXEC_PROGRAM(${LIBGCRYPT_CONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GCRYPT_CFLAGS)
+ exec_program(${LIBGCRYPT_CONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GCRYPT_LDFLAGS)
+ exec_program(${LIBGCRYPT_CONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GCRYPT_CFLAGS)
- IF(${GCRYPT_CFLAGS} MATCHES "\n")
- SET(GCRYPT_CFLAGS " ")
- ENDIF(${GCRYPT_CFLAGS} MATCHES "\n")
+ if(${GCRYPT_CFLAGS} MATCHES "\n")
+ set(GCRYPT_CFLAGS " ")
+ endif()
-ENDIF(LIBGCRYPT_CONFIG_EXECUTABLE)
+endif()
# handle the QUIETLY and REQUIRED arguments and set GCRYPT_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_HOME_DIRECTORY}/cmake/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GCRYPT REQUIRED_VARS GCRYPT_LDFLAGS GCRYPT_CFLAGS)
+include(${CMAKE_HOME_DIRECTORY}/cmake/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(GCRYPT REQUIRED_VARS GCRYPT_LDFLAGS GCRYPT_CFLAGS)
-IF(GCRYPT_FOUND)
- MARK_AS_ADVANCED(GCRYPT_CFLAGS GCRYPT_LDFLAGS)
-ENDIF(GCRYPT_FOUND)
+if(GCRYPT_FOUND)
+ mark_as_advanced(GCRYPT_CFLAGS GCRYPT_LDFLAGS)
+endif()
diff --git a/cmake/FindGettext.cmake b/cmake/FindGettext.cmake
index 255e40415..2484dc622 100644
--- a/cmake/FindGettext.cmake
+++ b/cmake/FindGettext.cmake
@@ -27,46 +27,45 @@
#
# GETTEXT_FOUND = is gettext usable on system?
-IF(GETTEXT_FOUND)
+if(GETTEXT_FOUND)
# Already in cache, be silent
- SET(GETTEXT_FIND_QUIETLY TRUE)
-ENDIF(GETTEXT_FOUND)
+ set(GETTEXT_FIND_QUIETLY TRUE)
+endif()
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckFunctionExists)
+include(CheckIncludeFiles)
+include(CheckLibraryExists)
+include(CheckFunctionExists)
-FIND_PATH(LIBINTL_INCLUDE
+find_path(LIBINTL_INCLUDE
NAMES libintl.h
PATH /usr/local/include /usr/pkg/include /usr/include
)
-SET(CMAKE_REQUIRED_INCLUDES ${LIBINTL_INCLUDE})
+set(CMAKE_REQUIRED_INCLUDES ${LIBINTL_INCLUDE})
-CHECK_INCLUDE_FILES(libintl.h HAVE_LIBINTL_H)
+check_include_files(libintl.h HAVE_LIBINTL_H)
-IF(HAVE_LIBINTL_H)
-
- CHECK_FUNCTION_EXISTS(dgettext LIBC_HAS_DGETTEXT)
- IF(LIBC_HAS_DGETTEXT)
- SET(GETTEXT_FOUND TRUE)
- ELSE(LIBC_HAS_DGETTEXT)
- FIND_LIBRARY(LIBINTL_LIBRARY NAMES intl
+if(HAVE_LIBINTL_H)
+ check_function_exists(dgettext LIBC_HAS_DGETTEXT)
+ if(LIBC_HAS_DGETTEXT)
+ set(GETTEXT_FOUND TRUE)
+ else()
+ find_library(LIBINTL_LIBRARY NAMES intl
PATHS
/usr/local/lib
/usr/lib
)
- IF(LIBINTL_LIBRARY)
- IF(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
- SET(CMAKE_REQUIRED_LIBRARIES "iconv")
- CHECK_LIBRARY_EXISTS(${LIBINTL_LIBRARY} "libintl_dgettext" "" LIBINTL_HAS_DGETTEXT)
- ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
- CHECK_LIBRARY_EXISTS(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT)
- ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+ if(LIBINTL_LIBRARY)
+ if(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+ set(CMAKE_REQUIRED_LIBRARIES "iconv")
+ check_library_exists(${LIBINTL_LIBRARY} "libintl_dgettext" "" LIBINTL_HAS_DGETTEXT)
+ else()
+ check_library_exists(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT)
+ endif()
- IF(LIBINTL_HAS_DGETTEXT)
- SET(GETTEXT_FOUND TRUE)
- ENDIF(LIBINTL_HAS_DGETTEXT)
- ENDIF(LIBINTL_LIBRARY)
- ENDIF(LIBC_HAS_DGETTEXT)
-ENDIF(HAVE_LIBINTL_H)
+ if(LIBINTL_HAS_DGETTEXT)
+ set(GETTEXT_FOUND TRUE)
+ endif()
+ endif()
+ endif()
+endif()
diff --git a/cmake/FindGnuTLS.cmake b/cmake/FindGnuTLS.cmake
index b9e423351..1fc4360e1 100644
--- a/cmake/FindGnuTLS.cmake
+++ b/cmake/FindGnuTLS.cmake
@@ -29,45 +29,45 @@
# GNUTLS_CFLAGS = cflags to use to compile
# GNUTLS_LDFLAGS = ldflags to use to compile
-IF(GNUTLS_INCLUDE_PATH AND GNUTLS_LIBRARY)
+if(GNUTLS_INCLUDE_PATH AND GNUTLS_LIBRARY)
# Already in cache, be silent
set(GNUTLS_FIND_QUIETLY TRUE)
-ENDIF(GNUTLS_INCLUDE_PATH AND GNUTLS_LIBRARY)
+endif()
-FIND_PROGRAM(PKG_CONFIG_EXECUTABLE NAMES pkg-config)
+find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config)
-EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix gnutls
+execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix gnutls
OUTPUT_VARIABLE GNUTLS_PREFIX
)
-EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --cflags gnutls
+execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --cflags gnutls
OUTPUT_VARIABLE GNUTLS_CFLAGS
)
-STRING(REGEX REPLACE "[\r\n]" "" GNUTLS_CFLAGS "${GNUTLS_CFLAGS}")
+string(REGEX REPLACE "[\r\n]" "" GNUTLS_CFLAGS "${GNUTLS_CFLAGS}")
-EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --libs gnutls
+execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --libs gnutls
OUTPUT_VARIABLE GNUTLS_LDFLAGS
)
-STRING(REGEX REPLACE "[\r\n]" "" GNUTLS_LDFLAGS "${GNUTLS_LDFLAGS}")
+string(REGEX REPLACE "[\r\n]" "" GNUTLS_LDFLAGS "${GNUTLS_LDFLAGS}")
-SET(GNUTLS_POSSIBLE_INCLUDE_PATH "${GNUTLS_PREFIX}/include")
-SET(GNUTLS_POSSIBLE_LIB_DIR "${GNUTLS_PREFIX}/lib")
+set(GNUTLS_POSSIBLE_INCLUDE_PATH "${GNUTLS_PREFIX}/include")
+set(GNUTLS_POSSIBLE_LIB_DIR "${GNUTLS_PREFIX}/lib")
-FIND_PATH(GNUTLS_INCLUDE_PATH
+find_path(GNUTLS_INCLUDE_PATH
NAMES gnutls/gnutls.h
PATHS GNUTLS_POSSIBLE_INCLUDE_PATH
)
-FIND_LIBRARY(GNUTLS_LIBRARY
+find_library(GNUTLS_LIBRARY
NAMES gnutls
PATHS GNUTLS_POSSIBLE_LIB_DIR
)
-IF (GNUTLS_INCLUDE_PATH AND GNUTLS_LIBRARY)
- SET(GNUTLS_FOUND TRUE)
-ENDIF (GNUTLS_INCLUDE_PATH AND GNUTLS_LIBRARY)
+if(GNUTLS_INCLUDE_PATH AND GNUTLS_LIBRARY)
+ set(GNUTLS_FOUND TRUE)
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
GNUTLS_INCLUDE_PATH
GNUTLS_LIBRARY
GNUTLS_CFLAGS
diff --git a/cmake/FindGuile.cmake b/cmake/FindGuile.cmake
index e6be56563..69e3ab011 100644
--- a/cmake/FindGuile.cmake
+++ b/cmake/FindGuile.cmake
@@ -26,12 +26,12 @@
# GUILE_INCLUDE_DIRS = Guile include directory
# GUILE_LIBRARIES = Link options to compile Guile
-IF(GUILE_FOUND)
+if(GUILE_FOUND)
# Already in cache, be silent
- SET(GUILE_FIND_QUIETLY TRUE)
-ENDIF(GUILE_FOUND)
+ set(GUILE_FIND_QUIETLY TRUE)
+endif()
-FIND_PACKAGE(PkgConfig)
-IF(PKG_CONFIG_FOUND)
+find_package(PkgConfig)
+if(PKG_CONFIG_FOUND)
pkg_search_module(GUILE guile-2.0)
-ENDIF(PKG_CONFIG_FOUND)
+endif()
diff --git a/cmake/FindIconv.cmake b/cmake/FindIconv.cmake
index b3c294abb..8ba433b85 100644
--- a/cmake/FindIconv.cmake
+++ b/cmake/FindIconv.cmake
@@ -28,45 +28,45 @@
#
# ICONV_FOUND = is iconv usable on system?
-IF(ICONV_FOUND)
+if(ICONV_FOUND)
# Already in cache, be silent
set(ICONV_FIND_QUIETLY TRUE)
-ENDIF(ICONV_FOUND)
+endif()
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckFunctionExists)
+include(CheckLibraryExists)
+include(CheckFunctionExists)
-FIND_PATH(ICONV_INCLUDE_PATH
+find_path(ICONV_INCLUDE_PATH
NAMES iconv.h
PATHS /usr/include /usr/local/include /usr/pkg/include
)
-FIND_LIBRARY(ICONV_LIBRARY
+find_library(ICONV_LIBRARY
NAMES iconv
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
)
-IF(ICONV_INCLUDE_PATH)
- IF(ICONV_LIBRARY)
- STRING(REGEX REPLACE "/[^/]*$" "" ICONV_LIB_PATH "${ICONV_LIBRARY}")
- CHECK_LIBRARY_EXISTS(iconv libiconv_open ${ICONV_LIB_PATH} LIBICONV_OPEN_FOUND)
- CHECK_LIBRARY_EXISTS(iconv iconv_open ${ICONV_LIB_PATH} ICONV_OPEN_FOUND)
- IF(LIBICONV_OPEN_FOUND OR ICONV_OPEN_FOUND)
- SET(ICONV_FOUND TRUE)
- ENDIF(LIBICONV_OPEN_FOUND OR ICONV_OPEN_FOUND)
- ELSE(ICONV_LIBRARY)
- CHECK_FUNCTION_EXISTS(iconv_open ICONV_FOUND)
- ENDIF(ICONV_LIBRARY)
-ENDIF(ICONV_INCLUDE_PATH)
+if(ICONV_INCLUDE_PATH)
+ if(ICONV_LIBRARY)
+ string(REGEX REPLACE "/[^/]*$" "" ICONV_LIB_PATH "${ICONV_LIBRARY}")
+ check_library_exists(iconv libiconv_open ${ICONV_LIB_PATH} LIBICONV_OPEN_FOUND)
+ check_library_exists(iconv iconv_open ${ICONV_LIB_PATH} ICONV_OPEN_FOUND)
+ if(LIBICONV_OPEN_FOUND OR ICONV_OPEN_FOUND)
+ set(ICONV_FOUND TRUE)
+ endif()
+ else()
+ check_function_exists(iconv_open ICONV_FOUND)
+ endif()
+endif()
include(CheckCSourceCompiles)
-IF(ICONV_LIBRARY)
- SET(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
- SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_PATH})
-ENDIF(ICONV_LIBRARY)
+if(ICONV_LIBRARY)
+ set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
+ set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_PATH})
+endif()
-SET(CMAKE_REQUIRED_FLAGS -Werror)
+set(CMAKE_REQUIRED_FLAGS -Werror)
check_c_source_compiles("
#include <iconv.h>
int main(){
@@ -79,7 +79,8 @@ check_c_source_compiles("
return 0;
}
" ICONV_2ARG_IS_CONST)
-MARK_AS_ADVANCED(
+
+mark_as_advanced(
ICONV_INCLUDE_PATH
ICONV_LIBRARY
ICONV_FOUND
diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake
index 60591a352..87cb8af39 100644
--- a/cmake/FindLua.cmake
+++ b/cmake/FindLua.cmake
@@ -28,58 +28,54 @@
#
# LUA_FOUND = is liblua usable on system?
-IF(LUA_FOUND)
+if(LUA_FOUND)
# Already in cache, be silent
- SET(LUA_FIND_QUIETLY TRUE)
-ENDIF(LUA_FOUND)
+ set(LUA_FIND_QUIETLY TRUE)
+endif()
-FIND_PATH(
+find_path(
LUA51_INCLUDE_PATH lua.h
PATHS /usr/include /usr/local/include /usr/pkg/include
PATH_SUFFIXES lua51 lua5.1 lua-5.1
)
-FIND_LIBRARY(
+find_library(
LUA51_LIBRARY NAMES lua51 lua5.1 lua-5.1 lua
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
PATH_SUFFIXES lua51 lua5.1 lua-5.1
)
-IF(LUA51_INCLUDE_PATH AND LUA51_LIBRARY)
- SET(LUA_INCLUDE_PATH "${LUA51_INCLUDE_PATH}")
- SET(LUA_LIBRARY "${LUA51_LIBRARY}")
- SET(LUA_VERSION "5.1")
- SET(LUA_FOUND TRUE)
-ELSE(LUA51_INCLUDE_PATH AND LUA51_LIBRARY)
- FIND_PATH(
+if(LUA51_INCLUDE_PATH AND LUA51_LIBRARY)
+ set(LUA_INCLUDE_PATH "${LUA51_INCLUDE_PATH}")
+ set(LUA_LIBRARY "${LUA51_LIBRARY}")
+ set(LUA_VERSION "5.1")
+ set(LUA_FOUND TRUE)
+else()
+ find_path(
LUA50_INCLUDE_PATH lua.h
PATHS /usr/include /usr/local/include /usr/pkg/include
PATH_SUFFIXES lua50 lua5.0 lua-5.0 lua
)
-
- FIND_LIBRARY(
+ find_library(
LUA50_LIBRARY NAMES lua50 lua5.0 lua-5.0 lua
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
PATH_SUFFIXES lua50 lua5.0 lua-5.0 lua
)
-
- FIND_LIBRARY(
+ find_library(
LUALIB50_LIBRARY NAMES lualib50 lualib5.0 lualib-5.0 lualib
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
PATH_SUFFIXES lua50 lua5.0 lua-5.0 lua
)
+ if(LUA50_INCLUDE_PATH AND LUA50_LIBRARY AND LUALIB50_LIBRARY)
+ set(LUA_INCLUDE_PATH "${LUA50_INCLUDE_PATH}")
+ set(LUA_LIBRARY "${LUA50_LIBRARY}")
+ set(LUALIB_LIBRARY "${LUALIB50_LIBRARY}")
+ set(LUA_VERSION "5.0")
+ set(LUA_FOUND TRUE)
+ endif()
+endif()
- IF(LUA50_INCLUDE_PATH AND LUA50_LIBRARY AND LUALIB50_LIBRARY)
- SET(LUA_INCLUDE_PATH "${LUA50_INCLUDE_PATH}")
- SET(LUA_LIBRARY "${LUA50_LIBRARY}")
- SET(LUALIB_LIBRARY "${LUALIB50_LIBRARY}")
- SET(LUA_VERSION "5.0")
- SET(LUA_FOUND TRUE)
- ENDIF(LUA50_INCLUDE_PATH AND LUA50_LIBRARY AND LUALIB50_LIBRARY)
-ENDIF(LUA51_INCLUDE_PATH AND LUA51_LIBRARY)
-
-
-MARK_AS_ADVANCED(
+mark_as_advanced(
LUA_INCLUDE_PATH
LUA_LIBRARY
LUALIB_LIBRARY
diff --git a/cmake/FindNcurses.cmake b/cmake/FindNcurses.cmake
index d3710b087..36563ac39 100644
--- a/cmake/FindNcurses.cmake
+++ b/cmake/FindNcurses.cmake
@@ -17,41 +17,41 @@
# along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
#
-IF(NCURSES_FOUND)
- SET(NCURSES_FIND_QUIETLY TRUE)
-ENDIF(NCURSES_FOUND)
+if(NCURSES_FOUND)
+ set(NCURSES_FIND_QUIETLY TRUE)
+endif()
-FIND_PATH(NCURSES_INCLUDE_PATH
+find_path(NCURSES_INCLUDE_PATH
NAMES ncurses.h curses.h
PATHS /usr/include/ncursesw /usr/include/ncurses /usr/include
/usr/local/include/ncursesw /usr/local/include/ncurses /usr/local/include
/usr/pkg/include/ncursesw /usr/pkg/include/ncurses /usr/pkg/include
)
-FIND_LIBRARY(NCURSESW_LIBRARY
+find_library(NCURSESW_LIBRARY
NAMES ncursesw
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
)
-IF (NCURSESW_LIBRARY)
- SET(NCURSES_LIBRARY ${NCURSESW_LIBRARY})
-ELSE(NCURSESW_LIBRARY)
- FIND_LIBRARY(NCURSES_LIBRARY
+if(NCURSESW_LIBRARY)
+ set(NCURSES_LIBRARY ${NCURSESW_LIBRARY})
+else()
+ find_library(NCURSES_LIBRARY
NAMES ncurses
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
)
- IF (NCURSES_LIBRARY)
- MESSAGE("*** WARNING:\n"
+ if(NCURSES_LIBRARY)
+ message("*** WARNING:\n"
"*** ncursesw library not found! Falling back to \"ncurses\"\n"
"*** Be careful, UTF-8 display may not work properly if your locale is UTF-8.")
- ENDIF(NCURSES_LIBRARY)
-ENDIF(NCURSESW_LIBRARY)
+ endif()
+endif()
-IF (NCURSES_INCLUDE_PATH AND NCURSES_LIBRARY)
- SET(NCURSES_FOUND TRUE)
-ENDIF(NCURSES_INCLUDE_PATH AND NCURSES_LIBRARY)
+if(NCURSES_INCLUDE_PATH AND NCURSES_LIBRARY)
+ set(NCURSES_FOUND TRUE)
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
NCURSES_INCLUDE_PATH
NCURSES_LIBRARY
)
diff --git a/cmake/FindPerl.cmake b/cmake/FindPerl.cmake
index e64bf5e09..f509a0cc1 100644
--- a/cmake/FindPerl.cmake
+++ b/cmake/FindPerl.cmake
@@ -28,58 +28,57 @@
# PERL_CFLAGS = perl compiler options for compiling
# PERL_LFLAGS = perl compiler options for linking
-IF(PERL_FOUND)
+if(PERL_FOUND)
# Already in cache, be silent
- SET(PERL_FIND_QUIETLY TRUE)
-ENDIF(PERL_FOUND)
+ set(PERL_FIND_QUIETLY TRUE)
+endif()
-FIND_PROGRAM(PERL_EXECUTABLE
+find_program(PERL_EXECUTABLE
NAMES perl perl5
PATHS /usr/bin /usr/local/bin /usr/pkg/bin
)
-IF(PERL_EXECUTABLE)
+if(PERL_EXECUTABLE)
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \"\$Config{archlibexp}/CORE\""
OUTPUT_VARIABLE PERL_INTERNAL_DIR
)
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ccopts
OUTPUT_VARIABLE PERL_CFLAGS
)
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ldopts
OUTPUT_VARIABLE PERL_LFLAGS
)
# remove the new lines from the output by replacing them with empty strings
- STRING(REPLACE "\n" "" PERL_INTERNAL_DIR "${PERL_INTERNAL_DIR}")
- STRING(REPLACE "\n" "" PERL_CFLAGS "${PERL_CFLAGS}")
- STRING(REPLACE "\n" "" PERL_LFLAGS "${PERL_LFLAGS}")
+ string(REPLACE "\n" "" PERL_INTERNAL_DIR "${PERL_INTERNAL_DIR}")
+ string(REPLACE "\n" "" PERL_CFLAGS "${PERL_CFLAGS}")
+ string(REPLACE "\n" "" PERL_LFLAGS "${PERL_LFLAGS}")
- FIND_PATH(PERL_INCLUDE_PATH
+ find_path(PERL_INCLUDE_PATH
NAMES perl.h
PATHS ${PERL_INTERNAL_DIR}
)
- FIND_LIBRARY(PERL_LIBRARY
+ find_library(PERL_LIBRARY
NAMES perl
PATHS /usr/lib /usr/local/lib /usr/pkg/lib ${PERL_INTERNAL_DIR}
)
- IF(PERL_LIBRARY AND PERL_INCLUDE_PATH)
- SET(PERL_FOUND TRUE)
- ENDIF(PERL_LIBRARY AND PERL_INCLUDE_PATH)
+ if(PERL_LIBRARY AND PERL_INCLUDE_PATH)
+ set(PERL_FOUND TRUE)
+ endif()
- MARK_AS_ADVANCED(
+ mark_as_advanced(
PERL_EXECUTABLE
PERL_INCLUDE_PATH
PERL_LIBRARY
PERL_CFLAGS
PERL_LFLAGS
)
-ENDIF(PERL_EXECUTABLE)
-
+endif()
diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake
index b04ea02c5..3c93c7bcb 100644
--- a/cmake/FindPython.cmake
+++ b/cmake/FindPython.cmake
@@ -28,76 +28,76 @@
# PYTHON_LIBRARY = path to where libpython.so* can be found
# PYTHON_LFLAGS = python compiler options for linking
-IF(PYTHON_FOUND)
+if(PYTHON_FOUND)
# Already in cache, be silent
- SET(PYTHON_FIND_QUIETLY TRUE)
-ENDIF(PYTHON_FOUND)
+ set(PYTHON_FIND_QUIETLY TRUE)
+endif()
-IF(ENABLE_PYTHON3)
- FIND_PROGRAM(PYTHON_EXECUTABLE
+if(ENABLE_PYTHON3)
+ find_program(PYTHON_EXECUTABLE
NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
PATHS /usr/bin /usr/local/bin /usr/pkg/bin
)
-ELSE(ENABLE_PYTHON3)
- FIND_PROGRAM(PYTHON_EXECUTABLE
+else()
+ find_program(PYTHON_EXECUTABLE
NAMES python2.7 python2.6 python2.5 python
PATHS /usr/bin /usr/local/bin /usr/pkg/bin
)
-ENDIF(ENABLE_PYTHON3)
+endif()
-IF(PYTHON_EXECUTABLE)
- EXECUTE_PROCESS(
+if(PYTHON_EXECUTABLE)
+ execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import sys; from distutils.sysconfig import *; sys.stdout.write(get_config_var('INCLUDEPY'))"
OUTPUT_VARIABLE PYTHON_INC_DIR
)
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import sys; from distutils.sysconfig import *; sys.stdout.write(get_config_var('LIBPL'))"
OUTPUT_VARIABLE PYTHON_POSSIBLE_LIB_PATH
)
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import sys; from distutils.sysconfig import *; sys.stdout.write(get_config_var('LINKFORSHARED'))"
OUTPUT_VARIABLE PYTHON_LFLAGS
)
- FIND_PATH(PYTHON_INCLUDE_PATH
+ find_path(PYTHON_INCLUDE_PATH
NAMES Python.h
PATHS ${PYTHON_INC_DIR}
)
- IF(ENABLE_PYTHON3)
- FIND_LIBRARY(PYTHON_LIBRARY
+ if(ENABLE_PYTHON3)
+ find_library(PYTHON_LIBRARY
NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
PATHS ${PYTHON_POSSIBLE_LIB_PATH}
)
- ELSE(ENABLE_PYTHON3)
- FIND_LIBRARY(PYTHON_LIBRARY
+ else()
+ find_library(PYTHON_LIBRARY
NAMES python2.7 python2.6 python2.5 python
PATHS ${PYTHON_POSSIBLE_LIB_PATH}
)
- ENDIF(ENABLE_PYTHON3)
+ endif()
- IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_PATH)
- EXECUTE_PROCESS(
+ if(PYTHON_LIBRARY AND PYTHON_INCLUDE_PATH)
+ execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(sys.version[:3])"
OUTPUT_VARIABLE PYTHON_VERSION
)
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(str(sys.version_info < (2,5)))"
OUTPUT_VARIABLE PYTHON_OLD_VERSION
)
- IF(${PYTHON_OLD_VERSION} STREQUAL "True")
- MESSAGE("Python >= 2.5 is needed to build python plugin, version found: ${PYTHON_VERSION}")
- ELSE()
- SET(PYTHON_FOUND TRUE)
- ENDIF(${PYTHON_OLD_VERSION} STREQUAL "True")
- ENDIF(PYTHON_LIBRARY AND PYTHON_INCLUDE_PATH)
+ if(${PYTHON_OLD_VERSION} STREQUAL "True")
+ message("Python >= 2.5 is needed to build python plugin, version found: ${PYTHON_VERSION}")
+ else()
+ set(PYTHON_FOUND TRUE)
+ endif()
+ endif()
- MARK_AS_ADVANCED(
+ mark_as_advanced(
PYTHON_EXECUTABLE
PYTHON_INCLUDE_PATH
PYTHON_LIBRARY
PYTHON_LFLAGS
)
-ENDIF(PYTHON_EXECUTABLE)
+endif()
diff --git a/cmake/FindRuby.cmake b/cmake/FindRuby.cmake
index 6672468f3..a0edb546a 100644
--- a/cmake/FindRuby.cmake
+++ b/cmake/FindRuby.cmake
@@ -26,74 +26,58 @@
# RUBY_LIBRARY_DIRS = linker flags to compile with ruby (found with pkg-config)
# RUBY_LIB = ruby library (found without pkg-config)
-IF(RUBY_FOUND)
+if(RUBY_FOUND)
# Already in cache, be silent
- SET(RUBY_FIND_QUIETLY TRUE)
-ENDIF(RUBY_FOUND)
+ set(RUBY_FIND_QUIETLY TRUE)
+endif()
-FIND_PACKAGE(PkgConfig)
-IF(PKG_CONFIG_FOUND)
+find_package(PkgConfig)
+if(PKG_CONFIG_FOUND)
pkg_search_module(RUBY ruby-2.1 ruby-2.0 ruby-1.9 ruby-1.8)
-ENDIF(PKG_CONFIG_FOUND)
+endif()
-IF(RUBY_FOUND)
-
- SET(RUBY_LIB "")
- MARK_AS_ADVANCED(RUBY_LIB)
-
-ELSE(RUBY_FOUND)
-
- FIND_PROGRAM(RUBY_EXECUTABLE
+if(RUBY_FOUND)
+ set(RUBY_LIB "")
+ mark_as_advanced(RUBY_LIB)
+else()
+ find_program(RUBY_EXECUTABLE
NAMES ruby1.9.3 ruby193 ruby1.9.2 ruby192 ruby1.9.1 ruby191 ruby1.9 ruby19 ruby1.8 ruby18 ruby
PATHS /usr/bin /usr/local/bin /usr/pkg/bin
)
-
- IF(RUBY_EXECUTABLE)
-
- EXECUTE_PROCESS(
+ if(RUBY_EXECUTABLE)
+ execute_process(
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['rubyhdrdir'] || RbConfig::CONFIG['archdir']"
OUTPUT_VARIABLE RUBY_ARCH_DIR
)
-
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['arch']"
OUTPUT_VARIABLE RUBY_ARCH
)
-
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['libdir']"
OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_PATH
)
-
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['rubylibdir']"
OUTPUT_VARIABLE RUBY_RUBY_LIB_PATH
)
-
- FIND_PATH(RUBY_INCLUDE_DIRS
+ find_path(RUBY_INCLUDE_DIRS
NAMES ruby.h
PATHS ${RUBY_ARCH_DIR}
)
-
- SET(RUBY_INCLUDE_ARCH "${RUBY_INCLUDE_DIRS}/${RUBY_ARCH}")
-
- FIND_LIBRARY(RUBY_LIB
+ set(RUBY_INCLUDE_ARCH "${RUBY_INCLUDE_DIRS}/${RUBY_ARCH}")
+ find_library(RUBY_LIB
NAMES ruby-1.9.3 ruby1.9.3 ruby193 ruby-1.9.2 ruby1.9.2 ruby192 ruby-1.9.1 ruby1.9.1 ruby191 ruby1.9 ruby19 ruby1.8 ruby18 ruby
PATHS ${RUBY_POSSIBLE_LIB_PATH} ${RUBY_RUBY_LIB_PATH}
)
-
- IF(RUBY_LIB AND RUBY_INCLUDE_DIRS)
- SET(RUBY_FOUND TRUE)
- ENDIF(RUBY_LIB AND RUBY_INCLUDE_DIRS)
-
- SET(RUBY_INCLUDE_DIRS "${RUBY_INCLUDE_DIRS};${RUBY_INCLUDE_ARCH}")
-
- MARK_AS_ADVANCED(
+ if(RUBY_LIB AND RUBY_INCLUDE_DIRS)
+ set(RUBY_FOUND TRUE)
+ endif()
+ set(RUBY_INCLUDE_DIRS "${RUBY_INCLUDE_DIRS};${RUBY_INCLUDE_ARCH}")
+ mark_as_advanced(
RUBY_INCLUDE_DIRS
RUBY_LIBRARY_DIRS
RUBY_LIB
)
-
- ENDIF(RUBY_EXECUTABLE)
-
-ENDIF(RUBY_FOUND)
+ endif()
+endif()
diff --git a/cmake/FindSourcehighlight.cmake b/cmake/FindSourcehighlight.cmake
index be9be860a..ebf470562 100644
--- a/cmake/FindSourcehighlight.cmake
+++ b/cmake/FindSourcehighlight.cmake
@@ -21,19 +21,19 @@
# - Find Source-Highlight
# This module finds if source-highlight is installed.
-IF (SOURCEHIGHLIGHT_FOUND)
+if(SOURCEHIGHLIGHT_FOUND)
# Already in cache, be silent
- SET(SOURCEHIGHLIGHT_FIND_QUIETLY TRUE)
-ENDIF (SOURCEHIGHLIGHT_FOUND)
+ set(SOURCEHIGHLIGHT_FIND_QUIETLY TRUE)
+endif()
-FIND_PROGRAM(
+find_program(
SOURCEHIGHLIGHT_EXECUTABLE source-highlight
PATHS /bin /usr/bin /usr/local/bin /usr/pkg/bin
)
-IF(SOURCEHIGHLIGHT_EXECUTABLE)
- SET(SOURCEHIGHLIGHT_FOUND TRUE)
- MARK_AS_ADVANCED(
+if(SOURCEHIGHLIGHT_EXECUTABLE)
+ set(SOURCEHIGHLIGHT_FOUND TRUE)
+ mark_as_advanced(
SOURCEHIGHLIGHT_EXECUTABLE
)
-ENDIF(SOURCEHIGHLIGHT_EXECUTABLE)
+endif()
diff --git a/cmake/FindTCL.cmake b/cmake/FindTCL.cmake
index 8a92a9da6..01352eb74 100644
--- a/cmake/FindTCL.cmake
+++ b/cmake/FindTCL.cmake
@@ -51,26 +51,26 @@
# this point it is safer you ask directly where the *source* tree is
# and dig from there.
-IF(TCL_FOUND)
- SET(TCL_FIND_QUIETLY TRUE)
-ENDIF(TCL_FOUND)
+if(TCL_FOUND)
+ set(TCL_FIND_QUIETLY TRUE)
+endif()
-INCLUDE(CMakeFindFrameworks)
-INCLUDE(FindTclsh)
+include(CMakeFindFrameworks)
+include(FindTclsh)
-GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
-GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
+get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
+string(REGEX REPLACE
"^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
-GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
+get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
+get_filename_component(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
"^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_VERSION "${TCL_LIBRARY}")
-SET(TCL_POSSIBLE_LIB_PATHS
+set(TCL_POSSIBLE_LIB_PATHS
"${TCL_INCLUDE_PATH_PARENT}/lib"
"${TCL_INCLUDE_PATH_PARENT}/lib64"
"${TCL_LIBRARY_PATH}"
@@ -82,12 +82,12 @@ SET(TCL_POSSIBLE_LIB_PATHS
/usr/local/lib64
)
-IF(WIN32)
- GET_FILENAME_COMPONENT(
+if(WIN32)
+ get_filename_component(
ActiveTcl_CurrentVersion
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
NAME)
- SET(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ set(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
@@ -95,9 +95,9 @@ IF(WIN32)
"C:/Program Files/Tcl/lib"
"C:/Tcl/lib"
)
-ENDIF(WIN32)
+endif()
-FIND_LIBRARY(TCL_LIBRARY
+find_library(TCL_LIBRARY
NAMES
tcl86 tcl8.6
tcl85 tcl8.5
@@ -106,18 +106,18 @@ FIND_LIBRARY(TCL_LIBRARY
PATHS ${TCL_POSSIBLE_LIB_PATHS}
)
-CMAKE_FIND_FRAMEWORKS(Tcl)
+cmake_find_frameworks(Tcl)
-SET(TCL_FRAMEWORK_INCLUDES)
-IF(Tcl_FRAMEWORKS)
- IF(NOT TCL_INCLUDE_PATH)
- FOREACH(dir ${Tcl_FRAMEWORKS})
- SET(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers)
- ENDFOREACH(dir)
- ENDIF(NOT TCL_INCLUDE_PATH)
-ENDIF(Tcl_FRAMEWORKS)
+set(TCL_FRAMEWORK_INCLUDES)
+if(Tcl_FRAMEWORKS)
+ if(NOT TCL_INCLUDE_PATH)
+ foreach(dir ${Tcl_FRAMEWORKS})
+ set(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers)
+ endforeach(dir)
+ endif()
+endif()
-SET(TCL_POSSIBLE_INCLUDE_PATHS
+set(TCL_POSSIBLE_INCLUDE_PATHS
"${TCL_LIBRARY_PATH_PARENT}/include"
"${TCL_INCLUDE_PATH}"
${TCL_FRAMEWORK_INCLUDES}
@@ -132,9 +132,8 @@ SET(TCL_POSSIBLE_INCLUDE_PATHS
/usr/local/include/tcl8.5
)
-
-IF(WIN32)
- SET(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+if(WIN32)
+ set(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
@@ -142,21 +141,21 @@ IF(WIN32)
"C:/Program Files/Tcl/include"
"C:/Tcl/include"
)
-ENDIF(WIN32)
+endif()
-FIND_PATH(TCL_INCLUDE_PATH
+find_path(TCL_INCLUDE_PATH
NAMES tcl.h
PATHS ${TCL_POSSIBLE_INCLUDE_PATHS}
)
-IF(TCL_LIBRARY AND TCL_INCLUDE_PATH)
- SET(TCL_VERSION ${TCL_VERSION})
- SET(TCL_LIBARY ${TCL_LIBRARY})
- SET(TCL_INCLUDE_PATH ${TCL_INCLUDE_PATH})
- SET(TCL_FOUND TRUE)
-ENDIF(TCL_LIBRARY AND TCL_INCLUDE_PATH)
+if(TCL_LIBRARY AND TCL_INCLUDE_PATH)
+ set(TCL_VERSION ${TCL_VERSION})
+ set(TCL_LIBARY ${TCL_LIBRARY})
+ set(TCL_INCLUDE_PATH ${TCL_INCLUDE_PATH})
+ set(TCL_FOUND TRUE)
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
TCL_INCLUDE_PATH
TCL_LIBRARY
TCL_VERSION
diff --git a/cmake/FindZLIB.cmake b/cmake/FindZLIB.cmake
index bf1f7b012..6ac90ee42 100644
--- a/cmake/FindZLIB.cmake
+++ b/cmake/FindZLIB.cmake
@@ -31,48 +31,47 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/include"
+find_path(ZLIB_INCLUDE_DIR zlib.h
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/include"
)
-SET(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1)
-FIND_LIBRARY(ZLIB_LIBRARY
- NAMES
- ${ZLIB_NAMES}
- PATHS
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/lib"
-)
-MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+set(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1)
+find_library(ZLIB_LIBRARY
+ NAMES
+ ${ZLIB_NAMES}
+ PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/lib"
+ )
+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
- FILE(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
+if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+ file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
- STRING(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
- STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
- STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
- SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
- # only append a TWEAK version if it exists:
- SET(ZLIB_VERSION_TWEAK "")
- IF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
- SET(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
- SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
- ENDIF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
+ # only append a TWEAK version if it exists:
+ set(ZLIB_VERSION_TWEAK "")
+ if("${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
+ set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
+ endif()
- SET(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
- SET(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
- SET(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
-ENDIF()
+ set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
+ set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
+ set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
+endif()
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
#INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-INCLUDE(${CMAKE_HOME_DIRECTORY}/cmake/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
- VERSION_VAR ZLIB_VERSION_STRING)
-
-IF(ZLIB_FOUND)
- SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
- SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
-ENDIF()
+include(${CMAKE_HOME_DIRECTORY}/cmake/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
+ VERSION_VAR ZLIB_VERSION_STRING)
+if(ZLIB_FOUND)
+ set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+endif()
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in
index 60a241cf5..ecdd18e22 100644
--- a/cmake/cmake_uninstall.cmake.in
+++ b/cmake/cmake_uninstall.cmake.in
@@ -17,24 +17,24 @@
# along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
#
-IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
- MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
-ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+ message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+endif()
-FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
-STRING(REGEX REPLACE "\n" ";" files "${files}")
-STRING(REGEX REPLACE ";$" "" files "${files}")
-LIST(REVERSE files)
-FOREACH(file ${files})
- MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
- IF(EXISTS "$ENV{DESTDIR}${file}")
- EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+string(REGEX REPLACE ";$" "" files "${files}")
+list(REVERSE files)
+foreach(file ${files})
+ message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+ if(EXISTS "$ENV{DESTDIR}${file}")
+ exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VARIABLE rm_retval)
- IF("${rm_retval}" GREATER 0)
- MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
- ENDIF("${rm_retval}" GREATER 0)
- ELSE(EXISTS "$ENV{DESTDIR}${file}")
- MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
- ENDIF(EXISTS "$ENV{DESTDIR}${file}")
-ENDFOREACH(file)
+ if("${rm_retval}" GREATER 0)
+ message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ endif()
+ else()
+ message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+ endif()
+endforeach(file)