From 948774272c4011a8aeda99bfa250bdd5693a5111 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 10 Aug 2019 10:30:01 +0300 Subject: [PATCH 01/12] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D1=91?= =?UTF-8?q?=D0=BD=20=D1=83=D1=80=D0=BE=D0=B2=D0=B5=D0=BD=D1=8C=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=B4=D1=83=D0=BF=D1=80=D0=B5=D0=B6=D0=B4=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCodeAnalysisClangAnalyze.cmake | 3 ++- CMLibCodeAnalysisClangTidy.cmake | 3 ++- CMLibCodeAnalysisClazy.cmake | 3 ++- CMLibCodeAnalysisPvsStudio.cmake | 3 ++- CMLibFormatSources.cmake | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMLibCodeAnalysisClangAnalyze.cmake b/CMLibCodeAnalysisClangAnalyze.cmake index 61ec74f..394bf76 100644 --- a/CMLibCodeAnalysisClangAnalyze.cmake +++ b/CMLibCodeAnalysisClangAnalyze.cmake @@ -19,7 +19,8 @@ function(add_clang_analyze_check) add_dependencies(clang-analyze-check-${_target} ${_target}) add_dependencies(clang-analyze-check clang-analyze-check-${_target}) else() - message(WARNING "ClangCheck is not found") + message(STATUS "CMLIB warning:") + message(STATUS " Clang-Check analyzer is not found") endif() endfunction() diff --git a/CMLibCodeAnalysisClangTidy.cmake b/CMLibCodeAnalysisClangTidy.cmake index faae583..0292670 100644 --- a/CMLibCodeAnalysisClangTidy.cmake +++ b/CMLibCodeAnalysisClangTidy.cmake @@ -19,7 +19,8 @@ function(add_clang_tidy_check) add_dependencies(clang-tidy-check-${_target} ${_target}) add_dependencies(clang-tidy-check clang-tidy-check-${_target}) else() - message(WARNING "ClangTidy is not found") + message(STATUS "CMLIB warning:") + message(STATUS " ClangTidy analyzer is not found") endif() endfunction() diff --git a/CMLibCodeAnalysisClazy.cmake b/CMLibCodeAnalysisClazy.cmake index 7c886a3..664a144 100644 --- a/CMLibCodeAnalysisClazy.cmake +++ b/CMLibCodeAnalysisClazy.cmake @@ -15,7 +15,8 @@ function(add_clazy_check) add_dependencies(clazy-check-${_target} ${_target}) add_dependencies(clazy-check clazy-check-${_target}) else() - message(WARNING "Clazy is not found") + message(STATUS "CMLIB warning:") + message(STATUS " Clazy analyzer is not found") endif() endfunction() diff --git a/CMLibCodeAnalysisPvsStudio.cmake b/CMLibCodeAnalysisPvsStudio.cmake index d8b0b36..17a35d2 100644 --- a/CMLibCodeAnalysisPvsStudio.cmake +++ b/CMLibCodeAnalysisPvsStudio.cmake @@ -18,7 +18,8 @@ function(add_pvs_check) MODE GA:1,2,3;64:1;OP:1,2;CS:1,2) add_dependencies(pvs-check pvs-check-${_target}) else() - message(WARNING "PVS-Studio is not found") + message(STATUS "CMLIB warning:") + message(STATUS " PVS-Studio analyzer is not found") endif() else() message(WARNING "Option CMAKE_EXPORT_COMPILE_COMMANDS is not set. PVS checks will be disabled.") diff --git a/CMLibFormatSources.cmake b/CMLibFormatSources.cmake index 13d7fc9..9fa0edd 100644 --- a/CMLibFormatSources.cmake +++ b/CMLibFormatSources.cmake @@ -16,6 +16,7 @@ function(add_uncrustify_format) COMMAND ${UNCRUSTIFY_EXE} ${OPTS} ${_sources}) add_dependencies(uncrustify-format uncrustify-format-${_target}) else() - message(WARNING "Uncrustify is not found") + message(STATUS "CMLIB warning:") + message(STATUS " Uncrustify is not found") endif() endfunction() From 9073d51134f4ad016192227a4df82a31082f5cde Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 10 Aug 2019 10:49:37 +0300 Subject: [PATCH 02/12] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20sanitizers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- thirdparty/sanitizers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/sanitizers b/thirdparty/sanitizers index 9b4aec0..26eced8 160000 --- a/thirdparty/sanitizers +++ b/thirdparty/sanitizers @@ -1 +1 @@ -Subproject commit 9b4aec096e3c05124bb46c9d9dc18468b3646e95 +Subproject commit 26eced86d8e759c625b697f6b0588d7a28746725 From 21595e38909ff1efd26001d8e9f3396a7ed060b1 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Tue, 13 Aug 2019 22:09:42 +0300 Subject: [PATCH 03/12] =?UTF-8?q?=D0=A3=D1=80=D0=BE=D0=B2=D0=B5=D0=BD?= =?UTF-8?q?=D1=8C=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCodeAnalysisPvsStudio.cmake | 3 ++- CMLibSanitizers.cmake | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMLibCodeAnalysisPvsStudio.cmake b/CMLibCodeAnalysisPvsStudio.cmake index 17a35d2..c7bac77 100644 --- a/CMLibCodeAnalysisPvsStudio.cmake +++ b/CMLibCodeAnalysisPvsStudio.cmake @@ -22,7 +22,8 @@ function(add_pvs_check) message(STATUS " PVS-Studio analyzer is not found") endif() else() - message(WARNING "Option CMAKE_EXPORT_COMPILE_COMMANDS is not set. PVS checks will be disabled.") + message(STATUS "CMLIB warning:") + message(STATUS " Option CMAKE_EXPORT_COMPILE_COMMANDS is not set. PVS checks will be disabled.") endif() endfunction() diff --git a/CMLibSanitizers.cmake b/CMLibSanitizers.cmake index d5dc6c2..be3d883 100644 --- a/CMLibSanitizers.cmake +++ b/CMLibSanitizers.cmake @@ -4,7 +4,8 @@ if(IS_DIRECTORY "${CMLIB_MODULE_DIR}") list(APPEND CMAKE_MODULE_PATH ${CMLIB_SANITIZERS_DIR}) find_package(Sanitizers) else() - message(WARNING "Sanitizers submodule not found.") + message(STATUS "CMLIB warning:") + message(STATUS " Sanitizers submodule is not found.") endif() else() message(FATAL_ERROR "CMLib directory not found.") From d759666a01591bae50a76b9953cc7f989f20e7c1 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 17 Aug 2019 06:04:04 +0300 Subject: [PATCH 04/12] =?UTF-8?q?=D0=A4=D1=83=D0=BD=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20=D1=81=20=D0=BF=D0=BE=D0=BC=D0=BE=D1=89?= =?UTF-8?q?=D1=8C=D1=8E=20Doxygen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCommon.cmake | 1 + CMLibDoxygen.cmake | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 CMLibDoxygen.cmake diff --git a/CMLibCommon.cmake b/CMLibCommon.cmake index 79dae59..926c71a 100644 --- a/CMLibCommon.cmake +++ b/CMLibCommon.cmake @@ -39,6 +39,7 @@ include(CMLibSanitizers) include(cotire) include(CMLibFormatSources) +include(CMLibDoxygen) include(CMLibBreathe) include(CMLibQtTranslation) include(CMLibToday) diff --git a/CMLibDoxygen.cmake b/CMLibDoxygen.cmake new file mode 100644 index 0000000..3531048 --- /dev/null +++ b/CMLibDoxygen.cmake @@ -0,0 +1,24 @@ +option(BUILD_DOXYGEN_DOC "Build documentation with Doxygen" OFF) +set_property(CACHE BUILD_DOXYGEN_DOC PROPERTY STRINGS ON OFF) + +function(add_doxygen_target) + if (BUILD_DOXYGEN_DOC) + find_package(Doxygen REQUIRED) + + set(options) + set(oneValueArgs TARGET_NAME IN OUT) + set(multiValueArgs) + + cmake_parse_arguments(_DOXYGEN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + configure_file(${_DOXYGEN_IN} ${_DOXYGEN_OUT} @ONLY) + message("Doxygen build started") + + add_custom_target(${_DOXYGEN_TARGET} + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM ) + endif() +endfunction() + From 3654fd719eb97bdfd2142ecabce9464b3e1e9b9c Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 17 Aug 2019 06:22:54 +0300 Subject: [PATCH 05/12] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=BE=D0=B5=20=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B5=D0=BE=D0=B1=D1=85?= =?UTF-8?q?=D0=BE=D0=B4=D0=B8=D0=BC=D0=BE=D1=81=D1=82=D0=B8=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BF=D1=83=D1=81=D0=BA=D0=B0=20Breathe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibBreathe.cmake | 95 ++++++++++------------------------------------ 1 file changed, 21 insertions(+), 74 deletions(-) diff --git a/CMLibBreathe.cmake b/CMLibBreathe.cmake index af60256..d72f4d8 100644 --- a/CMLibBreathe.cmake +++ b/CMLibBreathe.cmake @@ -1,85 +1,32 @@ -set(BUILD_BREATHE_DOC AUTO CACHE STRING "Enable documntation in Breathe format") -set_property(CACHE BUILD_BREATHE_DOC PROPERTY STRINGS AUTO ON OFF) +set(BUILD_BREATHE_DOC OFF CACHE STRING "Enable documntation in Breathe format") +set_property(CACHE BUILD_BREATHE_DOC PROPERTY STRINGS ON OFF) -if(BUILD_BREATHE_DOC STREQUAL AUTO) - find_package(Doxygen) - find_package(Perl) - set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2) - find_package(PythonInterp) - if (PYTHONINTERP_FOUND) - find_package(Sphinx) +function(add_breathe_target) + if(BUILD_BREATHE_DOC) + find_package(Doxygen REQUIRED) + find_package(Perl REQUIRED) + set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2) + find_package(PythonInterp REQUIRED) + find_package(Sphinx REQUIRED) include(FindPythonModule) - find_python_module(breathe) - find_python_module(recommonmark) - if(DOXYGEN_FOUND AND PERL_FOUND AND PYTHONINTERP_FOUND AND SPHINX_FOUND AND breathe_FOUND AND recommonmark_FOUND) - set(BUILD_BREATHE_DOC ON CACHE STRING "Enable documntation in Breathe format" FORCE) - else() - set(BUILD_BREATHE_DOC OFF CACHE STRING "Disable documentation in Breathe format" FORCE) - endif() - else() - set(BUILD_BREATHE_DOC OFF CACHE STRING "Disable documentation in Breathe format" FORCE) - endif() -elseif(BUILD_BREATHE_DOC) - find_package(Doxygen REQUIRED) - find_package(Perl REQUIRED) - set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2) - find_package(PythonInterp REQUIRED) - find_package(Sphinx REQUIRED) - include(FindPythonModule) - find_python_module(breathe REQUIRED) - find_python_module(recommonmark REQUIRED) - set(BUILD_BREATHE_DOC ON CACHE STRING "Enable documentation in Breathe format" FORCE) -else() - set(BUILD_BREATHE_DOC OFF CACHE STRING "Disable documentation in Breathe format" FORCE) -endif() + find_python_module(breathe REQUIRED) + find_python_module(recommonmark REQUIRED) -function(add_breathe_doc) - if(BUILD_BREATHE_DOC AND CMAKE_BUILD_TYPE STREQUAL Release) set(options) - set(oneValueArgs - SOURCE_DIR - BUILD_DIR - CACHE_DIR - HTML_DIR - DOXY_FILE - CONF_FILE - TARGET_NAME - COMMENT - ) + set(oneValueArgs SOURCE_DIR BUILD_DIR CACHE_DIR HTML_DIR DOXY_FILE CONF_FILE TARGET_NAME COMMENT) set(multiValueArgs) - cmake_parse_arguments(BREATHE_DOC - "${options}" - "${oneValueArgs}" - "${multiValueArgs}" - ${ARGN} - ) + cmake_parse_arguments(_BREATHE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - configure_file( - ${BREATHE_DOC_CONF_FILE} - ${BREATHE_DOC_BUILD_DIR}/conf.py - @ONLY - ) + configure_file(${_BREATHE_CONF_FILE} ${_BREATHE_BUILD_DIR}/conf.py @ONLY) + configure_file(${_BREATHE_DOXY_FILE} ${_BREATHE_BUILD_DIR}/Doxyfile @ONLY) - configure_file( - ${BREATHE_DOC_DOXY_FILE} - ${BREATHE_DOC_BUILD_DIR}/Doxyfile - @ONLY - ) - - add_custom_target(${BREATHE_DOC_TARGET_NAME} - ALL - COMMAND - ${SPHINX_EXECUTABLE} - -q - -b html - -c ${BREATHE_DOC_BUILD_DIR} - -d ${BREATHE_DOC_CACHE_DIR} - ${BREATHE_DOC_SOURCE_DIR} - ${BREATHE_DOC_HTML_DIR} - COMMENT - "Building ${BREATHE_DOC_TARGET_NAME} documentation with Breathe, Sphinx and Doxygen" - VERBATIM + add_custom_target(${_BREATHE_TARGET_NAME} ALL VERBATIM + COMMAND ${SPHINX_EXECUTABLE} -q -b html -c ${_BREATHE_BUILD_DIR} + -d ${_BREATHE_CACHE_DIR} + ${_BREATHE_SOURCE_DIR} + ${_BREATHE_HTML_DIR} + COMMENT "Building ${_BREATHE_TARGET_NAME} documentation with Breathe" ) endif() endfunction() From 25218a634d3a97975c4f3e891bd40f28a53de8d8 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 17 Aug 2019 06:36:47 +0300 Subject: [PATCH 06/12] =?UTF-8?q?=D0=9F=D0=B0=D1=80=D0=B0=D0=BC=D0=B5?= =?UTF-8?q?=D1=82=D1=80=D1=8B=20=D1=86=D0=B5=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibBreathe.cmake | 2 +- CMLibDoxygen.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMLibBreathe.cmake b/CMLibBreathe.cmake index d72f4d8..37ea098 100644 --- a/CMLibBreathe.cmake +++ b/CMLibBreathe.cmake @@ -21,7 +21,7 @@ function(add_breathe_target) configure_file(${_BREATHE_CONF_FILE} ${_BREATHE_BUILD_DIR}/conf.py @ONLY) configure_file(${_BREATHE_DOXY_FILE} ${_BREATHE_BUILD_DIR}/Doxyfile @ONLY) - add_custom_target(${_BREATHE_TARGET_NAME} ALL VERBATIM + add_custom_target(${_BREATHE_TARGET_NAME} VERBATIM COMMAND ${SPHINX_EXECUTABLE} -q -b html -c ${_BREATHE_BUILD_DIR} -d ${_BREATHE_CACHE_DIR} ${_BREATHE_SOURCE_DIR} diff --git a/CMLibDoxygen.cmake b/CMLibDoxygen.cmake index 3531048..a59a12a 100644 --- a/CMLibDoxygen.cmake +++ b/CMLibDoxygen.cmake @@ -14,7 +14,7 @@ function(add_doxygen_target) configure_file(${_DOXYGEN_IN} ${_DOXYGEN_OUT} @ONLY) message("Doxygen build started") - add_custom_target(${_DOXYGEN_TARGET} + add_custom_target(${_DOXYGEN_TARGET} VERBATIM COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" From 7367dcfe4dcdd8f5d95190cd43b6e02669aa8788 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 17 Aug 2019 06:53:59 +0300 Subject: [PATCH 07/12] =?UTF-8?q?=D0=98=D0=BC=D1=8F=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibDoxygen.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMLibDoxygen.cmake b/CMLibDoxygen.cmake index a59a12a..95816a6 100644 --- a/CMLibDoxygen.cmake +++ b/CMLibDoxygen.cmake @@ -14,7 +14,7 @@ function(add_doxygen_target) configure_file(${_DOXYGEN_IN} ${_DOXYGEN_OUT} @ONLY) message("Doxygen build started") - add_custom_target(${_DOXYGEN_TARGET} VERBATIM + add_custom_target(${_DOXYGEN_TARGET_NAME} VERBATIM COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" From d254803ed1a27f734b6a5b2d1a52b74cdf56a525 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 17 Aug 2019 11:19:08 +0300 Subject: [PATCH 08/12] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B9=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibBreathe.cmake | 37 +++++++++++++++++++++++++------------ CMLibDoxygen.cmake | 22 +++++++++++++++------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/CMLibBreathe.cmake b/CMLibBreathe.cmake index 37ea098..9156701 100644 --- a/CMLibBreathe.cmake +++ b/CMLibBreathe.cmake @@ -1,17 +1,27 @@ -set(BUILD_BREATHE_DOC OFF CACHE STRING "Enable documntation in Breathe format") -set_property(CACHE BUILD_BREATHE_DOC PROPERTY STRINGS ON OFF) +set(BREATHE_FOUND AUTO CACHE STRING "Enable Breathe documentation generator") +set_property(CACHE BREATHE_FOUND PROPERTY STRINGS ON OFF AUTO) + +find_package(Doxygen) +find_package(Perl) +set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2) +find_package(PythonInterp) +if (PYTHONINTERP_FOUND) + find_package(Sphinx) + include(FindPythonModule) + find_python_module(breathe) + find_python_module(recommonmark) + if(DOXYGEN_FOUND AND PERL_FOUND AND PYTHONINTERP_FOUND AND SPHINX_FOUND AND breathe_FOUND AND recommonmark_FOUND) + set(BREATHE_FOUND ON CACHE FORCE) + else() + set(BREATHE_FOUND OFF CACHE FORCE) + endif() +else() + set(BREATHE_FOUND OFF CACHE FORCE) +endif() + function(add_breathe_target) - if(BUILD_BREATHE_DOC) - find_package(Doxygen REQUIRED) - find_package(Perl REQUIRED) - set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2) - find_package(PythonInterp REQUIRED) - find_package(Sphinx REQUIRED) - include(FindPythonModule) - find_python_module(breathe REQUIRED) - find_python_module(recommonmark REQUIRED) - + if(BREATHE_FOUND) set(options) set(oneValueArgs SOURCE_DIR BUILD_DIR CACHE_DIR HTML_DIR DOXY_FILE CONF_FILE TARGET_NAME COMMENT) set(multiValueArgs) @@ -28,5 +38,8 @@ function(add_breathe_target) ${_BREATHE_HTML_DIR} COMMENT "Building ${_BREATHE_TARGET_NAME} documentation with Breathe" ) + else() + add_custom_target(${_BREATHE_TARGET_NAME} VERBATIM + COMMENT "Breathe is not found. Skipping target ${_BREATHE_TARGET_NAME} build") endif() endfunction() diff --git a/CMLibDoxygen.cmake b/CMLibDoxygen.cmake index 95816a6..9014e8c 100644 --- a/CMLibDoxygen.cmake +++ b/CMLibDoxygen.cmake @@ -1,10 +1,16 @@ -option(BUILD_DOXYGEN_DOC "Build documentation with Doxygen" OFF) -set_property(CACHE BUILD_DOXYGEN_DOC PROPERTY STRINGS ON OFF) +set(DOXYGEN_FOUND AUTO CACHE STRING "Enable Doxygen documentation generator") +set_property(CACHE DOXYGEN_FOUND PROPERTY STRINGS ON OFF AUTO) + +find_package(Doxygen) +if (DOXYGEN_FOUND) + set(DOXYGEN_FOUND ON CACHE FORCE) +else() + set(DOXYGEN_FOUND OFF CACHE FORCE) +endif() + function(add_doxygen_target) - if (BUILD_DOXYGEN_DOC) - find_package(Doxygen REQUIRED) - + if (DOXYGEN_FOUND) set(options) set(oneValueArgs TARGET_NAME IN OUT) set(multiValueArgs) @@ -18,7 +24,9 @@ function(add_doxygen_target) COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" - VERBATIM ) + VERBATIM) + else() + add_custom_target(${_DOXYGEN_TARGET_NAME} VERBATIM + COMMENT "Doxygen is not found. Skipping target ${_BREATHE_TARGET_NAME} build") endif() endfunction() - From 6c0df3775aed875227cb325c9a514e5db995c230 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 17 Aug 2019 11:19:08 +0300 Subject: [PATCH 09/12] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B9=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibBreathe.cmake | 37 +++++++++++++++++++++++++------------ CMLibDoxygen.cmake | 22 +++++++++++++++------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/CMLibBreathe.cmake b/CMLibBreathe.cmake index 37ea098..85f07b2 100644 --- a/CMLibBreathe.cmake +++ b/CMLibBreathe.cmake @@ -1,17 +1,27 @@ -set(BUILD_BREATHE_DOC OFF CACHE STRING "Enable documntation in Breathe format") -set_property(CACHE BUILD_BREATHE_DOC PROPERTY STRINGS ON OFF) +set(BREATHE_FOUND AUTO CACHE STRING "Enable Breathe documentation generator") +set_property(CACHE BREATHE_FOUND PROPERTY STRINGS ON OFF AUTO) + +find_package(Doxygen) +find_package(Perl) +set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2) +find_package(PythonInterp) +if (PYTHONINTERP_FOUND) + find_package(Sphinx) + include(FindPythonModule) + find_python_module(breathe) + find_python_module(recommonmark) + if(DOXYGEN_FOUND AND PERL_FOUND AND PYTHONINTERP_FOUND AND SPHINX_FOUND AND breathe_FOUND AND recommonmark_FOUND) + set(BREATHE_FOUND ON CACHE STRING "Breathe documentation generator enabled" FORCE) + else() + set(BREATHE_FOUND OFF CACHE STRING "Breathe documentation generator disabled" FORCE) + endif() +else() + set(BREATHE_FOUND OFF CACHE FORCE) +endif() + function(add_breathe_target) - if(BUILD_BREATHE_DOC) - find_package(Doxygen REQUIRED) - find_package(Perl REQUIRED) - set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2) - find_package(PythonInterp REQUIRED) - find_package(Sphinx REQUIRED) - include(FindPythonModule) - find_python_module(breathe REQUIRED) - find_python_module(recommonmark REQUIRED) - + if(BREATHE_FOUND) set(options) set(oneValueArgs SOURCE_DIR BUILD_DIR CACHE_DIR HTML_DIR DOXY_FILE CONF_FILE TARGET_NAME COMMENT) set(multiValueArgs) @@ -28,5 +38,8 @@ function(add_breathe_target) ${_BREATHE_HTML_DIR} COMMENT "Building ${_BREATHE_TARGET_NAME} documentation with Breathe" ) + else() + add_custom_target(${_BREATHE_TARGET_NAME} VERBATIM + COMMENT "Breathe is not found. Skipping target ${_BREATHE_TARGET_NAME} build") endif() endfunction() diff --git a/CMLibDoxygen.cmake b/CMLibDoxygen.cmake index 95816a6..370ec38 100644 --- a/CMLibDoxygen.cmake +++ b/CMLibDoxygen.cmake @@ -1,10 +1,16 @@ -option(BUILD_DOXYGEN_DOC "Build documentation with Doxygen" OFF) -set_property(CACHE BUILD_DOXYGEN_DOC PROPERTY STRINGS ON OFF) +set(DOXYGEN_FOUND AUTO CACHE STRING "Enable Doxygen documentation generator") +set_property(CACHE DOXYGEN_FOUND PROPERTY STRINGS ON OFF AUTO) + +find_package(Doxygen) +if (DOXYGEN_FOUND) + set(DOXYGEN_FOUND ON CACHE STRING "Doxygen documentation generator enabled" FORCE) +else() + set(DOXYGEN_FOUND OFF CACHE STRING "Doxygen documentation generator disabled" FORCE) +endif() + function(add_doxygen_target) - if (BUILD_DOXYGEN_DOC) - find_package(Doxygen REQUIRED) - + if (DOXYGEN_FOUND) set(options) set(oneValueArgs TARGET_NAME IN OUT) set(multiValueArgs) @@ -18,7 +24,9 @@ function(add_doxygen_target) COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" - VERBATIM ) + VERBATIM) + else() + add_custom_target(${_DOXYGEN_TARGET_NAME} VERBATIM + COMMENT "Doxygen is not found. Skipping target ${_BREATHE_TARGET_NAME} build") endif() endfunction() - From 3a0bb2b48071ad4982015f44c843882d6b2ff5fd Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 17 Aug 2019 11:47:49 +0300 Subject: [PATCH 10/12] =?UTF-8?q?Breathe=20=D1=83=D1=81=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibBreathe.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMLibBreathe.cmake b/CMLibBreathe.cmake index 85f07b2..b082331 100644 --- a/CMLibBreathe.cmake +++ b/CMLibBreathe.cmake @@ -10,7 +10,7 @@ if (PYTHONINTERP_FOUND) include(FindPythonModule) find_python_module(breathe) find_python_module(recommonmark) - if(DOXYGEN_FOUND AND PERL_FOUND AND PYTHONINTERP_FOUND AND SPHINX_FOUND AND breathe_FOUND AND recommonmark_FOUND) + if(DOXYGEN_FOUND AND PERL_FOUND AND PYTHONINTERP_FOUND AND SPHINX_EXECUTABLE AND breathe AND recommonmark) set(BREATHE_FOUND ON CACHE STRING "Breathe documentation generator enabled" FORCE) else() set(BREATHE_FOUND OFF CACHE STRING "Breathe documentation generator disabled" FORCE) From 9c371dc1a297fc501d0d2e3fa5ce89cdf5cd5cbb Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Wed, 21 Aug 2019 06:47:51 +0300 Subject: [PATCH 11/12] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibBreathe.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMLibBreathe.cmake b/CMLibBreathe.cmake index b082331..f995488 100644 --- a/CMLibBreathe.cmake +++ b/CMLibBreathe.cmake @@ -16,7 +16,7 @@ if (PYTHONINTERP_FOUND) set(BREATHE_FOUND OFF CACHE STRING "Breathe documentation generator disabled" FORCE) endif() else() - set(BREATHE_FOUND OFF CACHE FORCE) + set(BREATHE_FOUND OFF CACHE STRING "Breathe documentation generator disabled" FORCE) endif() From 5ca58eda09757118e8f847174d13bc3de59f614d Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Thu, 22 Aug 2019 07:30:50 +0300 Subject: [PATCH 12/12] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=B2?= =?UTF-8?q?=D0=B0=D1=80=D0=B8=D0=B0=D0=BD=D1=82=20=D0=BE=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=BA=D0=B8=20=D1=84=D0=BB=D0=B0=D0=B3=D0=B0?= =?UTF-8?q?=20-flto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCompilerFlags.cmake | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/CMLibCompilerFlags.cmake b/CMLibCompilerFlags.cmake index e060008..24db8a4 100644 --- a/CMLibCompilerFlags.cmake +++ b/CMLibCompilerFlags.cmake @@ -88,11 +88,26 @@ if(CMAKE_CXX_COMPILER_IS_CLANG endif() if(CMAKE_BUILD_TYPE STREQUAL "Release") - check_enable_cxx_flag(-flto) - if(CMAKE_CXX_COMPILER_IS_GCC - AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8") - # Doesn't work with GCC 4.7.2 in Astra Linux 1.5 - check_enable_cxx_flag(-fno-fat-lto-objects) + check_cxx_compiler_flag(-flto CXX_HAS_LTO_FLAG) + check_cxx_compiler_flag(-fno-fat-lto-objects CXX_HAS_NO_FAT_LTO_FLAG) + if(CMAKE_CXX_COMPILER_IS_GCC AND CXX_HAS_LTO_FLAG) + find_program(CMAKE_GCC_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + find_program(CMAKE_GCC_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + find_program(CMAKE_GCC_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + if(CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto") + if(CXX_HAS_NO_FAT_LTO_FLAG) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-fat-lto-objects") + endif() + set(CMAKE_AR "${CMAKE_GCC_AR}") + set(CMAKE_NM "${CMAKE_GCC_NM}") + set(CMAKE_RANLIB "${CMAKE_GCC_RANLIB}") + else() + message(WARNING "GCC indicates LTO support, but binutils wrappers could not be found. Disabling LTO.") + endif() + else() + check_enable_compiler_flag(-flto) + check_enable_compiler_flag(-fno-fat-lto-objects) endif() endif() endif()