diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c55859..ba105b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ project(doxygen) option(build_wizard "Build the GUI frontend for doxygen." OFF) option(build_app "Example showing how to embed doxygen in an application." OFF) +option(build_parse "Parses source code and dumps the dependencies between the code elements." OFF) option(build_xmlparser "Example showing how to parse doxygen's XML output." OFF) option(build_search "Build external search tools (doxysearch and doxyindexer)" OFF) option(build_doc "Build user manual" OFF) @@ -34,34 +35,49 @@ 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.5) if (use_libclang) set(clang "1" CACHE INTERNAL "used in settings.h") - find_package(LibClang REQUIRED) + find_package(LLVM CONFIG REQUIRED) + find_package(Clang CONFIG REQUIRED) + if (CMAKE_SYSTEM MATCHES "Darwin") + set(MACOS_VERSION_MIN 10.11) + endif() endif() -if (${CMAKE_SYSTEM} MATCHES "Darwin") - set(CMAKE_CXX_FLAGS "-Wno-deprecated-register -mmacosx-version-min=10.5 ${CMAKE_CXX_FLAGS}") - set(CMAKE_C_FLAGS "-Wno-deprecated-register -mmacosx-version-min=10.5 ${CMAKE_C_FLAGS}") +if (CMAKE_SYSTEM MATCHES "Darwin") + set(CMAKE_CXX_FLAGS "-Wno-deprecated-register -mmacosx-version-min=${MACOS_VERSION_MIN} ${CMAKE_CXX_FLAGS}") + set(CMAKE_C_FLAGS "-Wno-deprecated-register -mmacosx-version-min=${MACOS_VERSION_MIN} ${CMAKE_C_FLAGS}") find_library(CORESERVICES_LIB CoreServices) set(EXTRA_LIBS ${CORESERVICES_LIB}) endif() if (WIN32) - if(NOT ICONV_DIR) - set(ICONV_DIR "${CMAKE_SOURCE_DIR}/winbuild") + if (NOT CMAKE_GENERATOR MATCHES "MinGW Makefiles") + if (NOT ICONV_DIR) + set(ICONV_DIR "${CMAKE_SOURCE_DIR}/winbuild") + endif() + set(CMAKE_REQUIRED_DEFINITIONS "-DLIBICONV_STATIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # needed for language.cpp on 64bit + add_definitions(-DLIBICONV_STATIC -D_CRT_SECURE_NO_WARNINGS) endif() - set(CMAKE_REQUIRED_DEFINITIONS "-DLIBICONV_STATIC") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # needed for language.cpp on 64bit - add_definitions(-DLIBICONV_STATIC -D_CRT_SECURE_NO_WARNINGS) endif() -if ("${CMAKE_GENERATOR}" MATCHES "Ninja") +if(POLICY CMP0063) + cmake_policy(SET CMP0063 NEW) +endif() +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_C_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + +if (CMAKE_GENERATOR MATCHES "Ninja") set(LEX_FLAGS ) set(YACC_FLAGS ) -else ("${CMAKE_GENERATOR}" MATCHES "Ninja") +else () set(LEX_FLAGS $(LEX_FLAGS)) set(YACC_FLAGS $(YACC_FLAGS)) -endif ("${CMAKE_GENERATOR}" MATCHES "Ninja") +endif () find_program(DOT NAMES dot) find_package(PythonInterp REQUIRED) @@ -83,8 +99,6 @@ set(ENV{DOXYGEN_DOCDIR} ${DOXYDOCS}) set(GENERATED_SRC "${CMAKE_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) -set(CUSTOM_INCLUDE_DIR "" CACHE FILEPATH "Extra include path") -set(CUSTOM_LINK_DIR "" CACHE FILEPATH "Extra library path") # place binaries for all build types in the same directory, so we know where to find it # when running tests or generating docs @@ -95,25 +109,18 @@ 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") -set(lcodes "") -foreach (_lang ${lang_files}) - string(REGEX REPLACE "translator_(.*).h" "\\1" _lang_code ${_lang}) - string(TOUPPER ${_lang_code} lang_code) - list(APPEND lcodes "${lang_code}") -endforeach() if (english_only) # user only wants English set(lcodes "ENONLY") +else () + set(lcodes "") + foreach (_lang ${lang_files}) + string(REGEX REPLACE "translator_(.*).h" "\\1" _lang_code ${_lang}) + string(TOUPPER ${_lang_code} lang_code) + list(APPEND lcodes "${lang_code}") + endforeach() endif() set(LANG_CODES ${lcodes} CACHE STRING "List of language codes for which translations should be compiled in") -if (${CUSTOM_INCLUDE_DIR}) - include_directories(${CUSTOM_INCLUDE_DIR}) -endif() - -if (${CUSTOM_LINK_DIR}) - link_directories(${CUSTOM_LINK_DIR}) -endif() - if (win_static) set(CompilerFlags CMAKE_CXX_FLAGS @@ -136,13 +143,13 @@ add_subdirectory(libmd5) add_subdirectory(qtools) add_subdirectory(vhdlparser) add_subdirectory(src) -add_subdirectory(examples) -add_subdirectory(doc) -add_subdirectory(addon/doxmlparser) -add_subdirectory(addon/doxyapp) -add_subdirectory(addon/doxysearch) -add_subdirectory(addon/doxywizard) +if (build_doc) + add_subdirectory(examples) + add_subdirectory(doc) +endif () + +add_subdirectory(addon) enable_testing() add_subdirectory(testing) |