Add sphinx as doc target.
This commit is contained in:
parent
ff3ff8d8b2
commit
52ba9d8ebe
|
@ -11,6 +11,7 @@ cmake_policy(SET CMP0048 NEW)
|
||||||
project(wrmath VERSION 0.0.1 LANGUAGES CXX)
|
project(wrmath VERSION 0.0.1 LANGUAGES CXX)
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
||||||
|
|
||||||
# Don't warn on unused functions, because this is a library and not all
|
# Don't warn on unused functions, because this is a library and not all
|
||||||
# functions might be used.
|
# functions might be used.
|
||||||
|
@ -33,16 +34,17 @@ include_directories(include)
|
||||||
file(GLOB_RECURSE ${PROJECT_NAME}_HEADERS include/**.h)
|
file(GLOB_RECURSE ${PROJECT_NAME}_HEADERS include/**.h)
|
||||||
file(GLOB_RECURSE ${PROJECT_NAME}_SOURCES src/*.cc)
|
file(GLOB_RECURSE ${PROJECT_NAME}_SOURCES src/*.cc)
|
||||||
|
|
||||||
message("${${PROJECT_NAME}_SOURCES} -> libwrmath")
|
|
||||||
|
|
||||||
## BUILD
|
## BUILD
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} ${${PROJECT_NAME}_SOURCES})
|
add_library(${PROJECT_NAME} ${${PROJECT_NAME}_SOURCES})
|
||||||
|
|
||||||
add_executable(euler2quat tools/euler2quat.cc)
|
add_executable(euler2quat tools/euler2quat.cc)
|
||||||
target_link_libraries(euler2quat ${PROJECT_NAME})
|
target_link_libraries(euler2quat ${PROJECT_NAME})
|
||||||
set_target_properties(euler2quat PROPERTIES
|
set_target_properties(euler2quat PROPERTIES
|
||||||
FOLDER bin
|
FOLDER bin
|
||||||
RUNTIME_OUTPUT_DIRECTORY bin)
|
RUNTIME_OUTPUT_DIRECTORY bin)
|
||||||
|
|
||||||
add_executable(quaternion tools/quaternion.cc)
|
add_executable(quaternion tools/quaternion.cc)
|
||||||
target_link_libraries(quaternion ${PROJECT_NAME})
|
target_link_libraries(quaternion ${PROJECT_NAME})
|
||||||
set_target_properties(quaternion PROPERTIES
|
set_target_properties(quaternion PROPERTIES
|
||||||
|
@ -51,16 +53,23 @@ set_target_properties(quaternion PROPERTIES
|
||||||
|
|
||||||
## INSTALL
|
## INSTALL
|
||||||
|
|
||||||
|
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
|
||||||
|
install(TARGETS euler2quat DESTINATION bin)
|
||||||
|
install(TARGETS quaternion DESTINATION bin)
|
||||||
install(DIRECTORY include/${PROJECT_NAME}
|
install(DIRECTORY include/${PROJECT_NAME}
|
||||||
DESTINATION include/
|
DESTINATION include/
|
||||||
FILES_MATCHING PATTERN "*.h")
|
FILES_MATCHING PATTERN "*.h")
|
||||||
|
install(DIRECTORY docs/sphinx/_build/html/
|
||||||
|
DESTINATION share/doc/${PROJECT_NAME}
|
||||||
|
FILES_MATCHING PATTERN "*.html")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## TEST
|
## TEST
|
||||||
|
|
||||||
# From Modern CMake:
|
# From Modern CMake:
|
||||||
# https://cliutils.gitlab.io/modern-cmake/chapters/testing/googletest.html
|
# https://cliutils.gitlab.io/modern-cmake/chapters/testing/googletest.html
|
||||||
add_subdirectory("${PROJECT_SOURCE_DIR}/extern/googletest" "extern/googletest")
|
add_subdirectory("${PROJECT_SOURCE_DIR}/extern/googletest" "extern/googletest" EXCLUDE_FROM_ALL)
|
||||||
include_directories("${gtest_SOURCE_DIR}/include")
|
include_directories("${gtest_SOURCE_DIR}/include")
|
||||||
mark_as_advanced(
|
mark_as_advanced(
|
||||||
BUILD_GMOCK BUILD_GTEST BUILD_SHARED_LIBS
|
BUILD_GMOCK BUILD_GTEST BUILD_SHARED_LIBS
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
# build a CPack driven installer package
|
# build a CPack driven installer package
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
set(CPACK_RESOURCE_FILE_LICENSE
|
set(CPACK_RESOURCE_FILE_LICENSE
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
|
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_MAJOR}")
|
set(CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_MAJOR}")
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_VERSION_MINOR}")
|
set(CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_VERSION_MINOR}")
|
||||||
|
|
||||||
# Debian settings
|
# Debian settings
|
||||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "K. Isom")
|
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "K. Isom")
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Shimmering Clarity C++ library")
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Shimmering Clarity C++ library")
|
||||||
set(CPACK_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
|
set(CPACK_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
|
||||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc++1 (>= 3.7.0-1)")
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc++1 (>= 3.7.0-1)")
|
||||||
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
set(CPACK_DEBIAN_PACKAGE_SECTION devel)
|
||||||
set(CPACK_DEBIAN_PACKAGE_SECTION devel)
|
|
||||||
|
|
||||||
# actually do the thing
|
# actually do the thing
|
||||||
set(CPACK_GENERATOR DEB)
|
set(CPACK_GENERATOR DEB)
|
||||||
include (CPack)
|
include (CPack)
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Via https://devblogs.microsoft.com/cppblog/clear-functional-c-documentation-with-sphinx-breathe-doxygen-cmake/
|
||||||
|
|
||||||
|
# Look for an executable called sphinx-build
|
||||||
|
find_program(SPHINX_EXECUTABLE
|
||||||
|
NAMES sphinx-build
|
||||||
|
DOC "Path to sphinx-build executable")
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
# Handle standard arguments to find_package like REQUIRED and QUIET
|
||||||
|
find_package_handle_standard_args(Sphinx
|
||||||
|
"Failed to find sphinx-build executable"
|
||||||
|
SPHINX_EXECUTABLE)
|
|
@ -14,4 +14,16 @@ add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
|
||||||
MAIN_DEPENDENCY Doxyfile
|
MAIN_DEPENDENCY Doxyfile
|
||||||
COMMENT "Generating docs")
|
COMMENT "Generating docs")
|
||||||
|
|
||||||
add_custom_target(Doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE})
|
add_custom_target(Doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE})
|
||||||
|
|
||||||
|
find_package(Sphinx REQUIRED)
|
||||||
|
|
||||||
|
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sphinx)
|
||||||
|
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/docs)
|
||||||
|
|
||||||
|
add_custom_target(Sphinx ALL
|
||||||
|
COMMAND
|
||||||
|
${SPHINX_EXECUTABLE} -b html
|
||||||
|
${SPHINX_SOURCE} ${SPHINX_BUILD}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
COMMENT "Generating documentation with Sphinx")
|
||||||
|
|
Loading…
Reference in New Issue