File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,33 @@ if (MAXMINDDB_BUILD_BINARIES)
107107 add_subdirectory (bin)
108108endif ()
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+
110137if (BUILD_TESTING)
111138 enable_testing ()
112139 add_subdirectory (t)
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments