Skip to content

Commit 0c40e0c

Browse files
committed
build: improve man page installation
man pages are extremely useful, but are not generally available on Windows. This changes the install condition to check for the Windows cross-compile rather than the toolchain in use. It is possible to build for Windows using clang in the GNU driver.
1 parent f5936d1 commit 0c40e0c

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ endif()
3939

4040
add_subdirectory(src)
4141
add_subdirectory(extensions)
42-
add_subdirectory(man)
42+
# TODO(compnerd) should this be enabled for MinGW, which sets CMAKE_SYSTEM_NAME
43+
# to Windows, but defines `MINGW`.
44+
if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
45+
add_subdirectory(man)
46+
endif()
4347
if(BUILD_TESTING)
4448
add_subdirectory(test testdir)
4549
if(CMARK_STATIC OR CMARK_SHARED)

man/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
if (NOT MSVC)
2-
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man1/cmark-gfm.1
3-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
4-
5-
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man3/cmark-gfm.3
6-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
7-
endif(NOT MSVC)
1+
install(FILES man1/cmark-gfm.1
2+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
3+
install(FILES man3/cmark-gfm.3
4+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)

0 commit comments

Comments
 (0)