<commit_before>cmake_minimum_required (VERSION 3.0)
project (cxl VERSION 0.1.0)
find_package(X11 REQUIRED COMPONENTS Xkbfile)
add_executable(${PROJECT_NAME} cxl.c)
target_link_libraries(${PROJECT_NAME} ${X11_LIBRARIES} ${X11_Xkbfile_LIB})
include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
find_program(A2X NAMES a2x a2x.py)
find_program(BZIP2 bzip2)
set(ENV{${PROJECT_NAME}_VERSION} ${CMAKE_VERSION})
set(A2X_OPTS -f manpage
             -D ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.1
    COMMAND ${A2X} ${A2X_OPTS} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1.txt
    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1.txt
    VERBATIM
)
add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.1.bz2
    COMMAND ${BZIP2} -f ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.1
    DEPENDS ${PROJECT_NAME}.1
    COMMENT "Compressing ${PROJECT_NAME}.1"
    VERBATIM
)
add_custom_target(man ALL DEPENDS ${PROJECT_NAME}.1.bz2)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.1.bz2 DESTINATION ${CMAKE_INSTALL_MANDIR})
set(CPACK_GENERATOR "DEB;RPM;TBZ2")
set(CPACK_PACKAGE_CONTACT "<NAME>")
include(CPack)<commit_msg>Man page prepared only when it is necessary<commit_after>cmake_minimum_required (VERSION 3.0)
project (cxl VERSION 0.1.0)
find_package(X11 REQUIRED COMPONENTS Xkbfile)
add_executable(${PROJECT_NAME} cxl.c)
target_link_libraries(${PROJECT_NAME} ${X11_LIBRARIES} ${X11_Xkbfile_LIB})
include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
find_program(A2X NAMES a2x a2x.py)
find_program(BZIP2 bzip2)
set(MAN ${PROJECT_NAME}.1)
set(MAN_TXT ${MAN}.txt)
set(MAN_TXT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_TXT})
set(MAN_COMPRESSED ${MAN}.bz2)
add_custom_command(
    OUTPUT ${MAN_COMPRESSED}
    COMMAND ${CMAKE_COMMAND} -E copy ${MAN_TXT_SOURCE} ${MAN_TXT}
    COMMAND ${A2X} -f manpage ${MAN_TXT}
    COMMAND ${CMAKE_COMMAND} -E remove ${MAN_TXT}
    COMMAND ${BZIP2} -f ${MAN}
    DEPENDS ${MAN_TXT_SOURCE}
    COMMENT "Preparing man page ${MAN_COMPRESSED}"
    VERBATIM
)
add_custom_target(man ALL DEPENDS ${MAN_COMPRESSED})
install(
    FILES ${CMAKE_CURRENT_BINARY_DIR}/${MAN_COMPRESSED}
    DESTINATION ${CMAKE_INSTALL_MANDIR}
)
set(CPACK_GENERATOR "DEB;RPM;TBZ2")
set(CPACK_PACKAGE_CONTACT "<NAME>")
include(CPack)
{'fraction_non_alphanumeric': 0.12875, 'fraction_numerical': 0.0225, 'mean_word_length': 7.222602739726027, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3164383', 'n_tokens_mistral': 1034, 'n_tokens_neox': 983, 'n_words': 156}