Skip to content

Commit b2d07a2

Browse files
committed
Merge branch 'doxygen' into 'master'
Enable generation of Doxygen documentation See merge request nublar/pdal-c!3
2 parents ddf2654 + a8a0d80 commit b2d07a2

File tree

11 files changed

+1757
-3
lines changed

11 files changed

+1757
-3
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ tests/pdal-stats.las
33
tests/data/*.json
44
tests/pdal/capi/*Test.c
55

6+
# Ignore doxygen docs
7+
/doc/doxygen
8+
/doc/Doxyfile
9+
610
# Select VS Code configurations
711
.vscode/settings.json
812
.vscode/c_cpp_properties.json

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE STRING "CMake install prefi
2020
# Do not use a suffix for RelWithDebInfo
2121
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "CMake debug suffix")
2222
set(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "CMake RelWithDebInfo suffix")
23-
2423
set(PDALC_ENABLE_CODE_COVERAGE ON CACHE BOOL "Enable code coverage calculation")
2524
set(PDALC_GCC_PARAM_GGC_MIN_HEAPSIZE "131072" CACHE STRING "GCC garbage collection minimum heap size")
2625

26+
include(ObtainProjectVersion)
2727
include_directories("${CMAKE_SOURCE_DIR}/source")
2828

2929
if(CMAKE_COMPILER_IS_GNUCXX)
@@ -44,6 +44,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
4444
endif()
4545

4646
add_subdirectory("source/pdal/capi")
47+
add_subdirectory("doc")
4748

4849
include(CTest)
4950
add_subdirectory("tests/data")

cmake/ObtainProjectVersion.cmake

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# CMake script to derive project version from repository info
2+
3+
find_package(Git)
4+
5+
# Use `git describe` to derive patch and build info
6+
if(GIT_FOUND)
7+
execute_process(COMMAND "${GIT_EXECUTABLE}" "describe" "--tags" "--long"
8+
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT
9+
ERROR_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE GIT_DESCRIBE_ERROR)
10+
11+
# We use tags with the three version numbers
12+
# Use the remainder of the `git describe` output for the build ID
13+
if(GIT_DESCRIBE_OUTPUT MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)-([0-9]+)-g([a-f0-9]+)$")
14+
string(REGEX REPLACE "([0-9]+).*" "\\1" MAJOR_VERSION ${GIT_DESCRIBE_OUTPUT})
15+
string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" MINOR_VERSION ${GIT_DESCRIBE_OUTPUT})
16+
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\3" PATCH_VERSION ${GIT_DESCRIBE_OUTPUT})
17+
string(REGEX REPLACE ".*-(.*)-.*" "\\1" COMMIT_COUNT ${GIT_DESCRIBE_OUTPUT})
18+
string(REGEX REPLACE ".*-g(.*)" "\\1" COMMIT_ID ${GIT_DESCRIBE_OUTPUT})
19+
set(BUILD_ID "build ${COMMIT_COUNT} (${COMMIT_ID})")
20+
else()
21+
message(WARNING "Could not derive version and build ID: 'git describe' command output was \"${GIT_DESCRIBE_OUTPUT}\" - ${GIT_DESCRIBE_ERROR}")
22+
endif()
23+
24+
# Suffix BUILD_ID with " (with uncommitted changes)" if `git status --porcelain` does not return an empty string
25+
execute_process(COMMAND "${GIT_EXECUTABLE}" "status" "--porcelain"
26+
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE GIT_STATUS_OUTPUT)
27+
28+
if(NOT "${GIT_STATUS_OUTPUT}" STREQUAL "")
29+
string(APPEND BUILD_ID " with uncommitted changes")
30+
endif()
31+
else()
32+
message(WARNING "Could not derive version and build ID: Git not found")
33+
endif()
34+
35+
set(${PROJECT_NAME}_VERSION_MAJOR ${MAJOR_VERSION})
36+
set(${PROJECT_NAME}_VERSION_MINOR ${MINOR_VERSION})
37+
set(${PROJECT_NAME}_VERSION_PATCH ${PATCH_VERSION})
38+
set(${PROJECT_NAME}_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
39+
40+
string (TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPERCASE)
41+
set(${PROJECT_NAME_UPPERCASE}_VERSION_MAJOR ${${PROJECT_NAME}_VERSION_MAJOR})
42+
set(${PROJECT_NAME_UPPERCASE}_VERSION_MINOR ${${PROJECT_NAME}_VERSION_MINOR})
43+
set(${PROJECT_NAME_UPPERCASE}_VERSION_PATCH ${${PROJECT_NAME}_VERSION_PATCH})
44+
set(${PROJECT_NAME_UPPERCASE}_VERSION ${${PROJECT_NAME}_VERSION})

doc/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# CMake configuration file for Keryx documentation
2+
3+
find_package(Doxygen)
4+
5+
if (DOXYGEN_FOUND)
6+
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in" "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile")
7+
8+
add_custom_target( "${PROJECT_NAME}_doxygen" ALL
9+
COMMAND ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile"
10+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
11+
COMMENT "Generating API documentation with Doxygen"
12+
VERBATIM )
13+
14+
install(DIRECTORY doxygen DESTINATION doc)
15+
else()
16+
message(STATUS "Could not generate ${PROJECT_NAME} API help documentation: Doxygen not found")
17+
endif()

0 commit comments

Comments
 (0)