summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-15 10:52:33 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-15 10:52:33 +0900
commit0efe600d6f0659af7bae9047301dd60983e18a6e (patch)
tree50131a4bf60e38149cccd2a84086c675b8533e9d /cmake
parentb3e03c958bd4534210bdb8d87ab0b56ada4562fb (diff)
downloaddoxygen-0efe600d6f0659af7bae9047301dd60983e18a6e.tar.gz
doxygen-0efe600d6f0659af7bae9047301dd60983e18a6e.tar.bz2
doxygen-0efe600d6f0659af7bae9047301dd60983e18a6e.zip
Imported Upstream version 1.8.10upstream/1.8.10
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindIconv.cmake126
-rw-r--r--cmake/FindLibClang.cmake51
-rw-r--r--cmake/FindSQLite3.cmake86
-rw-r--r--cmake/FindXapian.cmake42
-rw-r--r--cmake/lang_cfg.cmake11
-rw-r--r--cmake/run_translator.cmake5
-rw-r--r--cmake/version.cmake2
7 files changed, 323 insertions, 0 deletions
diff --git a/cmake/FindIconv.cmake b/cmake/FindIconv.cmake
new file mode 100644
index 0000000..d96e3c0
--- /dev/null
+++ b/cmake/FindIconv.cmake
@@ -0,0 +1,126 @@
+# vim:ts=4:sw=4:expandtab:autoindent:
+#
+# The MIT License
+#
+# Copyright (c) 2008, 2009 Flusspferd contributors (see "CONTRIBUTORS" or
+# http://flusspferd.org/contributors.txt)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+Include(CheckFunctionExists)
+include(CheckCXXSourceCompiles)
+
+if(ICONV_INCLUDE_DIR)
+ set(ICONV_FIND_QUIETLY TRUE)
+endif()
+
+find_path(ICONV_INCLUDE_DIR iconv.h
+ HINTS
+ ${CMAKE_PREFIX_PATH}
+ ${ICONV_DIR}
+ $ENV{ICONV_DIR}
+ PATH_SUFFIXES include
+)
+
+if(NOT ICONV_INCLUDE_DIR STREQUAL "ICONV_INCLUDE_DIR-NOTFOUND")
+ set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
+ check_function_exists(iconv_open ICONV_IN_GLIBC)
+endif()
+
+if(NOT ICONV_IN_GLIBC)
+ if (CMAKE_CL_64)
+ find_library(ICONV_LIBRARY
+ NAMES iconv64
+ HINTS
+ ${CMAKE_PREFIX_PATH}
+ ${ICONV_DIR}
+ $ENV{ICONV_DIR}
+ PATH_SUFFIXES lib64 lib
+ )
+ else()
+ find_library(ICONV_LIBRARY
+ NAMES iconv
+ HINTS
+ ${CMAKE_PREFIX_PATH}
+ ${ICONV_DIR}
+ $ENV{ICONV_DIR}
+ PATH_SUFFIXES lib64 lib
+ )
+ endif()
+ set(ICONV_TEST ${ICONV_LIBRARY})
+else()
+ set(ICONV_TEST "In glibc")
+endif()
+
+set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
+set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
+check_cxx_source_compiles(
+ "#include <iconv.h>
+ int main() {
+ iconv(iconv_t(-1), 0, 0, 0, 0);
+ }"
+ ICONV_COMPILES)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ICONV DEFAULT_MSG ICONV_TEST ICONV_INCLUDE_DIR ICONV_COMPILES)
+
+if(ICONV_FOUND)
+ set(ICONV_LIBRARIES ${ICONV_LIBRARY})
+else(ICONV_FOUND)
+ set(ICONV_LIBRARIES)
+endif(ICONV_FOUND)
+
+if(ICONV_FOUND)
+ set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
+
+ if (NOT DEFINED ICONV_ACCEPTS_NONCONST_INPUT)
+ # Display a useful message first time we come through here
+ message(STATUS "One (and only one) of the ICONV_ACCEPTS_... tests must pass")
+ endif()
+ check_cxx_source_compiles(
+ "#include <iconv.h>
+ int main() {
+ char *p = 0;
+ iconv(iconv_t(-1), &p, 0, 0, 0);
+ }"
+ ICONV_ACCEPTS_NONCONST_INPUT)
+
+ check_cxx_source_compiles(
+ "#include <iconv.h>
+ int main() {
+ char const *p = 0;
+ iconv(iconv_t(-1), &p, 0, 0, 0);
+ }"
+ ICONV_ACCEPTS_CONST_INPUT)
+
+ if (ICONV_LIBRARY)
+ list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
+ list(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES)
+ endif()
+endif()
+
+if(NOT ICONV_ACCEPTS_CONST_INPUT AND NOT ICONV_ACCEPTS_NONCONST_INPUT)
+ MESSAGE(FATAL_ERROR "Unable to determine iconv() signature")
+elseif(ICONV_ACCEPTS_CONST_INPUT AND ICONV_ACCEPTS_NONCONST_INPUT)
+ MESSAGE(FATAL_ERROR "Unable to determine iconv() signature - both test cases passed!")
+endif()
+
+mark_as_advanced(ICONV_LIBRARY ICONV_INCLUDE_DIR)
diff --git a/cmake/FindLibClang.cmake b/cmake/FindLibClang.cmake
new file mode 100644
index 0000000..2835b1f
--- /dev/null
+++ b/cmake/FindLibClang.cmake
@@ -0,0 +1,51 @@
+if (NOT CLANG_ROOT)
+ set(CLANG_ROOT $ENV{CLANG_ROOT})
+endif ()
+
+if (NOT LLVM_CONFIG)
+ set(LLVM_CONFIG $ENV{LLVM_CONFIG})
+ if (NOT LLVM_CONFIG)
+ set(llvm_config_names llvm-config)
+ foreach(minor RANGE 9 1)
+ list(APPEND llvm_config_names "llvm-config3${minor}" "llvm-config-3.${minor}" "llvm-config-mp-3.${minor}")
+ endforeach ()
+ find_program(LLVM_CONFIG NAMES ${llvm_config_names})
+ endif ()
+endif ()
+
+if (LLVM_CONFIG)
+ message(STATUS "llvm-config found at: ${LLVM_CONFIG}")
+else ()
+ message(FATAL_ERROR "Could NOT find llvm-config executable.")
+endif ()
+
+if (NOT EXISTS ${CLANG_INCLUDEDIR})
+ execute_process(COMMAND ${LLVM_CONFIG} --includedir OUTPUT_VARIABLE CLANG_INCLUDEDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (NOT EXISTS ${CLANG_INCLUDEDIR})
+ message(FATAL_ERROR "Could NOT find clang includedir. You can fix this by setting CLANG_INCLUDEDIR in your shell or as a cmake variable.")
+ endif ()
+endif ()
+
+if (NOT EXISTS ${CLANG_LIBDIR})
+ execute_process(COMMAND ${LLVM_CONFIG} --libdir OUTPUT_VARIABLE CLANG_LIBDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (NOT EXISTS ${CLANG_LIBDIR})
+ message(FATAL_ERROR "Could NOT find clang libdir. You can fix this by setting CLANG_LIBDIR in your shell or as a cmake variable.")
+ endif ()
+endif ()
+
+if (NOT CLANG_LIBS)
+ find_library(CLANG_LIB_HACK_CMAKECACHE_DOT_TEXT_BULLSHIT NAMES clang libclang ${CLANG_ROOT}/lib ${CLANG_LIBDIR} NO_DEFAULT_PATH)
+ if (NOT EXISTS ${CLANG_CLANG_LIB_HACK_CMAKECACHE_DOT_TEXT_BULLSHIT})
+ find_library(CLANG_LIBS NAMES clang libclang)
+ if (NOT EXISTS ${CLANG_LIBS})
+ set (CLANG_LIBS "-L${CLANG_LIBDIR}" "-lclang" "-Wl,-rpath,${CLANG_LIBDIR}")
+ endif ()
+ else ()
+ set(CLANG_LIBS "${CLANG_LIB_HACK_CMAKECACHE_DOT_TEXT_BULLSHIT}")
+ endif ()
+endif ()
+
+execute_process(COMMAND ${LLVM_CONFIG} --version OUTPUT_VARIABLE CLANG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+message("-- Using Clang ${CLANG_VERSION} from ${CLANG_LIBDIR} with LIBS ${CLANG_LIBS} and CXXFLAGS ${CLANG_CXXFLAGS}")
+
+
diff --git a/cmake/FindSQLite3.cmake b/cmake/FindSQLite3.cmake
new file mode 100644
index 0000000..77b8eb4
--- /dev/null
+++ b/cmake/FindSQLite3.cmake
@@ -0,0 +1,86 @@
+# - Try to find Sqlite3
+# Once done this will define
+#
+# SQLITE3_FOUND - system has Sqlite3
+# SQLITE3_INCLUDE_DIRS - the Sqlite3 include directory
+# SQLITE3_LIBRARIES - Link these to use Sqlite3
+# SQLITE3_DEFINITIONS - Compiler switches required for using Sqlite3
+#
+# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS)
+ # in cache already
+ set(SQLITE3_FOUND TRUE)
+else (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ include(UsePkgConfig)
+ pkgconfig(sqlite3 _SQLITE3_INCLUDEDIR _SQLITE3_LIBDIR _SQLITE3_LDFLAGS _SQLITE3_CFLAGS)
+ else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_SQLITE3 sqlite3)
+ endif (PKG_CONFIG_FOUND)
+ endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_path(SQLITE3_INCLUDE_DIR
+ NAMES
+ sqlite3.h
+ PATHS
+ ${_SQLITE3_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ )
+
+ find_library(SQLITE3_LIBRARY
+ NAMES
+ sqlite3
+ PATHS
+ ${_SQLITE3_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (SQLITE3_LIBRARY)
+ set(SQLITE3_FOUND TRUE)
+ endif (SQLITE3_LIBRARY)
+
+ set(SQLITE3_INCLUDE_DIRS
+ ${SQLITE3_INCLUDE_DIR}
+ )
+
+ if (SQLITE3_FOUND)
+ set(SQLITE3_LIBRARIES
+ ${SQLITE3_LIBRARIES}
+ ${SQLITE3_LIBRARY}
+ )
+ endif (SQLITE3_FOUND)
+
+ if (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
+ set(SQLITE3_FOUND TRUE)
+ endif (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
+
+ if (SQLITE3_FOUND)
+ if (NOT Sqlite3_FIND_QUIETLY)
+ message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARIES}")
+ endif (NOT Sqlite3_FIND_QUIETLY)
+ else (SQLITE3_FOUND)
+ if (Sqlite3_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find Sqlite3")
+ endif (Sqlite3_FIND_REQUIRED)
+ endif (SQLITE3_FOUND)
+
+ # show the SQLITE3_INCLUDE_DIRS and SQLITE3_LIBRARIES variables only in the advanced view
+ mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)
+
+endif (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS)
diff --git a/cmake/FindXapian.cmake b/cmake/FindXapian.cmake
new file mode 100644
index 0000000..6109d7f
--- /dev/null
+++ b/cmake/FindXapian.cmake
@@ -0,0 +1,42 @@
+# Find Xapian search engine library
+#
+# XAPIAN_FOUND - system has Xapian
+# XAPIAN_INCLUDE_DIR - the Xapian include directory
+# XAPIAN_LIBRARIES - the libraries needed to use Xapian
+#
+# Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(XAPIAN_INCLUDE_DIR AND XAPIAN_LIBRARIES)
+ # Already in cache, be silent
+ set(Xapian_FIND_QUIETLY TRUE)
+endif(XAPIAN_INCLUDE_DIR AND XAPIAN_LIBRARIES)
+
+FIND_PATH(XAPIAN_INCLUDE_DIR xapian/version.h)
+
+FIND_LIBRARY(XAPIAN_LIBRARIES NAMES xapian)
+
+IF(XAPIAN_INCLUDE_DIR AND XAPIAN_LIBRARIES)
+ SET(XAPIAN_FOUND TRUE)
+ELSE(XAPIAN_INCLUDE_DIR AND XAPIAN_LIBRARIES)
+ SET(XAPIAN_FOUND FALSE)
+ENDIF(XAPIAN_INCLUDE_DIR AND XAPIAN_LIBRARIES)
+
+IF(XAPIAN_FOUND)
+ IF(NOT Xapian_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Xapian: ${XAPIAN_LIBRARIES}")
+ ENDIF(NOT Xapian_FIND_QUIETLY)
+ELSE(XAPIAN_FOUND)
+ IF(Xapian_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Xapian")
+ ENDIF(Xapian_FIND_REQUIRED)
+ IF(NOT Xapian_FIND_QUIETLY)
+ MESSAGE(STATUS "Could not find Xapian")
+ ENDIF(NOT Xapian_FIND_QUIETLY)
+ENDIF(XAPIAN_FOUND)
+
+# show the XAPIAN_INCLUDE_DIR and XAPIAN_LIBRARIES variables only in the advanced view
+MARK_AS_ADVANCED(XAPIAN_INCLUDE_DIR XAPIAN_LIBRARIES)
+
diff --git a/cmake/lang_cfg.cmake b/cmake/lang_cfg.cmake
new file mode 100644
index 0000000..c57d3ed
--- /dev/null
+++ b/cmake/lang_cfg.cmake
@@ -0,0 +1,11 @@
+if(${CMAKE_ARGC} GREATER 1)
+ if ("${CMAKE_ARGV3}" STREQUAL "ENONLY")
+ message("#define ENGLISH_ONLY")
+ else()
+ math(EXPR UPTO ${CMAKE_ARGC}-1)
+ foreach(i RANGE 3 ${UPTO})
+ message("#define LANG_${CMAKE_ARGV${i}}")
+ endforeach()
+ endif()
+endif()
+
diff --git a/cmake/run_translator.cmake b/cmake/run_translator.cmake
new file mode 100644
index 0000000..618bb82
--- /dev/null
+++ b/cmake/run_translator.cmake
@@ -0,0 +1,5 @@
+include(${SOURCE}/cmake/version.cmake)
+find_program(PYTHON NAMES python)
+execute_process(
+ COMMAND ${PYTHON} ${CMAKE_SOURCE_DIR}/translator.py
+)
diff --git a/cmake/version.cmake b/cmake/version.cmake
new file mode 100644
index 0000000..48de7b2
--- /dev/null
+++ b/cmake/version.cmake
@@ -0,0 +1,2 @@
+file (STRINGS "${SOURCE}/VERSION" VERSION)
+set(ENV{VERSION} "${VERSION}")