Compare commits

...

2 Commits

8 changed files with 20 additions and 12 deletions

View File

@ -45,5 +45,6 @@ include(CMLibQtTranslation)
include(CMLibToday) include(CMLibToday)
include(CMLibAuxilarySymlinks) include(CMLibAuxilarySymlinks)
include(CMLibConfigHPPGenerate) include(CMLibConfigHPPGenerate)
include(CMLibNinjaGeneratorHelper)
include(CMLibCPack) include(CMLibCPack)
include(CMLibUninstall) include(CMLibUninstall)

View File

@ -54,8 +54,8 @@ function(add_breathe target)
configure_file(${INDEX_MD_FILE} ${WORK_DIR}/index.md @ONLY) configure_file(${INDEX_MD_FILE} ${WORK_DIR}/index.md @ONLY)
file(GLOB MD_FILES ${CMAKE_SOURCE_DIR}/doc/breathe/*.md) file(GLOB MD_FILES ${CMAKE_SOURCE_DIR}/doc/breathe/*.md)
if(MD_FILES) if(MD_FILES)
add_custom_command(TARGET ${target} PRE_BUILD add_custom_command(TARGET ${target} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MD_FILES} ${WORK_DIR}) ${MD_FILES} ${WORK_DIR})
endif() endif()
endif() endif()
@ -64,13 +64,12 @@ function(add_breathe target)
configure_file(${INDEX_RST_FILE} ${WORK_DIR}/index.rst @ONLY) configure_file(${INDEX_RST_FILE} ${WORK_DIR}/index.rst @ONLY)
file(GLOB RST_FILES ${CMAKE_SOURCE_DIR}/doc/breathe/*.rst) file(GLOB RST_FILES ${CMAKE_SOURCE_DIR}/doc/breathe/*.rst)
if(RST_FILES) if(RST_FILES)
add_custom_command(TARGET ${target} PRE_BUILD add_custom_command(TARGET ${target} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RST_FILES} ${WORK_DIR}) ${RST_FILES} ${WORK_DIR})
endif() endif()
endif() endif()
else() else()
message(STATUS "CMLIB warning:") message(STATUS "CMLIB warning:")
add_custom_target(${target} VERBATIM add_custom_target(${target} VERBATIM COMMENT " Breathe is not found. Skipping target ${target} build")
COMMENT " Breathe is not found. Skipping target ${target} build")
endif() endif()
endfunction() endfunction()

View File

@ -37,7 +37,6 @@ function(add_doxygen target)
COMMENT "Generating API documentation with Doxygen") COMMENT "Generating API documentation with Doxygen")
else() else()
message(STATUS "CMLIB warning:") message(STATUS "CMLIB warning:")
add_custom_target(${target} VERBATIM add_custom_target(${target} VERBATIM COMMENT " Doxygen is not found. Skipping target ${target} build")
COMMENT " Doxygen is not found. Skipping target ${target} build")
endif() endif()
endfunction() endfunction()

View File

@ -0,0 +1,9 @@
# Если выбран генератор Ninja, то в основном сборочном каталоге
# создаётся файл Makefile, который обрабатывается командой make и
# передаёт исполнение системе сборки ninja.
# Таким образом можно выполнять команду make, даже если правила
# сборки проекта сгенерированы для ninja.
if("${CMAKE_GENERATOR}" MATCHES ".*Ninja$")
file(WRITE ${CMAKE_BINARY_DIR}/Makefile ".PHONY: build\n%:\n\t@ninja \$@\nbuild:\n\t@ninja\n")
endif()