summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAdrian Negreanu <adrian.m.negreanu@intel.com>2015-05-15 14:30:11 (GMT)
committerAdrian Negreanu <adrian.m.negreanu@intel.com>2015-05-15 16:34:41 (GMT)
commit2e099b1950eee2c3a0d5d8ae4b25575caeb938b1 (patch)
tree4db52f4b6a2078ede1554bf586d012eb8d58be4f /cmake
parentac576bd974ac27bc1f395e8ae6c77b19f800b6db (diff)
downloadDoxygen-2e099b1950eee2c3a0d5d8ae4b25575caeb938b1.zip
Doxygen-2e099b1950eee2c3a0d5d8ae4b25575caeb938b1.tar.gz
Doxygen-2e099b1950eee2c3a0d5d8ae4b25575caeb938b1.tar.bz2
use cmake
runtest.pl replaced by testing/test_driver.cmake version.py replaced by cmake/version.cmake lang_cfg.py replaced by cmake/lang_cfg.cmake settings.py implemented in src/CMakeLists.txt increasebuffer.py replaced by defining the YY_BUF_SIZE and YY_READ_BUF_SIZE Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindIconv.cmake115
-rw-r--r--cmake/FindSQLite3.cmake86
-rw-r--r--cmake/lang_cfg.cmake11
-rw-r--r--cmake/version.cmake6
4 files changed, 218 insertions, 0 deletions
diff --git a/cmake/FindIconv.cmake b/cmake/FindIconv.cmake
new file mode 100644
index 0000000..5ef8686
--- /dev/null
+++ b/cmake/FindIconv.cmake
@@ -0,0 +1,115 @@
+# 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)
+ find_library(ICONV_LIBRARY
+ NAMES iconv
+ HINTS
+ ${CMAKE_PREFIX_PATH}
+ ${ICONV_DIR}
+ $ENV{ICONV_DIR}
+ PATH_SUFFIXES lib64 lib
+ )
+ 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/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/lang_cfg.cmake b/cmake/lang_cfg.cmake
new file mode 100644
index 0000000..b2b6708
--- /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 ENGLISH_${CMAKE_ARGV${i}}")
+ endforeach()
+ endif()
+endif()
+
diff --git a/cmake/version.cmake b/cmake/version.cmake
new file mode 100644
index 0000000..b8af217
--- /dev/null
+++ b/cmake/version.cmake
@@ -0,0 +1,6 @@
+set(doxygen_version_major "1" CACHE STRING "Major")
+set(doxygen_version_minor "8" CACHE STRING "Minor")
+set(doxygen_version_revision "8" CACHE STRING "Revision")
+#set(doxygen_version_mmn "-5" CACHE STRING "Mmn")
+set(VERSION "${doxygen_version_major}.${doxygen_version_minor}.${doxygen_version_revision}${doxygen_version_mmn}")
+set(ENV{VERSION} "${VERSION}")