Commit 1f46229a authored by ESTERIE Pierre's avatar ESTERIE Pierre
Browse files

Adding Doc

parent 194d1b3a
default:
tags: ['docker']
image: registry.gitlab.inria.fr/solverstack/docker/distrib
doc:
stage: doc
artifacts:
name: cpp_tools_doc
expire_in: 1 day
paths:
- build/doc/html
script:
- cd build && cmake ..
-Dcpp_tools_BUILD_DOC=ON
-DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++
- make doc
pages:
stage: pages
dependencies:
- doc
artifacts:
paths:
- public
script:
- mkdir public
- mv build/Doc/html/* public/
only:
- master
cmake_minimum_required (VERSION 3.15.0 FATAL_ERROR)
#
# Project Declaration
#--------------------
project(cpp_tools CXX)
# check if compiling into source directories
string(COMPARE EQUAL "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" insource)
if(insource)
message(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto ./Build and tapes cmake ../")
endif(insource)
#
# Version Number
# --------------
# ${CMAKE_PROJECT_NAME} version number. An even minor number corresponds to releases.
set(${CMAKE_PROJECT_NAME}_MAJOR_VERSION 1)
set(${CMAKE_PROJECT_NAME}_MINOR_VERSION 0)
set(${CMAKE_PROJECT_NAME}_PATCH_VERSION 0-pre-alpha)
set(${CMAKE_PROJECT_NAME}_VERSION "${${CMAKE_PROJECT_NAME}_MAJOR_VERSION}.${${CMAKE_PROJECT_NAME}_MINOR_VERSION}.${${CMAKE_PROJECT_NAME}_PATCH_VERSION}" )
# Register modules
set(${CMAKE_PROJECT_NAME}_MODULES cl_parser colors timers parallel_manager)
message(STATUS "Registered modules : ${${CMAKE_PROJECT_NAME}_MODULES}")
#
# Add - doc
# ---------
option( ${CMAKE_PROJECT_NAME}_BUILD_DOC "Set to ON to build the documentation" OFF )
message(STATUS "${CMAKE_PROJECT_NAME}_BUILD_DOC = ${${CMAKE_PROJECT_NAME}_BUILD_DOC}" )
if(${CMAKE_PROJECT_NAME}_BUILD_DOC)
add_subdirectory(docs)
endif()
#
# Docs
# ----
find_package(Doxygen REQUIRED)
set(DOXYGEN_INPUT_DIR ${CMAKE_SOURCE_DIR})
set(DOXYGEN_INDEX_FILE ${CMAKE_CURRENT_SOURCE_DIR}/html/index.html)
set(DOXYGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/docs/doxygen)
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html)
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
#Replace variables inside @@ with the current values
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)
file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR}) #Doxygen won't create this for us
add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
DEPENDS ${${CMAKE_PROJECT_NAME}_HEADERS}
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN}
COMMENT "Generating docs")
add_custom_target(doc ALL DEPENDS ${DOXYGEN_INDEX_FILE})
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment