Compare commits

...

2 Commits

3 changed files with 22 additions and 16 deletions

View File

@ -18,18 +18,20 @@ macro(CHECK_ENABLE_CXX_FLAG flag)
endmacro() endmacro()
macro(CHECK_ENABLE_DEBUG_CXX_FLAG flag) macro(CHECK_ENABLE_DEBUG_CXX_FLAG flag)
set(CMAKE_REQUIRED_QUIET TRUE) if(CMAKE_BUILD_TYPE STREQUAL "Debug")
check_cxx_compiler_flag("${flag}" CHECK_CXX_FLAG_DEBUG) set(CMAKE_REQUIRED_QUIET TRUE)
unset(CMAKE_REQUIRED_QUIET) check_cxx_compiler_flag("${flag}" CHECK_CXX_FLAG_DEBUG)
unset(CMAKE_REQUIRED_QUIET)
if(CHECK_CXX_FLAG_DEBUG) if(CHECK_CXX_FLAG_DEBUG)
message(STATUS "'${flag}': debug flag is supported.") message(STATUS "'${flag}': debug flag is supported.")
string(CONCAT _CMLIB_DETECTED_CXX_FLAGS_DEBUG "${_CMLIB_DETECTED_CXX_FLAGS_DEBUG} ${flag}") string(CONCAT _CMLIB_DETECTED_CXX_FLAGS_DEBUG "${_CMLIB_DETECTED_CXX_FLAGS_DEBUG} ${flag}")
else() else()
message(STATUS "'${flag}': debug flag is NOT supported.") message(STATUS "'${flag}': debug flag is NOT supported.")
endif()
# NOTE: check_cxx_compiler stores variables in the cache.
unset(CHECK_CXX_FLAG_DEBUG CACHE)
endif() endif()
# NOTE: check_cxx_compiler stores variables in the cache.
unset(CHECK_CXX_FLAG_DEBUG CACHE)
endmacro() endmacro()
function(cmlib_set_cxx_standard version) function(cmlib_set_cxx_standard version)

View File

@ -68,9 +68,11 @@ function(add_breathe_target target)
${RST_FILES} ${WORK_DIR}) ${RST_FILES} ${WORK_DIR})
endif() endif()
endif() endif()
install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/breathe/ install(
COMPONENT doc OPTIONAL DIRECTORY ${CMAKE_BINARY_DIR}/doc/breathe/
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/breathe) COMPONENT doc
OPTIONAL
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/breathe)
else() else()
message(STATUS "CMLIB warning:") message(STATUS "CMLIB warning:")
add_custom_target(${target} VERBATIM COMMENT " Breathe is not found. Skipping target ${target} build") add_custom_target(${target} VERBATIM COMMENT " Breathe is not found. Skipping target ${target} build")

View File

@ -35,9 +35,11 @@ function(add_doxygen_target target)
COMMAND ${DOXYGEN_EXECUTABLE} ${work_dir}/Doxyfile COMMAND ${DOXYGEN_EXECUTABLE} ${work_dir}/Doxyfile
WORKING_DIRECTORY ${work_dir} WORKING_DIRECTORY ${work_dir}
COMMENT "Generating API documentation with Doxygen") COMMENT "Generating API documentation with Doxygen")
install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/doxygen/html/ install(
COMPONENT doc OPTIONAL DIRECTORY ${CMAKE_BINARY_DIR}/doc/doxygen/html/
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/doxygen) COMPONENT doc
OPTIONAL
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/doxygen)
else() else()
message(STATUS "CMLIB warning:") message(STATUS "CMLIB warning:")
add_custom_target(${target} VERBATIM COMMENT " Doxygen is not found. Skipping target ${target} build") add_custom_target(${target} VERBATIM COMMENT " Doxygen is not found. Skipping target ${target} build")