Project Started with a basic template with cmake

This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2024-04-23 22:07:38 -03:00
parent 2071e185a4
commit 5d080d092d
7 changed files with 2751 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
include(FindLATEX)
option(DOCS "Build The Documentation")
find_package(Doxygen)
find_package(LATEX COMPONENTS PDFLATEX REQUIRED)
if(DOXYGEN_FOUND)
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/../docs/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
# Note the option ALL which allows to build the docs together with the application
add_custom_target(doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
if(LATEX_PDFLATEX_FOUND)
if(UNIX)
set(MAKE_COMMAND "make")
elseif(WIN32)
set(MAKE_COMMAND "make.bat")
endif()
message("PDFLATEX Found: ${PDFLATEX_COMPILER}")
file(MAKE_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/docs)
set(PDF_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/bin/docs")
add_custom_target(
build_docs_pdf ALL
COMMAND ${MAKE_COMMAND}
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/build/docs/latex"
COMMENT "Building PDF Documentation..."
VERBATIM
)
add_custom_command(
TARGET build_docs_pdf POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/build/docs/latex/refman.pdf"
"${PDF_OUTPUT_DIR}/Contarius.pdf"
COMMENT "Copying PDF documentation to ${PDF_OUTPUT_DIR}..."
)
else()
message(FATAL_ERROR "pdflatex not found. LaTeX is required to build the documentation.")
endif()
else (DOXYGEN_FOUND)
message("Doxygen needs to be installed to generate the Doxygen documentation")
endif (DOXYGEN_FOUND)
+2649
View File
File diff suppressed because it is too large Load Diff