Imported Upstream version 1.9.8
[platform/upstream/doxygen.git] / CMakeLists.txt
index 12fba50..4957c34 100644 (file)
@@ -11,7 +11,7 @@
 # Documents produced by Doxygen are derivative works derived from the
 # input used in their production; they are not affected by this license.
 
-cmake_minimum_required(VERSION 3.3)
+cmake_minimum_required(VERSION 3.12)
 project(doxygen)
 
 option(build_wizard    "Build the GUI frontend for doxygen." OFF)
@@ -21,15 +21,17 @@ option(build_xmlparser "Automatically update the XML parser modules when updatin
 option(build_search    "Build external search tools (doxysearch and doxyindexer)" OFF)
 option(build_doc       "Build user manual (HTML and PDF)" OFF)
 option(build_doc_chm   "Build user manual (CHM)" OFF)
-option(use_sqlite3     "Add support for sqlite3 output [experimental]." OFF)
 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
     option(use_libc++  "Use libc++ as C++ standard library." ON)
 endif()
 option(use_libclang    "Add support for libclang parsing." OFF)
+option(use_sys_spdlog  "Use system spdlog instead of bundled." OFF)
 option(static_libclang "Link to a statically compiled version of LLVM/libclang." OFF)
 option(win_static      "Link with /MT in stead of /MD on windows" OFF)
 option(enable_console  "Enable that executables on Windows get the CONSOLE bit set for the doxywizard executable [development]"  OFF)
 option(enable_coverage "Enable coverage reporting for gcc/clang [development]" OFF)
+option(enable_tracing  "Enable tracing option in release builds [development]" OFF)
+option(enable_lex_debug "Enable debugging info for lexical scanners in release builds [development]" OFF)
 
 set(force_qt CACHE INTERNAL "Forces doxywizard to build using the specified major version, this can be Qt5 or Qt6")
 set_property(CACHE force_qt PROPERTY STRINGS OFF Qt6 Qt5)
@@ -38,7 +40,7 @@ SET(enlarge_lex_buffers "262144" CACHE INTERNAL "Sets the lex input and read buf
 
 if(enable_coverage)
   if ("${PROJECT_BINARY_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}")
-    message(FATAL_ERROR "Doxygen cannot be generated in-place, the build directory (${PROJECT_BINARY_DIR}) has to differ from the doxygen main directory (${PROJECT_SOURCE_DIR})\nPlease don't forget to remove the already file created file 'CMakeCache.txt' and the directory 'CMakeFiles'!")
+    message(FATAL_ERROR "Doxygen cannot be generated in-place, the build directory (${PROJECT_BINARY_DIR}) has to differ from the doxygen main directory (${PROJECT_SOURCE_DIR})\nPlease don't forget to remove the already created file 'CMakeCache.txt' and the directory 'CMakeFiles'!")
   endif()
 endif()
 
@@ -54,11 +56,7 @@ else()
     set(depfile_supported  "1" CACHE INTERNAL "DEPFILE is supported")
 endif()
 
-set(sqlite3  "0" CACHE INTERNAL "used in settings.h")
 set(clang    "0" CACHE INTERNAL "used in settings.h")
-if (use_sqlite3)
-       set(sqlite3  "1" CACHE INTERNAL "used in settings.h")
-endif()
 
 set(MACOS_VERSION_MIN 10.14)
 if (use_libclang)
@@ -66,6 +64,9 @@ if (use_libclang)
         find_package(LLVM CONFIG REQUIRED)
         find_package(Clang CONFIG REQUIRED)
 endif()
+if (use_sys_spdlog)
+        find_package(spdlog CONFIG REQUIRED)
+endif()
 if (build_wizard)
     if (force_qt STREQUAL "Qt6")
         if (CMAKE_SYSTEM MATCHES "Darwin")
@@ -87,6 +88,8 @@ if (CMAKE_SYSTEM MATCHES "Darwin")
     set(EXTRA_LIBS ${CORESERVICES_LIB})
 endif()
 
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSQLITE_OMIT_LOAD_EXTENSION=1")
+
 if (WIN32)
     if (MSVC)
         if (NOT ICONV_DIR)
@@ -122,6 +125,11 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
    endif()
 endif()
 
+# needed for JavaCC
+set(JAVA_CC_EXTRA_FLAGS "-DJAVACC_CHAR_TYPE=\"unsigned char\"")
+set(CMAKE_CXX_FLAGS       "${CMAKE_CXX_FLAGS}       ${JAVA_CC_EXTRA_FLAGS}")
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${JAVA_CC_EXTRA_FLAGS}")
+
 if(POLICY CMP0063)
   cmake_policy(SET CMP0063 NEW)
 endif()
@@ -140,7 +148,7 @@ else ()
 endif ()
 
 find_program(DOT NAMES dot)
-find_package(PythonInterp REQUIRED)
+find_package(Python REQUIRED)
 find_package(FLEX REQUIRED)
 if (FLEX_VERSION VERSION_LESS 2.5.37)
   message(SEND_ERROR "Doxygen requires at least flex version 2.5.37 (installed: ${FLEX_VERSION})")
@@ -152,11 +160,8 @@ endif()
 find_package(Threads)
 find_package(Sanitizers)
 
-if (sqlite3)
-  find_package(SQLite3 REQUIRED)
-  if (SQLITE3_VERSION VERSION_LESS 3.9.0)
-    message(SEND_ERROR "Doxygen requires at least sqlite3 version 3.9.0 (installed: ${SQLITE3_VERSION})")
-  endif()
+if ((CMAKE_BUILD_TYPE STREQUAL "Debug") OR enable_lex_debug)
+  set(LEX_FLAGS "${LEX_FLAGS} -d")
 endif()
 
 find_package(Iconv REQUIRED)
@@ -196,10 +201,9 @@ endif()
 
 include(cmake/CompilerWarnings.cmake)
 include(cmake/Coverage.cmake)
+include(cmake/WindowsEncoding.cmake)
 
-add_subdirectory(libmd5)
-add_subdirectory(liblodepng)
-add_subdirectory(libmscgen)
+add_subdirectory(deps)
 add_subdirectory(libversion)
 add_subdirectory(libxml)
 add_subdirectory(vhdlparser)
@@ -220,6 +224,7 @@ if (build_doc)
     add_subdirectory(doc)
 endif ()
 
+add_subdirectory(doc_internal)
 add_subdirectory(addon)
 
 enable_testing()