Skip to content

Commit a4fa79d

Browse files
authored
Merge pull request #353 from maxmind/greg/cmake-man
Install man pages with CMake
2 parents e0562d5 + 6c82f58 commit a4fa79d

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed

CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,33 @@ if (MAXMINDDB_BUILD_BINARIES)
107107
add_subdirectory(bin)
108108
endif()
109109

110+
# Check if man pages exist, if not, generate them
111+
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/man")
112+
find_program(PERL perl)
113+
if(PERL)
114+
message(STATUS "Generating man pages")
115+
execute_process(
116+
COMMAND ${PERL} ${CMAKE_CURRENT_SOURCE_DIR}/dev-bin/make-man-pages.pl
117+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
118+
)
119+
else()
120+
message(WARNING "Perl not found. Unable to generate man pages.")
121+
endif()
122+
endif()
123+
124+
# Install man pages if they exist
125+
if(MAXMINDDB_INSTALL AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/man")
126+
install(
127+
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/man/man1
128+
DESTINATION ${CMAKE_INSTALL_MANDIR}
129+
)
130+
131+
install(
132+
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/man/man3
133+
DESTINATION ${CMAKE_INSTALL_MANDIR}
134+
)
135+
endif()
136+
110137
if (BUILD_TESTING)
111138
enable_testing()
112139
add_subdirectory(t)

Changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.11.0
2+
3+
* When building with CMake, the man pages will now be generated and installed.
4+
Requested by Thomas Klausner. GitHub #351.
5+
16
## 1.10.0 - 2024-06-10
27

38
* When building with CMake, it is now possible to disable the building

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2013-2023 MaxMind, Inc.
1+
Copyright 2013-2024 MaxMind, Inc.
22

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Use `make safedist` to check the resulting tarball.
126126

127127
# Copyright and License
128128

129-
Copyright 2013-2023 MaxMind, Inc.
129+
Copyright 2013-2024 MaxMind, Inc.
130130

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

doc/libmaxminddb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ Rolsky ([email protected]).
883883
884884
# COPYRIGHT AND LICENSE
885885
886-
Copyright 2013-2023 MaxMind, Inc.
886+
Copyright 2013-2024 MaxMind, Inc.
887887
888888
Licensed under the Apache License, Version 2.0 (the "License");
889889
you may not use this file except in compliance with the License.

doc/mmdblookup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Rolsky ([email protected]).
8686

8787
# COPYRIGHT AND LICENSE
8888

89-
Copyright 2013-2023 MaxMind, Inc.
89+
Copyright 2013-2024 MaxMind, Inc.
9090

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

0 commit comments

Comments
 (0)