changed: move doxy target code to a macro

i forgot to test the common app build way of doing things.
this complicated things enough to warrant a macro
This commit is contained in:
Arne Morten Kvarving 2017-01-31 12:17:04 +01:00
parent a37e6dc6f5
commit f1b9e82060
4 changed files with 34 additions and 0 deletions

View File

@ -201,6 +201,7 @@ else()
cmake/Scripts/CheckCommits.cmake
cmake/Scripts/DownloadGTest.cmake
cmake/Scripts/UseMultiArch.cmake
cmake/Scripts/IFEMDoxy.cmake
cmake/Scripts/IFEMTesting.cmake DESTINATION lib/IFEM)
# source code

View File

@ -156,3 +156,4 @@ if(NOT IFEM_TESTING_INCLUDED)
endif()
set(IFEM_REGTEST_SCRIPT ${IFEM_PATH}/Apps/Common/scripts/regtest.sh.in)
include(../Scripts/IFEMDoxy)

View File

@ -0,0 +1,31 @@
# Add the appropriate target to generate doxy for used build configuration
macro(add_doc_target appname dox)
if(IFEM_AS_SUBMODULE OR IFEM_INTREE_BUILD)
configure_file(${IFEM_PATH}/doc/Doxyfile.in Doxyfile)
else()
configure_file(doc/Doxyfile.in Doxyfile)
endif()
configure_file(doc/${dox}.dox.in ${dox}.dox)
if(IFEM_INSTALL_DOXY)
install(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_BUILD_TOOL} doc WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")" COMPONENT doc)
install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/html DESTINATION ${CMAKE_INSTALL_DOCDIR}/Apps/${appname}
COMPONENT doc
PATTERN *.md5 EXCLUDE
PATTERN *.map EXCLUDE)
endif(IFEM_INSTALL_DOXY)
if(IFEM_COMMON_APP_BUILD)
if(NOT TARGET doc)
add_custom_target(doc)
endif()
add_custom_target(${appname}_doc doxygen ${PROJECT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generating API documentation" VERBATIM)
add_dependencies(doc ${appname}_doc)
else()
add_custom_target(doc doxygen ${PROJECT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generating API documentation" VERBATIM)
endif()
endmacro()

View File

@ -21,4 +21,5 @@ if(NOT IFEM_FOUND)
set_target_properties(IFEMAppCommon PROPERTIES IMPORTED_LOCATION
@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/libIFEMAppCommon${CMAKE_STATIC_LIBRARY_SUFFIX})
set(IFEM_FOUND 1)
include(IFEMDoxy)
endif()