diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cd0fcaa..06b9696 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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.2) +cmake_minimum_required(VERSION 3.3) project(doxygen) option(build_wizard "Build the GUI frontend for doxygen." OFF) @@ -22,15 +22,21 @@ option(build_search "Build external search tools (doxysearch and doxyindexer) 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(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(english_only "Only compile in support for the English language" OFF) option(force_qt4 "Forces doxywizard to build using Qt4 even if Qt5 is installed" OFF) +option(enable_coverage "Enable coverage reporting for gcc/clang [development]" OFF) SET(enlarge_lex_buffers "262144" CACHE INTERNAL "Sets the lex input and read buffers to the specified size") -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") -set(TOP "${CMAKE_SOURCE_DIR}") +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Sanitizers") +set(TOP "${PROJECT_SOURCE_DIR}") include(version) set(sqlite3 "0" CACHE INTERNAL "used in settings.h") @@ -45,7 +51,7 @@ if (use_libclang) find_package(LLVM CONFIG REQUIRED) find_package(Clang CONFIG REQUIRED) if (CMAKE_SYSTEM MATCHES "Darwin") - set(MACOS_VERSION_MIN 10.11) + set(MACOS_VERSION_MIN 10.14) endif() endif() @@ -62,9 +68,11 @@ if (CMAKE_SYSTEM MATCHES "Darwin") endif() if (WIN32) - if (NOT CMAKE_GENERATOR MATCHES "MinGW Makefiles") + if ((NOT CMAKE_GENERATOR MATCHES "MinGW Makefiles") AND + (NOT CMAKE_GENERATOR MATCHES "MSYS Makefiles") AND + (NOT CMAKE_GENERATOR MATCHES "Unix Makefiles")) if (NOT ICONV_DIR) - set(ICONV_DIR "${CMAKE_SOURCE_DIR}/winbuild") + set(ICONV_DIR "${PROJECT_SOURCE_DIR}/winbuild") endif() set(CMAKE_REQUIRED_DEFINITIONS "-DLIBICONV_STATIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # needed for language.cpp on 64bit @@ -100,6 +108,7 @@ if (BISON_VERSION VERSION_LESS 2.7) message(SEND_ERROR "Doxygen requires at least bison version 2.7 (installed: ${BISON_VERSION})") endif() find_package(Threads) +find_package(Sanitizers) if (sqlite3) find_package(SQLite3 REQUIRED) @@ -112,10 +121,10 @@ find_package(Iconv REQUIRED) include_directories(${ICONV_INCLUDE_DIR}) -#set(DOXYDOCS ${CMAKE_SOURCE_DIR}/doc CACHE INTERNAL "Path to doxygen docs") +#set(DOXYDOCS ${PROJECT_SOURCE_DIR}/doc CACHE INTERNAL "Path to doxygen docs") set(DOXYDOCS ${PROJECT_BINARY_DIR}/doc) set(ENV{DOXYGEN_DOCDIR} ${DOXYDOCS}) -set(GENERATED_SRC "${CMAKE_BINARY_DIR}/generated_src" CACHE INTERNAL "Stores generated files") +set(GENERATED_SRC "${PROJECT_BINARY_DIR}/generated_src" CACHE INTERNAL "Stores generated files") set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) @@ -127,7 +136,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${EXECUTABLE_OUTPUT_PATH}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${EXECUTABLE_OUTPUT_PATH}) # gather lang codes for translation -file(GLOB lang_files RELATIVE "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/src/translator_??.h") +file(GLOB lang_files RELATIVE "${PROJECT_SOURCE_DIR}/src" "${PROJECT_SOURCE_DIR}/src/translator_??.h") if (english_only) # user only wants English set(lcodes "ENONLY") else () @@ -157,6 +166,8 @@ if (win_static) endforeach() endif() +include(cmake/CompilerWarnings.cmake) +include(cmake/Coverage.cmake) add_subdirectory(libmd5) add_subdirectory(liblodepng) |