Skip to content

Commit

Permalink
Merge pull request #353 from maxmind/greg/cmake-man
Browse files Browse the repository at this point in the history
Install man pages with CMake
  • Loading branch information
horgh authored Jul 2, 2024
2 parents e0562d5 + 6c82f58 commit a4fa79d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 4 deletions.
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,33 @@ if (MAXMINDDB_BUILD_BINARIES)
add_subdirectory(bin)
endif()

# Check if man pages exist, if not, generate them
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/man")
find_program(PERL perl)
if(PERL)
message(STATUS "Generating man pages")
execute_process(
COMMAND ${PERL} ${CMAKE_CURRENT_SOURCE_DIR}/dev-bin/make-man-pages.pl
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
else()
message(WARNING "Perl not found. Unable to generate man pages.")
endif()
endif()

# Install man pages if they exist
if(MAXMINDDB_INSTALL AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/man")
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/man/man1
DESTINATION ${CMAKE_INSTALL_MANDIR}
)

install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/man/man3
DESTINATION ${CMAKE_INSTALL_MANDIR}
)
endif()

if (BUILD_TESTING)
enable_testing()
add_subdirectory(t)
Expand Down
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.11.0

* When building with CMake, the man pages will now be generated and installed.
Requested by Thomas Klausner. GitHub #351.

## 1.10.0 - 2024-06-10

* When building with CMake, it is now possible to disable the building
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2013-2023 MaxMind, Inc.
Copyright 2013-2024 MaxMind, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Use `make safedist` to check the resulting tarball.

# Copyright and License

Copyright 2013-2023 MaxMind, Inc.
Copyright 2013-2024 MaxMind, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion doc/libmaxminddb.md
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ Rolsky (drolsky@maxmind.com).
# COPYRIGHT AND LICENSE
Copyright 2013-2023 MaxMind, Inc.
Copyright 2013-2024 MaxMind, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion doc/mmdblookup.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Rolsky (drolsky@maxmind.com).

# COPYRIGHT AND LICENSE

Copyright 2013-2023 MaxMind, Inc.
Copyright 2013-2024 MaxMind, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

0 comments on commit a4fa79d

Please sign in to comment.