Commit 19e8991f authored by Rudolf Weeber's avatar Rudolf Weeber
Browse files

CMake: Make doc target and additional CXX warning flags switchable

parent 70f9ecfc
......@@ -64,6 +64,7 @@ option ( WALBERLA_BUILD_BENCHMARKS "Build Benchmarks"
option ( WALBERLA_BUILD_TOOLS "Build Tools" )
option ( WALBERLA_BUILD_TUTORIALS "Build Tutorials" ON )
option ( WALBERLA_BUILD_SHOWCASES "Build Showcases" OFF )
option ( WALBERLA_BUILD_DOC "Build Documentation" ON )
option ( WALBERLA_BUILD_WITH_MPI "Build with MPI" ON )
option ( WALBERLA_BUILD_WITH_METIS "Build with metis graph partitioner" OFF )
......@@ -113,7 +114,7 @@ SET_PROPERTY( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release DebugOptimiz
option ( WALBERLA_STL_BOUNDS_CHECKS "Use debug capabilites of libstd++: iterator and bounds checks" )
# Warning options
option ( WARNING_DISABLE "Disables additional compiler warnings" OFF )
option ( WALBERLA_WARNING_DISABLE "Disables additional compiler warnings" OFF )
option ( WARNING_PEDANTIC "Enables pedantic compiler warnings" ON )
option ( WARNING_ERROR "Convert warnings to errors compiler warnings" OFF )
option ( WARNING_DEPRECATED "Show warning when deprecated features are used" ON )
......@@ -275,8 +276,10 @@ set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF )
# common flags for intel and g++
if( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_INTEL )
add_flag ( CMAKE_CXX_FLAGS "-Wall -Wconversion -Wshadow" )
if (!WALBERLA_WARNING_DISABLE)
if( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_INTEL )
add_flag ( CMAKE_CXX_FLAGS "-Wall -Wconversion -Wshadow" )
endif()
endif()
# C++ language features for NEC compiler
......@@ -613,12 +616,13 @@ if ( WALBERLA_BUILD_WITH_PYTHON )
endif()
# Sphinx documentation
# to build documentation make sure to have sphinx and read-the-docs theme installed
# Install with: "pip install sphinx sphinx_rtd_theme"
add_custom_target( docPython sphinx-build -b html "${walberla_SOURCE_DIR}/python/waLBerla_docs" "${walberla_BINARY_DIR}/doc/python"
COMMENT "Building HTML documentation for Python extension with Sphinx")
if(WALBERLA_BUILD_DOC)
# Sphinx documentation
# to build documentation make sure to have sphinx and read-the-docs theme installed
# Install with: "pip install sphinx sphinx_rtd_theme"
add_custom_target( docPython sphinx-build -b html "${walberla_SOURCE_DIR}/python/waLBerla_docs" "${walberla_BINARY_DIR}/doc/python"
COMMENT "Building HTML documentation for Python extension with Sphinx")
endif()
endif()
......@@ -1235,28 +1239,32 @@ endif()
############################################################################################################################
# Documentation Generation
#
# Build documentation using Doxygen (www.doxygen.org)
############################################################################################################################
find_package ( Doxygen )
find_package ( HTMLHelp )
if ( HTML_HELP_COMPILER EQUAL "" )
set ( HTML_HELP_FOUND "NO" )
else ( )
set ( HTML_HELP_FOUND "YES" )
endif ( )
if ( DOXYGEN_FOUND )
set ( DOXYGEN_HTML_HEADER ${walberla_SOURCE_DIR}/doc/header.html )
set ( DOXYGEN_HTML_FOOTER ${walberla_SOURCE_DIR}/doc/footer.html )
set ( DOXYGEN_HTML_OUTPUT "html" )
configure_file ( ${walberla_SOURCE_DIR}/doc/doxygen.in ${walberla_BINARY_DIR}/doc/doxygen.cfg @ONLY )
add_custom_target ( doc ${DOXYGEN_EXECUTABLE} ${walberla_BINARY_DIR}/doc/doxygen.cfg
COMMENT "Generating API documentation with Doxygen" VERBATIM )
if (WALBERLA_BUILD_DOC)
# Build documentation using Doxygen (www.doxygen.org)
############################################################################################################################
find_package ( Doxygen )
find_package ( HTMLHelp )
if ( HTML_HELP_COMPILER EQUAL "" )
set ( HTML_HELP_FOUND "NO" )
else ( )
set ( HTML_HELP_FOUND "YES" )
endif ( )
if ( DOXYGEN_FOUND )
set ( DOXYGEN_HTML_HEADER ${walberla_SOURCE_DIR}/doc/header.html )
set ( DOXYGEN_HTML_FOOTER ${walberla_SOURCE_DIR}/doc/footer.html )
set ( DOXYGEN_HTML_OUTPUT "html" )
configure_file ( ${walberla_SOURCE_DIR}/doc/doxygen.in ${walberla_BINARY_DIR}/doc/doxygen.cfg @ONLY )
add_custom_target ( doc ${DOXYGEN_EXECUTABLE} ${walberla_BINARY_DIR}/doc/doxygen.cfg
COMMENT "Generating API documentation with Doxygen" VERBATIM )
endif ( )
endif()
endif ( )
############################################################################################################################
......
Supports Markdown
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