Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install man pages with CMake #353

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ([email protected]).

# 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 ([email protected]).

# 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
Loading